From 5e191f7f297bfbd53c4f65ffc66074572e6b5ac2 Mon Sep 17 00:00:00 2001 From: chiba Date: Fri, 26 Aug 2005 05:54:02 +0000 Subject: [PATCH] fixed JIRA Javassist-9. javadoc comments have been updated. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@198 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/bytecode/ClassFile.java | 16 ++++++++++++---- src/main/javassist/bytecode/FieldInfo.java | 12 +++++++++--- src/main/javassist/bytecode/MethodInfo.java | 13 +++++++++---- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/main/javassist/bytecode/ClassFile.java b/src/main/javassist/bytecode/ClassFile.java index 9fd3c8e4..bab40b70 100644 --- a/src/main/javassist/bytecode/ClassFile.java +++ b/src/main/javassist/bytecode/ClassFile.java @@ -523,7 +523,11 @@ public final class ClassFile { } /** - * Returns all the attributes. + * Returns all the attributes. The returned List object + * is shared with this object. If you add a new attribute to the list, + * the attribute is also added to the classs file represented by this + * object. If you remove an attribute from the list, it is also removed + * from the class file. * * @return a list of AttributeInfo objects. * @see AttributeInfo @@ -533,10 +537,12 @@ public final class ClassFile { } /** - * Returns the attribute with the specified name. + * Returns the attribute with the specified name. If there are multiple + * attributes with that name, this method returns either of them. It + * returns null if the specified attributed is not found. * - * @param name - * attribute name + * @param name attribute name + * @see #getAttributes() */ public AttributeInfo getAttribute(String name) { LinkedList list = attributes; @@ -553,6 +559,8 @@ public final class ClassFile { /** * Appends an attribute. If there is already an attribute with the same * name, the new one substitutes for it. + * + * @see #getAttributes() */ public void addAttribute(AttributeInfo info) { AttributeInfo.remove(attributes, info.getName()); diff --git a/src/main/javassist/bytecode/FieldInfo.java b/src/main/javassist/bytecode/FieldInfo.java index 73698a62..a66d13a9 100644 --- a/src/main/javassist/bytecode/FieldInfo.java +++ b/src/main/javassist/bytecode/FieldInfo.java @@ -194,9 +194,11 @@ public final class FieldInfo { } /** - * Returns all the attributes. - * A new element can be added to the returned list - * and an existing element can be removed from the list. + * Returns all the attributes. The returned List object + * is shared with this object. If you add a new attribute to the list, + * the attribute is also added to the field represented by this + * object. If you remove an attribute from the list, it is also removed + * from the field. * * @return a list of AttributeInfo objects. * @see AttributeInfo @@ -210,8 +212,10 @@ public final class FieldInfo { /** * Returns the attribute with the specified name. + * It returns null if the specified attribute is not found. * * @param name attribute name + * @see #getAttributes() */ public AttributeInfo getAttribute(String name) { return AttributeInfo.lookup(attribute, name); @@ -220,6 +224,8 @@ public final class FieldInfo { /** * Appends an attribute. If there is already an attribute with * the same name, the new one substitutes for it. + * + * @see #getAttributes() */ public void addAttribute(AttributeInfo info) { if (attribute == null) diff --git a/src/main/javassist/bytecode/MethodInfo.java b/src/main/javassist/bytecode/MethodInfo.java index 80eac243..5562e62d 100644 --- a/src/main/javassist/bytecode/MethodInfo.java +++ b/src/main/javassist/bytecode/MethodInfo.java @@ -236,8 +236,11 @@ public final class MethodInfo { } /** - * Returns all the attributes. A new element can be added to the returned - * list and an existing element can be removed from the list. + * Returns all the attributes. The returned List object + * is shared with this object. If you add a new attribute to the list, + * the attribute is also added to the method represented by this + * object. If you remove an attribute from the list, it is also removed + * from the method. * * @return a list of AttributeInfo objects. * @see AttributeInfo @@ -253,9 +256,9 @@ public final class MethodInfo { * Returns the attribute with the specified name. If it is not found, this * method returns null. * - * @param name - * attribute name + * @param name attribute name * @return an AttributeInfo object or null. + * @see #getAttributes() */ public AttributeInfo getAttribute(String name) { return AttributeInfo.lookup(attribute, name); @@ -264,6 +267,8 @@ public final class MethodInfo { /** * Appends an attribute. If there is already an attribute with the same * name, the new one substitutes for it. + * + * @see #getAttributes() */ public void addAttribute(AttributeInfo info) { if (attribute == null) -- 2.39.5