■ ■ ■ ■ ■ ■
jadx-core/src/main/java/jadx/core/dex/visitors/ClassModifier.java
| skipped 20 lines |
21 | 21 | | import jadx.core.utils.InstructionRemover; |
22 | 22 | | import jadx.core.utils.exceptions.JadxException; |
23 | 23 | | |
24 | | - | import java.util.Iterator; |
25 | 24 | | import java.util.List; |
26 | 25 | | |
27 | 26 | | public class ClassModifier extends AbstractVisitor { |
| skipped 86 lines |
114 | 113 | | } |
115 | 114 | | |
116 | 115 | | private static void removeSyntheticMethods(ClassNode cls) { |
117 | | - | for (Iterator<MethodNode> it = cls.getMethods().iterator(); it.hasNext(); ) { |
118 | | - | MethodNode mth = it.next(); |
| 116 | + | for (MethodNode mth : cls.getMethods()) { |
119 | 117 | | AccessInfo af = mth.getAccessFlags(); |
120 | | - | |
121 | 118 | | // remove bridge methods |
122 | 119 | | if (af.isBridge() && af.isSynthetic() && !isMethodUniq(cls, mth)) { |
123 | 120 | | // TODO add more checks before method deletion |
124 | | - | it.remove(); |
| 121 | + | mth.getAttributes().add(AttributeFlag.DONT_GENERATE); |
125 | 122 | | } |
126 | | - | |
127 | 123 | | // remove synthetic constructor for inner non-static classes |
128 | 124 | | if (af.isSynthetic() && af.isConstructor() && mth.getBasicBlocks().size() == 2) { |
129 | 125 | | List<InsnNode> insns = mth.getBasicBlocks().get(0).getInstructions(); |
| skipped 84 lines |