Bug 308295 - Annotation on parameter causes java.lang.Method.getModifiers() to return 0
Summary: Annotation on parameter causes java.lang.Method.getModifiers() to return 0
Status: CLOSED DUPLICATE of bug 289576
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-07 04:29 EDT by Francis Barber CLA
Modified: 2010-04-23 03:20 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.