-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b161
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8176955 | 10 | Srikanth Adayapalam | P2 | Resolved | Fixed | b03 |
Let's consider interface below:
interface MyIntf {
private int foo(int x) { return x+1; }
}
When it's compiled and resulted class-file is processed by annotation processor the j.l.m.e.Element instance corresponding to the method foo has 'private' and 'default' modifiers as j.l.m.e.Element.getModifiers() method returns. This looks like a bug.
The minimized testcase is attached in order to reproduce, please:
1. Unzip attached archive to some directory on Unix/Linux machine, say A;
2. Modify A/Test61/test.sh by setting JDK_HOME to your JDK root dir;
3. Run A/Test61/test.sh;
This results in following output:
Enclosed element: foo(int) modifiers [private]
Enclosed element: foo(int) modifiers [private, default]
The first line corresponds to annotation processor running against source file.
The second one corresponds to annotation processor running against class file.
interface MyIntf {
private int foo(int x) { return x+1; }
}
When it's compiled and resulted class-file is processed by annotation processor the j.l.m.e.Element instance corresponding to the method foo has 'private' and 'default' modifiers as j.l.m.e.Element.getModifiers() method returns. This looks like a bug.
The minimized testcase is attached in order to reproduce, please:
1. Unzip attached archive to some directory on Unix/Linux machine, say A;
2. Modify A/Test61/test.sh by setting JDK_HOME to your JDK root dir;
3. Run A/Test61/test.sh;
This results in following output:
Enclosed element: foo(int) modifiers [private]
Enclosed element: foo(int) modifiers [private, default]
The first line corresponds to annotation processor running against source file.
The second one corresponds to annotation processor running against class file.
- backported by
-
JDK-8176955 Annotation processor observes interface private methods as default methods
-
- Resolved
-