aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/CtClassType.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/CtClassType.java')
-rw-r--r--src/main/javassist/CtClassType.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/javassist/CtClassType.java b/src/main/javassist/CtClassType.java
index 1eb9ba35..04500c2d 100644
--- a/src/main/javassist/CtClassType.java
+++ b/src/main/javassist/CtClassType.java
@@ -358,12 +358,20 @@ class CtClassType extends CtClass {
}
public int getModifiers() {
- int acc = getClassFile2().getAccessFlags();
+ ClassFile cf = getClassFile2();
+ int acc = cf.getAccessFlags();
acc = AccessFlag.clear(acc, AccessFlag.SUPER);
+ int inner = cf.getInnerAccessFlags();
+ if (inner != -1 && (inner & AccessFlag.STATIC) != 0)
+ acc |= AccessFlag.STATIC;
+
return AccessFlag.toModifier(acc);
}
public void setModifiers(int mod) {
+ if (Modifier.isStatic(mod))
+ throw new RuntimeException("cannot set to static");
+
checkModify();
int acc = AccessFlag.of(mod) | AccessFlag.SUPER;
getClassFile2().setAccessFlags(acc);