aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/compiler/MemberCodeGen.java
diff options
context:
space:
mode:
authorchibash <chiba@javassist.org>2014-11-23 01:08:22 +0900
committerchibash <chiba@javassist.org>2014-11-23 01:08:22 +0900
commitf2093c28be24336593e1ebd9c2c633ee0f8c5b5c (patch)
treea143744ccbf9c43fa70e88940f36f96136870e79 /src/main/javassist/compiler/MemberCodeGen.java
parente000e8f682a284b7b5d0c03ca32866e745045fa0 (diff)
downloadjavassist-f2093c28be24336593e1ebd9c2c633ee0f8c5b5c.tar.gz
javassist-f2093c28be24336593e1ebd9c2c633ee0f8c5b5c.zip
fiexed JASSIST-238
Diffstat (limited to 'src/main/javassist/compiler/MemberCodeGen.java')
-rw-r--r--src/main/javassist/compiler/MemberCodeGen.java58
1 files changed, 36 insertions, 22 deletions
diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java
index 167e4ccc..f799eea0 100644
--- a/src/main/javassist/compiler/MemberCodeGen.java
+++ b/src/main/javassist/compiler/MemberCodeGen.java
@@ -489,30 +489,44 @@ public class MemberCodeGen extends CodeGen {
}
else if (op == '.') {
ASTree target = e.oprand1();
- if (target instanceof Keyword)
- if (((Keyword)target).get() == SUPER)
- isSpecial = true;
-
- try {
- target.accept(this);
+ String classFollowedByDotSuper = TypeChecker.isDotSuper(target);
+ if (classFollowedByDotSuper != null) {
+ isSpecial = true;
+ targetClass = MemberResolver.getSuperInterface(thisClass,
+ classFollowedByDotSuper);
+ if (inStaticMethod || (cached != null && cached.isStatic()))
+ isStatic = true; // should be static
+ else {
+ aload0pos = bytecode.currentPc();
+ bytecode.addAload(0); // this
+ }
}
- catch (NoFieldException nfe) {
- if (nfe.getExpr() != target)
- throw nfe;
-
- // it should be a static method.
- exprType = CLASS;
- arrayDim = 0;
- className = nfe.getField(); // JVM-internal
- isStatic = true;
+ else {
+ if (target instanceof Keyword)
+ if (((Keyword)target).get() == SUPER)
+ isSpecial = true;
+
+ try {
+ target.accept(this);
+ }
+ catch (NoFieldException nfe) {
+ if (nfe.getExpr() != target)
+ throw nfe;
+
+ // it should be a static method.
+ exprType = CLASS;
+ arrayDim = 0;
+ className = nfe.getField(); // JVM-internal
+ isStatic = true;
+ }
+
+ if (arrayDim > 0)
+ targetClass = resolver.lookupClass(javaLangObject, true);
+ else if (exprType == CLASS /* && arrayDim == 0 */)
+ targetClass = resolver.lookupClassByJvmName(className);
+ else
+ badMethod();
}
-
- if (arrayDim > 0)
- targetClass = resolver.lookupClass(javaLangObject, true);
- else if (exprType == CLASS /* && arrayDim == 0 */)
- targetClass = resolver.lookupClassByJvmName(className);
- else
- badMethod();
}
else
badMethod();