Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipse-dev] Warning: compiler fix for 14013 can cause some existing code to be rejected

The Eclipse Java compiler incorrectly tolerated invalid constant
expressions, such as:

class X {
      final int CST = 0;
      void foo(int i){
            switch(i){
                  case this.CST : break;  // should report "invalid
constant expression"
            }
      }
}

This will be fixed into the next integration build, and may cause some
existing code to be flagged with errors where it did not in the past.

Also see: http://bugs.eclipse.org/bugs/show_bug.cgi?id=14013

In sources from build 20020416, the only occurrences are located in:

Kind  Status      Priority    Description Resource    In Folder   Location
Error             case expressions must be constant expressions
SchemaCompositor.java
org.eclipse.pde.core/src-pdecore/org/eclipse/pde/internal/core/schema
line 103 in SchemaCompositor.write(String, PrintWriter)
Error             case expressions must be constant expressions
SchemaCompositor.java
org.eclipse.pde.core/src-pdecore/org/eclipse/pde/internal/core/schema
line 106 in SchemaCompositor.write(String, PrintWriter)
Error             case expressions must be constant expressions
SchemaCompositor.java
org.eclipse.pde.core/src-pdecore/org/eclipse/pde/internal/core/schema
line 109 in SchemaCompositor.write(String, PrintWriter)
Error             case expressions must be constant expressions
SchemaCompositor.java
org.eclipse.pde.core/src-pdecore/org/eclipse/pde/internal/core/schema
line 112 in SchemaCompositor.write(String, PrintWriter)




Back to the top