diff options
author | chibash <chiba@javassist.org> | 2016-09-18 23:49:43 +0900 |
---|---|---|
committer | chibash <chiba@javassist.org> | 2016-09-18 23:49:43 +0900 |
commit | 0e9ff9fd2bdf9ae928c7596714672a2baec01281 (patch) | |
tree | 43578517e2a79e27ac5732b6f31b6b337dc988db /src/main/javassist/bytecode/AttributeInfo.java | |
parent | 460d41808ae623c5e60c89bcafb0aa79176d2dd8 (diff) | |
download | javassist-0e9ff9fd2bdf9ae928c7596714672a2baec01281.tar.gz javassist-0e9ff9fd2bdf9ae928c7596714672a2baec01281.zip |
enables removal of attributes
Diffstat (limited to 'src/main/javassist/bytecode/AttributeInfo.java')
-rw-r--r-- | src/main/javassist/bytecode/AttributeInfo.java | 11 |
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) |