]> source.dussan.org Git - javassist.git/commitdiff
fixed a bug that the compiler reports an error when "length" is used as a class or...
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sun, 3 Jul 2011 01:37:51 +0000 (01:37 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sun, 3 Jul 2011 01:37:51 +0000 (01:37 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@583 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

.classpath
src/main/javassist/compiler/TypeChecker.java

index 2810d72786967e2888bf0baf325fa9257fb93a27..cee66ff0384b1e6edf7e661684e6d6bbf5929343 100644 (file)
@@ -2,7 +2,7 @@
 <classpath>
        <classpathentry excluding="javassist/util/HotSwapper.java" kind="src" path="src/main"/>
        <classpathentry kind="src" path="src/test"/>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="lib" path="lib/junit.jar"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="output" path="eclipse-output/classes"/>
 </classpath>
index d2cb861c757105d726f376dd5b518943ed71a7e9..5f7e5fa3c637595fef6e6feb1e10589d9ec9b27c 100644 (file)
@@ -564,7 +564,13 @@ public class TypeChecker extends Visitor implements Opcode, TokenId {
         if (token == '.') {
             String member = ((Symbol)expr.oprand2()).get();
             if (member.equals("length"))
-                atArrayLength(expr);
+                try {
+                    atArrayLength(expr);
+                }
+                catch (NoFieldException nfe) {
+                    // length might be a class or package name.
+                    atFieldRead(expr);
+                }
             else if (member.equals("class"))                
                 atClassObject(expr);  // .class
             else