You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benedikt Ritter (JIRA)" <ji...@apache.org> on 2014/01/12 12:36:51 UTC

[jira] [Commented] (LANG-613) ConstructorUtils.getAccessibleConstructor() Does Not Check the Accessibility of Enclosing Classes

    [ https://issues.apache.org/jira/browse/LANG-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13869010#comment-13869010 ] 

Benedikt Ritter commented on LANG-613:
--------------------------------------

{quote}
a constructor of an inner class can still be visible if it is contained within a class with default or protected visibility and the accessing code is in the right package
{quote}

although this is true, it is very unlikely to happen, since the calling code that does the reflection is in package {{org.apache.commons.lang3}}.

> ConstructorUtils.getAccessibleConstructor() Does Not Check the Accessibility of Enclosing Classes
> -------------------------------------------------------------------------------------------------
>
>                 Key: LANG-613
>                 URL: https://issues.apache.org/jira/browse/LANG-613
>             Project: Commons Lang
>          Issue Type: Bug
>          Components: lang.reflect.*
>    Affects Versions: 3.0
>            Reporter: David M. Sledge
>            Priority: Minor
>              Labels: patch
>             Fix For: Review Patch
>
>         Attachments: LANG-613_Recursive_visibility_check_up_the_enclosing_tree.patch
>
>
> ConstructorUtils.getAccessibleConstructor() checks if the declaring class is public but not whether it's a top-level class or an enclosed one.  Consequently, with enclosed declaring classes, the method does not check if the enclosing class is public, or it's enclosing class, or it's enclosing class, etc...



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)