commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9806] New: - MethodUtils.getAccessibleMethod(Method): wrong accessibility check of the class
Date Wed, 12 Jun 2002 13:22:38 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9806>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9806

MethodUtils.getAccessibleMethod(Method): wrong accessibility check of the class

           Summary: MethodUtils.getAccessibleMethod(Method): wrong
                    accessibility check of the class
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Bean Utilities
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: gsteinacker@pironet-ndh.com


If you have a nested class which is not public, you can access methods of this
class from the surrounding class:
class A
{
  class B { 
    String getHello() { return "hello"; } 
  }

  public A() { 
    System.out.println((new B()).getHello()); 
  }
}
Using the class PropertyUtils, you can not get the 'hello' bean property,
because in MethodUtils.getAccessibleMethod(Method) the modifiers of B are
checked for 'public' accessibility.
The test should (not tested...) also fail for classes with package scope.

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message