Bug 192387 - Wrong warning location for a non static reference to an enum value.
Summary: Wrong warning location for a non static reference to an enum value.
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-13 05:20 EDT by David Audel CLA
Modified: 2007-08-07 06:12 EDT (History)
0 users

See Also:


Attachments
Proposed fix (5.94 KB, patch)
2007-06-22 11:36 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 David Audel CLA 2007-06-13 05:20:50 EDT
build 3.3RC4.

1) create EnumA.java
public enum EnumA {
  B1,
  B2;
  public void foo(){}
}
class ClassC {
  void bar() {
    EnumA.B1.B1.foo();
    EnumA.B1.B2.foo();
  }
}
2) compile EnumA.java

Then there is two warning:
The static field EnumA.B1 should be accessed in a static way
The static field EnumA.B2 should be accessed in a static way

For the first warning the first B1 is underlined 'EnumA.<<B1>>.B1.foo();'.
For the second warning B2 is underlined 'EnumA.B1.<<B2>>.foo();'.

The second B1 should be underlined instead the first 'EnumA.B1.<<B1>>.foo();'.
Comment 1 Olivier Thomann CLA 2007-06-18 14:24:56 EDT
The index in the qualified name needs to be passed to the problemm reporter.
Comment 2 Olivier Thomann CLA 2007-06-22 11:36:50 EDT
Created attachment 72185 [details]
Proposed fix
Comment 3 Olivier Thomann CLA 2007-07-14 20:15:04 EDT
Released for 3.4M1.
Comment 4 Frederic Fusier CLA 2007-08-07 06:12:11 EDT
Verified for 3.4M1 using build I20070806-1800.