diff options
Diffstat (limited to 'src/cuchaz/enigma/analysis/BridgeMarker.java')
| -rw-r--r-- | src/cuchaz/enigma/analysis/BridgeMarker.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/cuchaz/enigma/analysis/BridgeMarker.java b/src/cuchaz/enigma/analysis/BridgeMarker.java deleted file mode 100644 index 650b3a7..0000000 --- a/src/cuchaz/enigma/analysis/BridgeMarker.java +++ /dev/null | |||
| @@ -1,43 +0,0 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | * Copyright (c) 2015 Jeff Martin. | ||
| 3 | * All rights reserved. This program and the accompanying materials | ||
| 4 | * are made available under the terms of the GNU Lesser General Public | ||
| 5 | * License v3.0 which accompanies this distribution, and is available at | ||
| 6 | * http://www.gnu.org/licenses/lgpl.html | ||
| 7 | * | ||
| 8 | * Contributors: | ||
| 9 | * Jeff Martin - initial API and implementation | ||
| 10 | ******************************************************************************/ | ||
| 11 | package cuchaz.enigma.analysis; | ||
| 12 | |||
| 13 | import javassist.CtClass; | ||
| 14 | import javassist.CtMethod; | ||
| 15 | import javassist.bytecode.AccessFlag; | ||
| 16 | import cuchaz.enigma.mapping.EntryFactory; | ||
| 17 | import cuchaz.enigma.mapping.MethodEntry; | ||
| 18 | |||
| 19 | public class BridgeMarker { | ||
| 20 | |||
| 21 | private JarIndex m_jarIndex; | ||
| 22 | |||
| 23 | public BridgeMarker(JarIndex jarIndex) { | ||
| 24 | m_jarIndex = jarIndex; | ||
| 25 | } | ||
| 26 | |||
| 27 | public void markBridges(CtClass c) { | ||
| 28 | |||
| 29 | for (CtMethod method : c.getDeclaredMethods()) { | ||
| 30 | MethodEntry methodEntry = EntryFactory.getMethodEntry(method); | ||
| 31 | |||
| 32 | // is this a bridge method? | ||
| 33 | MethodEntry bridgedMethodEntry = m_jarIndex.getBridgedMethod(methodEntry); | ||
| 34 | if (bridgedMethodEntry != null) { | ||
| 35 | |||
| 36 | // it's a bridge method! add the bridge flag | ||
| 37 | int flags = method.getMethodInfo().getAccessFlags(); | ||
| 38 | flags |= AccessFlag.BRIDGE; | ||
| 39 | method.getMethodInfo().setAccessFlags(flags); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | } | ||
| 43 | } | ||