aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/javassist/bytecode/AttributeInfo.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/javassist/bytecode/AttributeInfo.java')
-rw-r--r--src/main/javassist/bytecode/AttributeInfo.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/main/javassist/bytecode/AttributeInfo.java b/src/main/javassist/bytecode/AttributeInfo.java
index 9a1ac16c..5fd73281 100644
--- a/src/main/javassist/bytecode/AttributeInfo.java
+++ b/src/main/javassist/bytecode/AttributeInfo.java
@@ -231,16 +231,21 @@ public class AttributeInfo {
return null; // no such attribute
}
- static synchronized void remove(ArrayList list, String name) {
+ static synchronized AttributeInfo remove(ArrayList list, String name) {
if (list == null)
- return;
+ return null;
+ AttributeInfo removed = null;
ListIterator iterator = list.listIterator();
while (iterator.hasNext()) {
AttributeInfo ai = (AttributeInfo)iterator.next();
- if (ai.getName().equals(name))
+ if (ai.getName().equals(name)) {
iterator.remove();
+ removed = ai;
+ }
}
+
+ return removed;
}
static void writeAll(ArrayList list, DataOutputStream out)