]> source.dussan.org Git - javassist.git/commitdiff
Javassist has been producing an interface with a wrong modifier. I fixed this.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sat, 5 May 2007 03:47:52 +0000 (03:47 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Sat, 5 May 2007 03:47:52 +0000 (03:47 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@367 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/CtClass.java
src/main/javassist/CtClassType.java
src/main/javassist/bytecode/ClassFile.java
src/main/javassist/bytecode/ClassFileWriter.java

index e801a224a0a5621d051d4d3c8dcb91a5cfbdc868..b35b31001878d85a6c55cb4d51f18e29508fe9e3 100644 (file)
@@ -52,7 +52,7 @@ public abstract class CtClass {
     /**
      * The version number of this release.
      */
-    public static final String version = "3.5GA";
+    public static final String version = "3.6.0BETA";
 
     /**
      * Prints the version number and the copyright notice.
@@ -63,7 +63,7 @@ public abstract class CtClass {
      */
     public static void main(String[] args) {
         System.out.println("Javassist version " + CtClass.version);
-        System.out.println("Copyright (C) 1999-2006 Shigeru Chiba."
+        System.out.println("Copyright (C) 1999-2007 Shigeru Chiba."
                            + " All Rights Reserved.");
     }
 
index 0ec764e45096c7572d92491655ce6aa701dbea7a..d9146d0aa0a08d45312a0feee1c333d287db7545 100644 (file)
@@ -414,8 +414,7 @@ class CtClassType extends CtClass {
         }
 
         checkModify();
-        int acc = AccessFlag.of(mod) | AccessFlag.SUPER;
-        cf.setAccessFlags(acc);
+        cf.setAccessFlags(AccessFlag.of(mod));
     }
 
     public Object[] getAnnotations() throws ClassNotFoundException {
index 82221d4590fcba3919652cdaac50769cd02342f4..50b6cacdd9cf50ecae72a62bd4c21c447e5c4564 100644 (file)
@@ -68,8 +68,7 @@ public final class ClassFile {
         constPool = new ConstPool(classname);
         thisClass = constPool.getThisClassInfo();
         if (isInterface)
-            accessFlags = AccessFlag.SUPER | AccessFlag.INTERFACE
-                    | AccessFlag.ABSTRACT;
+            accessFlags = AccessFlag.INTERFACE | AccessFlag.ABSTRACT;
         else
             accessFlags = AccessFlag.SUPER;
 
@@ -237,7 +236,10 @@ public final class ClassFile {
      * @see javassist.bytecode.AccessFlag
      */
     public void setAccessFlags(int acc) {
-        accessFlags = acc | AccessFlag.SUPER;
+        if ((acc & AccessFlag.INTERFACE) == 0)
+            acc |= AccessFlag.SUPER;
+
+        accessFlags = acc;
     }
 
     /**
index 2d667a864887ea97f402da5f701bc502afe88421..b4f8389586cde30719772990ec76063f616b59d7 100644 (file)
@@ -45,7 +45,8 @@ public class ClassFileWriter {
         int mod
             = AccessFlag.toModifier(cf.getAccessFlags()
                                     & ~AccessFlag.SYNCHRONIZED);
-        out.println("major: " + cf.major + ", minor: " + cf.minor);
+        out.println("major: " + cf.major + ", minor: " + cf.minor
+                    + "modifiers: " + Integer.toHexString(cf.getAccessFlags()));
         out.println(Modifier.toString(mod) + " class "
                     + cf.getName() + " extends " + cf.getSuperclass());