]> source.dussan.org Git - javassist.git/commitdiff
When pruning preserve the SignatureAttribute
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 8 Mar 2007 13:05:47 +0000 (13:05 +0000)
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Thu, 8 Mar 2007 13:05:47 +0000 (13:05 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@356 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/bytecode/ClassFile.java
src/main/javassist/bytecode/FieldInfo.java
src/main/javassist/bytecode/MethodInfo.java

index 013b533eb525e18b976b1e285e1687bbaa9c1eea..82221d4590fcba3919652cdaac50769cd02342f4 100644 (file)
@@ -168,6 +168,13 @@ public final class ClassFile {
             newAttributes.add(visibleAnnotations);
         }
 
+        AttributeInfo signature 
+            = getAttribute(SignatureAttribute.tag);
+        if (signature != null) {
+            signature = signature.copy(cp, null);
+            newAttributes.add(signature);
+        }
+        
         ArrayList list = methods;
         int n = list.size();
         for (int i = 0; i < n; ++i) {
index f0a13fafcbda7f89b65e0875900880435f792464..5d96df845dbe0f121d378d7896b9ddbd5c283ec9 100644 (file)
@@ -100,6 +100,13 @@ public final class FieldInfo {
             newAttributes.add(visibleAnnotations);
         }
 
+        AttributeInfo signature 
+            = getAttribute(SignatureAttribute.tag);
+        if (signature != null) {
+            signature = signature.copy(cp, null);
+            newAttributes.add(signature);
+        }
+        
         int index = getConstantValue();
         if (index != 0) {
             index = constPool.copy(index, cp, null);
index 87b8e76a752455196ea5761e6535592542df6e2a..8d0cce10320fba1c0562346d604309c1b8a74856 100644 (file)
@@ -164,6 +164,13 @@ public final class MethodInfo {
         if (ea != null)
             newAttributes.add(ea);
 
+        AttributeInfo signature 
+            = getAttribute(SignatureAttribute.tag);
+        if (signature != null) {
+            signature = signature.copy(cp, null);
+            newAttributes.add(signature);
+        }
+        
         attribute = newAttributes;
         name = cp.addUtf8Info(getName());
         descriptor = cp.addUtf8Info(getDescriptor());