diff options
author | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2011-07-03 01:37:51 +0000 |
---|---|---|
committer | chiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2011-07-03 01:37:51 +0000 |
commit | 017837076454aee2343780a1ba29f22fa94eb924 (patch) | |
tree | d8b0e3456cf5ca84b513dd3ce60803a47fcc9fc4 /src | |
parent | 41bb82351ccedc78bcff9271453edb8e42c8a66d (diff) | |
download | javassist-017837076454aee2343780a1ba29f22fa94eb924.tar.gz javassist-017837076454aee2343780a1ba29f22fa94eb924.zip |
fixed a bug that the compiler reports an error when "length" is used as a class or package name.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@583 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src')
-rw-r--r-- | src/main/javassist/compiler/TypeChecker.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/javassist/compiler/TypeChecker.java b/src/main/javassist/compiler/TypeChecker.java index d2cb861c..5f7e5fa3 100644 --- a/src/main/javassist/compiler/TypeChecker.java +++ b/src/main/javassist/compiler/TypeChecker.java @@ -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 |