diff options
author | chibash <chiba@javassist.org> | 2015-01-06 01:17:34 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2015-01-06 01:17:34 +0900 |
commit | ec3afdfb5d58b98ae8091d59f84d0d2f7f97a725 (patch) | |
tree | f1b1544f83f34fba403281e09c0a32a520286214 /src/main/javassist/bytecode/AnnotationsAttribute.java | |
parent | f2093c28be24336593e1ebd9c2c633ee0f8c5b5c (diff) | |
download | javassist-ec3afdfb5d58b98ae8091d59f84d0d2f7f97a725.tar.gz javassist-ec3afdfb5d58b98ae8091d59f84d0d2f7f97a725.zip |
fixed JASSIST-240. support for Runtime[In]VisibleTypeAnnotations
Diffstat (limited to 'src/main/javassist/bytecode/AnnotationsAttribute.java')
-rw-r--r-- | src/main/javassist/bytecode/AnnotationsAttribute.java | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/main/javassist/bytecode/AnnotationsAttribute.java b/src/main/javassist/bytecode/AnnotationsAttribute.java index f5dc581a..38b88eaa 100644 --- a/src/main/javassist/bytecode/AnnotationsAttribute.java +++ b/src/main/javassist/bytecode/AnnotationsAttribute.java @@ -350,15 +350,24 @@ public class AnnotationsAttribute extends AttributeInfo { return pos; } + /** + * {@code element_value_paris} + */ final int memberValuePair(int pos) throws Exception { int nameIndex = ByteArray.readU16bit(info, pos); return memberValuePair(pos + 2, nameIndex); } + /** + * {@code element_value_paris[]} + */ int memberValuePair(int pos, int nameIndex) throws Exception { return memberValue(pos); } + /** + * {@code element_value} + */ final int memberValue(int pos) throws Exception { int tag = info[pos] & 0xff; if (tag == 'e') { @@ -385,18 +394,33 @@ public class AnnotationsAttribute extends AttributeInfo { } } + /** + * {@code const_value_index} + */ void constValueMember(int tag, int index) throws Exception {} + /** + * {@code enum_const_value} + */ void enumMemberValue(int pos, int typeNameIndex, int constNameIndex) throws Exception { } + /** + * {@code class_info_index} + */ void classMemberValue(int pos, int index) throws Exception {} + /** + * {@code annotation_value} + */ int annotationMemberValue(int pos) throws Exception { return annotation(pos); } + /** + * {@code array_value} + */ int arrayMemberValue(int pos, int num) throws Exception { for (int i = 0; i < num; ++i) { pos = memberValue(pos); @@ -470,9 +494,15 @@ public class AnnotationsAttribute extends AttributeInfo { * It can be null. */ Copier(byte[] info, ConstPool src, ConstPool dest, Map map) { + this(info, src, dest, map, true); + } + + Copier(byte[] info, ConstPool src, ConstPool dest, Map map, boolean makeWriter) { super(info); output = new ByteArrayOutputStream(); - writer = new AnnotationsWriter(output, dest); + if (makeWriter) + writer = new AnnotationsWriter(output, dest); + srcPool = src; destPool = dest; classnames = map; |