From: chiba Date: Sun, 13 Aug 2006 16:49:43 +0000 (+0000) Subject: fixed a bug in write() in Annotation and ClassMemberValue X-Git-Tag: rel_3_17_1_ga~323 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8a5fe21253fae4faa7746b9c81aac4db6e6c00c5;p=javassist.git fixed a bug in write() in Annotation and ClassMemberValue git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@309 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/bytecode/annotation/Annotation.java b/src/main/javassist/bytecode/annotation/Annotation.java index 9971fada..4b00a318 100644 --- a/src/main/javassist/bytecode/annotation/Annotation.java +++ b/src/main/javassist/bytecode/annotation/Annotation.java @@ -289,12 +289,13 @@ public class Annotation { * @param writer the output. */ public void write(AnnotationsWriter writer) throws IOException { + String typeName = pool.getUtf8Info(typeIndex); if (members == null) { - writer.annotation(typeIndex, 0); + writer.annotation(typeName, 0); return; } - writer.annotation(typeIndex, members.size()); + writer.annotation(typeName, members.size()); Iterator it = members.values().iterator(); while (it.hasNext()) { Pair pair = (Pair)it.next(); diff --git a/src/main/javassist/bytecode/annotation/ClassMemberValue.java b/src/main/javassist/bytecode/annotation/ClassMemberValue.java index 19b4714b..c29dbb20 100644 --- a/src/main/javassist/bytecode/annotation/ClassMemberValue.java +++ b/src/main/javassist/bytecode/annotation/ClassMemberValue.java @@ -120,7 +120,7 @@ public class ClassMemberValue extends MemberValue { * Writes the value. */ public void write(AnnotationsWriter writer) throws IOException { - writer.classInfoIndex(valueIndex); + writer.classInfoIndex(cp.getUtf8Info(valueIndex)); } /**