From: kkhan Date: Thu, 8 Mar 2007 13:05:47 +0000 (+0000) Subject: When pruning preserve the SignatureAttribute X-Git-Tag: rel_3_17_1_ga~280 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=07ede64867da6e2c443556162a35c9f098e769e9;p=javassist.git When pruning preserve the SignatureAttribute git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@356 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- 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());