From 8a5fe21253fae4faa7746b9c81aac4db6e6c00c5 Mon Sep 17 00:00:00 2001 From: chiba Date: Sun, 13 Aug 2006 16:49:43 +0000 Subject: [PATCH] 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 --- src/main/javassist/bytecode/annotation/Annotation.java | 5 +++-- src/main/javassist/bytecode/annotation/ClassMemberValue.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) 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)); } /** -- 2.39.5