Bug 41516 - incorrect errors in compilationUnit.getProblems()
Summary: incorrect errors in compilationUnit.getProblems()
Status: RESOLVED DUPLICATE of bug 40476
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 2.1.1   Edit
Hardware: PC Windows 2000
: P3 major (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-08-13 18:11 EDT by Kelvin CLA
Modified: 2003-08-14 10:55 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kelvin CLA 2003-08-13 18:11:10 EDT
Test case :

file : A.java
public class A {

    public void method() {
        switch(1) {
             case B.ONE : break;
             case B.TWO : break;
        }
    }
}

file : B.java
public interface B {
    int ONE = 1;
    int TWO = 2;
}

If you compile these the A.java, there shouldn't have any compilation error. 
However, in :

IProblem[] probs 
  = compilationUnit.getProblems();  // org.eclipse.jdt.core.dom.CompilationUnit

You will see two errors are found. Both are "case expressions must be constant 
expressions"
Comment 1 Olivier Thomann CLA 2003-08-14 09:55:29 EDT
Looks like a duplicate of bug 40476.
Comment 2 Olivier Thomann CLA 2003-08-14 10:55:12 EDT
Close as duplicate of bug 40476.

*** This bug has been marked as a duplicate of 40476 ***