aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/MethodInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/bytecode/MethodInfo.java')
-rw-r--r--src/main/javassist/bytecode/MethodInfo.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/MethodInfo.java b/src/main/javassist/bytecode/MethodInfo.java
index 4b8c1c4d..72642268 100644
--- a/src/main/javassist/bytecode/MethodInfo.java
+++ b/src/main/javassist/bytecode/MethodInfo.java
@@ -315,6 +315,11 @@ public class MethodInfo {
* Returns the attribute with the specified name. If it is not found, this
* method returns null.
*
+ * <p>An attribute name can be obtained by, for example,
+ * {@link AnnotationsAttribute#visibleTab} or
+ * {@link AnnotationsAttribute#invisibleTab}.
+ * </p>
+ *
* @param name attribute name
* @return an <code>AttributeInfo</code> object or null.
* @see #getAttributes()
@@ -324,6 +329,17 @@ public class MethodInfo {
}
/**
+ * Removes an attribute with the specified name.
+ *
+ * @param name attribute name.
+ * @return the removed attribute or null.
+ * @since 3.21
+ */
+ public AttributeInfo removeAttribute(String name) {
+ return AttributeInfo.remove(attribute, name);
+ }
+
+ /**
* Appends an attribute. If there is already an attribute with the same
* name, the new one substitutes for it.
*