Community
Participate
Working Groups
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 Build Identifier: I20090611-1540 When generating code for a private method with an annotated parameter, the Eclipse compiler changes (or ignores) the 'private' modifier so that the method becomes a 'package-private' one in the class file. Reproducible: Always Steps to Reproduce: 1. Compile the soon to be attached Eclipse Java project. 2. Run the command 'javap -private foo.A' from the 'bin' directory to see there is no 'private' modifier on the method foo() in the generated class file.
Created attachment 147295 [details] Test project
Reproduced. Investigating.
Created attachment 147338 [details] Proposed fix + regression test
Released for 3.6M3. Regression test added in: org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test271
Looking at the fix, it seems to me that the same thing will happen if a private constructor has an annotated parameter. Though I may well be missing something, of course.
Yes, I realized that as well. I'll reopen and try to use another bit for the check.
Created attachment 147559 [details] Proposed fix Running all tests.
Released for 3.6M3.
The regression tests are: org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test271 org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test273
Verified for 3.6M3 with build I20091026-0800
*** Bug 308295 has been marked as a duplicate of this bug. ***