aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-03-08 13:05:47 +0000
committerkkhan <kkhan@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2007-03-08 13:05:47 +0000
commit07ede64867da6e2c443556162a35c9f098e769e9 (patch)
tree024c96dabb0f4449caaca61f86a3dff95c037f20 /src/main
parent4f3e40804c596792d679d1d688b3245d4b33579d (diff)
downloadjavassist-07ede64867da6e2c443556162a35c9f098e769e9.tar.gz
javassist-07ede64867da6e2c443556162a35c9f098e769e9.zip
When pruning preserve the SignatureAttribute
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@356 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main')
-rw-r--r--src/main/javassist/bytecode/ClassFile.java7
-rw-r--r--src/main/javassist/bytecode/FieldInfo.java7
-rw-r--r--src/main/javassist/bytecode/MethodInfo.java7
3 files changed, 21 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java
index 013b533e..82221d45 100644
--- a/src/main/javassist/bytecode/ClassFile.java
+++ b/src/main/javassist/bytecode/ClassFile.java
@@ -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) {
diff --git a/src/main/javassist/bytecode/FieldInfo.java b/src/main/javassist/bytecode/FieldInfo.java
index f0a13faf..5d96df84 100644
--- a/src/main/javassist/bytecode/FieldInfo.java
+++ b/src/main/javassist/bytecode/FieldInfo.java
@@ -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);
diff --git a/src/main/javassist/bytecode/MethodInfo.java b/src/main/javassist/bytecode/MethodInfo.java
index 87b8e76a..8d0cce10 100644
--- a/src/main/javassist/bytecode/MethodInfo.java
+++ b/src/main/javassist/bytecode/MethodInfo.java
@@ -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());