aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/CtField.java
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-08-11 04:22:50 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2006-08-11 04:22:50 +0000
commit2d45afd62bf1453e0e12236d7a18113d07be608a (patch)
treede51deb48d24c7ef9ec3e8b532ac9262fa3b4380 /src/main/javassist/CtField.java
parente2f5393d14971e41a6779a98673b7231f5c04f6d (diff)
downloadjavassist-2d45afd62bf1453e0e12236d7a18113d07be608a.tar.gz
javassist-2d45afd62bf1453e0e12236d7a18113d07be608a.zip
changed new CtField(CtField,..) to copy annotations.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@307 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src/main/javassist/CtField.java')
-rw-r--r--src/main/javassist/CtField.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/javassist/CtField.java b/src/main/javassist/CtField.java
index 30ea34e8..c8d62f00 100644
--- a/src/main/javassist/CtField.java
+++ b/src/main/javassist/CtField.java
@@ -82,6 +82,15 @@ public class CtField extends CtMember {
{
this(src.fieldInfo.getDescriptor(), src.fieldInfo.getName(),
declaring);
+ java.util.ListIterator iterator
+ = src.fieldInfo.getAttributes().listIterator();
+ FieldInfo fi = fieldInfo;
+ fi.setAccessFlags(src.fieldInfo.getAccessFlags());
+ ConstPool cp = fi.getConstPool();
+ while (iterator.hasNext()) {
+ AttributeInfo ainfo = (AttributeInfo)iterator.next();
+ fi.addAttribute(ainfo.copy(cp, null));
+ }
}
private CtField(String typeDesc, String name, CtClass clazz)