diff options
author | adrian <adrian@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2006-03-15 17:59:07 +0000 |
---|---|---|
committer | adrian <adrian@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2006-03-15 17:59:07 +0000 |
commit | e8fe862862d838438fc09786bd5102a654593575 (patch) | |
tree | bca8d0af93ea4db9890d25a7a8b390b63716f6bc /src/main | |
parent | 163f2ece3197b5222b5967f6ce3a034913c01491 (diff) | |
download | javassist-e8fe862862d838438fc09786bd5102a654593575.tar.gz javassist-e8fe862862d838438fc09786bd5102a654593575.zip |
Need to also keep the parameter annotations after a prune.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@260 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/javassist/bytecode/MethodInfo.java | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/src/main/javassist/bytecode/MethodInfo.java b/src/main/javassist/bytecode/MethodInfo.java index 10c77be0..87b8e76a 100644 --- a/src/main/javassist/bytecode/MethodInfo.java +++ b/src/main/javassist/bytecode/MethodInfo.java @@ -126,33 +126,48 @@ public final class MethodInfo { void prune(ConstPool cp) { LinkedList newAttributes = new LinkedList(); + AttributeInfo invisibleAnnotations = getAttribute(AnnotationsAttribute.invisibleTag); if (invisibleAnnotations != null) { invisibleAnnotations = invisibleAnnotations.copy(cp, null); newAttributes.add(invisibleAnnotations); - } + } AttributeInfo visibleAnnotations = getAttribute(AnnotationsAttribute.visibleTag); if (visibleAnnotations != null) { visibleAnnotations = visibleAnnotations.copy(cp, null); newAttributes.add(visibleAnnotations); - } + } + + AttributeInfo parameterInvisibleAnnotations + = getAttribute(ParameterAnnotationsAttribute.invisibleTag); + if (parameterInvisibleAnnotations != null) { + parameterInvisibleAnnotations = parameterInvisibleAnnotations.copy(cp, null); + newAttributes.add(parameterInvisibleAnnotations); + } - AnnotationDefaultAttribute defaultAttribute - = (AnnotationDefaultAttribute) getAttribute(AnnotationDefaultAttribute.tag); - if (defaultAttribute != null) - newAttributes.add(defaultAttribute); + AttributeInfo parameterVisibleAnnotations + = getAttribute(ParameterAnnotationsAttribute.visibleTag); + if (parameterVisibleAnnotations != null) { + parameterVisibleAnnotations = parameterVisibleAnnotations.copy(cp, null); + newAttributes.add(parameterVisibleAnnotations); + } + + AnnotationDefaultAttribute defaultAttribute + = (AnnotationDefaultAttribute) getAttribute(AnnotationDefaultAttribute.tag); + if (defaultAttribute != null) + newAttributes.add(defaultAttribute); - ExceptionsAttribute ea = getExceptionsAttribute(); - if (ea != null) - newAttributes.add(ea); + ExceptionsAttribute ea = getExceptionsAttribute(); + if (ea != null) + newAttributes.add(ea); - attribute = newAttributes; - name = cp.addUtf8Info(getName()); - descriptor = cp.addUtf8Info(getDescriptor()); - constPool = cp; + attribute = newAttributes; + name = cp.addUtf8Info(getName()); + descriptor = cp.addUtf8Info(getDescriptor()); + constPool = cp; } /** |