Bug 289576 - Compiler changes 'private' modifier on methods with annotated parameter
Summary: Compiler changes 'private' modifier on methods with annotated parameter
Status: VERIFIED FIXED
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 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 308295 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-09-16 07:11 EDT by Vladimir Piskarev CLA
Modified: 2010-04-07 21:51 EDT (History)
4 users (show)

See Also:


Attachments
Test project (1.39 KB, application/zip)
2009-09-16 07:19 EDT, Vladimir Piskarev CLA
no flags Details
Proposed fix + regression test (2.68 KB, patch)
2009-09-16 12:44 EDT, Olivier Thomann CLA
no flags Details | Diff
Proposed fix (3.29 KB, patch)
2009-09-18 10:04 EDT, Olivier Thomann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Piskarev CLA 2009-09-16 07:11:05 EDT
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.
Comment 1 Vladimir Piskarev CLA 2009-09-16 07:19:18 EDT
Created attachment 147295 [details]
Test project
Comment 2 Olivier Thomann CLA 2009-09-16 12:12:57 EDT
Reproduced. Investigating.
Comment 3 Olivier Thomann CLA 2009-09-16 12:44:06 EDT
Created attachment 147338 [details]
Proposed fix + regression test
Comment 4 Olivier Thomann CLA 2009-09-16 12:44:41 EDT
Released for 3.6M3.
Regression test added in:
org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test271
Comment 5 Vladimir Piskarev CLA 2009-09-18 02:50:35 EDT
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.
Comment 6 Olivier Thomann CLA 2009-09-18 06:45:27 EDT
Yes, I realized that as well.
I'll reopen and try to use another bit for the check.
Comment 7 Olivier Thomann CLA 2009-09-18 10:04:47 EDT
Created attachment 147559 [details]
Proposed fix

Running all tests.
Comment 8 Olivier Thomann CLA 2009-09-18 11:05:20 EDT
Released for 3.6M3.
Comment 9 Olivier Thomann CLA 2009-09-18 11:06:00 EDT
The regression tests are:
org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test271
org.eclipse.jdt.core.tests.compiler.regression.AnnotationTest#test273
Comment 10 Jay Arthanareeswaran CLA 2009-10-27 04:54:39 EDT
Verified for 3.6M3 with build I20091026-0800
Comment 11 Olivier Thomann CLA 2010-04-07 09:36:26 EDT
*** Bug 308295 has been marked as a duplicate of this bug. ***