Bug 308295

Summary: Annotation on parameter causes java.lang.Method.getModifiers() to return 0
Product: [Eclipse Project] JDT Reporter: Francis Barber <fedora>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: fedora, Olivier_Thomann, StevenGBrown
Version: 3.5   
Target Milestone: 3.6 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Francis Barber CLA 2010-04-07 04:29:41 EDT
Build Identifier: I20090611-1540

Consider two methods foo and bar and an annotation @Anno:
private void foo(String s);
private void bar(@Anno String s);

When using the eclipse compiler, using refection to get the modifiers for foo returns 2, as expected.  However, using reflection to get the modifiers for bar returns 0.

When using the sun compiler both foo and bar are reported to have the modifier 2.

Reproducible: Always

Steps to Reproduce:
1. Write some code that uses reflection to the get the modifiers on a private method that has an annotation on a parameter.
2. Compile the code using the eclipse compiler.
3. Execute the code and observe that java.lang.Method.getModifiers() returns 0 (it should return 2).
Comment 1 Olivier Thomann CLA 2010-04-07 09:36:26 EDT
Closing as a duplicate of bug 289576

*** This bug has been marked as a duplicate of bug 289576 ***
Comment 2 Olivier Thomann CLA 2010-04-07 09:36:56 EDT
Francis, please verify that this works fine using 3.6M6.
Comment 3 Francis Barber CLA 2010-04-23 03:20:57 EDT
I have tried this in I20100312-1448, and the problem has been fixed.