Commons Lang
  1. Commons Lang
  2. LANG-216

[lang] [patch] Provides a Class.getPublicMethod which returns public invocable Method

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Due to a bug into the JDK reflection API, no public classes can be difficult to
      invoke by reflecting. See the related bug:
      http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4071957

      The workaround consists to find the right Method declaration into the interfaces
      and superclasses.

      A ClassUtils.getPublicMethod(Class cls, String methodName, Class
      parameterTypes[]) can provide this small search.

        Activity

        Hide
        Alban Peignier added a comment -
            • COM-2013 has been marked as a duplicate of this bug. ***
        Show
        Alban Peignier added a comment - COM-2013 has been marked as a duplicate of this bug. ***
        Hide
        Alban Peignier added a comment -

        Created an attachment (id=14641)
        Add the ClassUtils.getPublicMethod method

        proposed ClassUtils.getPublicMethod implementation

        Show
        Alban Peignier added a comment - Created an attachment (id=14641) Add the ClassUtils.getPublicMethod method proposed ClassUtils.getPublicMethod implementation
        Hide
        Henri Yandell added a comment -

        Applied to the current code. This is the kind of thing that Lang exists for in
        my opinion.

        I added a unit test showing the Java bug - so that when it gets fixed we'll know.

        Added new method to allow work-arounds for Java Applied to the current code. This is the kind of thing that Lang exists for in
        my opinion.

        I added a unit test showing the Java bug - so that when it gets fixed we'll know.

        Added new method to allow work-arounds for Java bug 4071957; as specified in
        issue 34351
        Sending src/java/org/apache/commons/lang/ClassUtils.java
        Sending src/test/org/apache/commons/lang/ClassUtilsTest.java
        Transmitting file data ..
        Committed revision 395153. ; as specified in
        issue 34351
        Sending src/java/org/apache/commons/lang/ClassUtils.java
        Sending src/test/org/apache/commons/lang/ClassUtilsTest.java
        Transmitting file data ..
        Committed revision 395153.

        Show
        Henri Yandell added a comment - Applied to the current code. This is the kind of thing that Lang exists for in my opinion. I added a unit test showing the Java bug - so that when it gets fixed we'll know. Added new method to allow work-arounds for Java Applied to the current code. This is the kind of thing that Lang exists for in my opinion. I added a unit test showing the Java bug - so that when it gets fixed we'll know. Added new method to allow work-arounds for Java bug 4071957; as specified in issue 34351 Sending src/java/org/apache/commons/lang/ClassUtils.java Sending src/test/org/apache/commons/lang/ClassUtilsTest.java Transmitting file data .. Committed revision 395153. ; as specified in issue 34351 Sending src/java/org/apache/commons/lang/ClassUtils.java Sending src/test/org/apache/commons/lang/ClassUtilsTest.java Transmitting file data .. Committed revision 395153.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alban Peignier
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development