Community
Participate
Working Groups
Created attachment 274611 [details] Test cource code Hello, i have small problem in my work project - i development and debug in Eclipse successfully, but i have compilation error in JDK 1.7. I create simple test - src_error.zip C:\Java\Java64\jdk1.7.0_80\bin\javac.exe ./src/com/bercut/test/Main.java .\src\com\bercut\test\Main.java:8: error: cannot find symbol class OperationInfo implements Comparator<MessageInfo> { ^ symbol: class MessageInfo location: class Main 1 error Problem in imports - "import com.bercut.test.Main.OperationInfo.MessageInfo;" Compilation JDK 1.7 is OK after i make change: 1) Delete imports - delete string "import com.bercut.test.Main.OperationInfo.MessageInfo;" 2) Change declaration "class OperationInfo" to "class OperationInfo implements Comparator<OperationInfo.MessageInfo>" JDT always compiles successfully. What is the reason for the different results of the compilers (JDK1.7 and JDT)?
Created attachment 274612 [details] Test cource code for OK compilation
From JLS §6.3: "The scope of a declaration is the region of the program within which the entity declared by the declaration can be referred to using a simple name, provided it is not shadowed (§6.4.1)." "The scope of a declaration of a member m declared in or inherited by a class type C (§8.1.6) is the entire body of C, including any nested type declarations." From this, the simple name "MessageInfo" is valid throughout the body of class OperationInfo. Question is, whether the super interface reference is "inside" or "outside" class OperationInfo. One should normally assume that the "body" starts at the "{" and not before. OTOH, I vaguely recall that super type references do need to be treated specially in some situations. Will have to dig out the use case before we can make a call.
Bulk move out of 4.11
Bulk move to 4.14
Bulk move of unassigned bugs to 4.15
Bulk move to 4.16
Bulk move of unassigned bugs to 4.17
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.