jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Metacircular Research Platform
  • MRP-2

Class.getMethod doesn't match specification

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.1
  • Fix Version/s: 0.1
  • Component/s: None
  • Labels:
    None

Description

Class.getMethod searches recursively up through superclasses, it also returns the answer with the most assignable return type (eg it prefers Object over Integer). However, when an answer is found the superclasses shouldn't be searched as doing so yields problems with for example:

class A {
static void foo() {...}
}
class B extends A {
static void foo() {...}
}

B.class.getMethod("foo",new Class[]{}) will currently return A.foo and not B.foo

Issue Links

is related to

Bug - A problem which impairs or prevents the functions of the product. MRP-3 Incorrect wrapping of InvocationTargetException with bytecode reflection

  • Major - Major loss of function.
  • Open - The issue is open and ready for the assignee to start work on it.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Ian Rogers added a comment - 30/Mar/09 7:09 PM

Fixed, http://git.codehaus.org/gitweb.cgi?p=mrp.git;a=blobdiff;f=libraryInterface/Common/src/java/lang/Class.java;h=d6c9d1863d3d7b1d31a9ccc348c2addaf57b373d;hp=8c10785c3fea2b6aab8e5e28b9ed83058b7aee09;hb=511d0148d432f93c7d7e6c89633ab693c26d5268;hpb=cda33b4c8ad40c2e20f4edfeb1b7ae119db85fef

Show
Ian Rogers added a comment - 30/Mar/09 7:09 PM Fixed, http://git.codehaus.org/gitweb.cgi?p=mrp.git;a=blobdiff;f=libraryInterface/Common/src/java/lang/Class.java;h=d6c9d1863d3d7b1d31a9ccc348c2addaf57b373d;hp=8c10785c3fea2b6aab8e5e28b9ed83058b7aee09;hb=511d0148d432f93c7d7e6c89633ab693c26d5268;hpb=cda33b4c8ad40c2e20f4edfeb1b7ae119db85fef

People

  • Assignee:
    Ian Rogers
    Reporter:
    Ian Rogers
Vote (0)
Watch (0)

Dates

  • Created:
    30/Mar/09 6:53 PM
    Updated:
    06/Jun/09 3:56 PM
    Resolved:
    06/Jun/09 3:56 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.