summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/mapping/MethodEntry.java
diff options
context:
space:
mode:
authorGravatar gegy10002018-07-17 19:14:08 +0200
committerGravatar GitHub2018-07-17 19:14:08 +0200
commita88175ffc95792b88a8724f66db6dda2b8cc32ee (patch)
tree65895bbc6cf1766f4ca01e1257619ab1993e71dc /src/main/java/cuchaz/enigma/mapping/MethodEntry.java
parentMerge pull request #3 from thiakil/src-jar (diff)
downloadenigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.gz
enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.tar.xz
enigma-fork-a88175ffc95792b88a8724f66db6dda2b8cc32ee.zip
ASM Based Class Translator (#1)
* Initial port to ASM * Package updates * Annotation + inner class translation * Fix inner class mapping * More bytecode translation * Signature refactoring * Fix highlighting of mapped names * Fix parameter name offset * Fix anonymous class generation * Fix issues with inner class signature transformation * Fix bridged method detection * Fix compile issues * Resolve all failed tests * Apply deobfuscated name to transformed classes * Fix class signatures not being translated * Fix frame array type translation * Fix frame array type translation * Fix array translation in method calls * Fix method reference and bridge detection * Fix handling of null deobf mappings * Parameter translation in interfaces * Fix enum parameter index offset * Fix parsed local variable indexing * Fix stackoverflow on rebuilding method names * Ignore invalid decompiled variable indices * basic source jar * Output directly to file on source export * Make decompile parallel * fix incorrect super calls * Use previous save state to delete old mapping files * Fix old mappings not properly being removed * Fix old mappings not properly being removed * make isMethodProvider public (cherry picked from commit ebad6a9) * speed up Deobfuscator's getSources by using a single TranslatingTypeloader and caching the ClassLoaderTypeloader * ignore .idea project folders * move SynchronizedTypeLoader to a non-inner * fix signature remap of inners for now * index & resolve method/field references for usages view * Allow reader/writer subclasses to provide the underlying file operations * fix giving obf classes a name not removing them from the panel * buffer the ParsedJar class entry inputstream, allow use with a jarinputstream * make CachingClasspathTypeLoader public * make CachingClasspathTypeLoader public * support enum switches with obfuscated SwitchMaps
Diffstat (limited to 'src/main/java/cuchaz/enigma/mapping/MethodEntry.java')
-rw-r--r--src/main/java/cuchaz/enigma/mapping/MethodEntry.java90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/MethodEntry.java b/src/main/java/cuchaz/enigma/mapping/MethodEntry.java
deleted file mode 100644
index 9c3058c..0000000
--- a/src/main/java/cuchaz/enigma/mapping/MethodEntry.java
+++ /dev/null
@@ -1,90 +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 * <p>
8 * Contributors:
9 * Jeff Martin - initial API and implementation
10 ******************************************************************************/
11
12package cuchaz.enigma.mapping;
13
14import cuchaz.enigma.utils.Utils;
15
16public class MethodEntry implements BehaviorEntry {
17
18 private ClassEntry classEntry;
19 private String name;
20 private Signature signature;
21
22 public MethodEntry(ClassEntry classEntry, String name, Signature signature) {
23 if (classEntry == null) {
24 throw new IllegalArgumentException("Class cannot be null!");
25 }
26 if (name == null) {
27 throw new IllegalArgumentException("Method name cannot be null!");
28 }
29 if (signature == null) {
30 throw new IllegalArgumentException("Method signature cannot be null!");
31 }
32 if (name.startsWith("<")) {
33 throw new IllegalArgumentException("Don't use MethodEntry for a constructor!");
34 }
35
36 this.classEntry = classEntry;
37 this.name = name;
38 this.signature = signature;
39 }
40
41 public MethodEntry(MethodEntry other, String newClassName) {
42 this.classEntry = new ClassEntry(newClassName);
43 this.name = other.name;
44 this.signature = other.signature;
45 }
46
47 @Override
48 public ClassEntry getClassEntry() {
49 return this.classEntry;
50 }
51
52 @Override
53 public String getName() {
54 return this.name;
55 }
56
57 @Override
58 public Signature getSignature() {
59 return this.signature;
60 }
61
62 @Override
63 public String getClassName() {
64 return this.classEntry.getName();
65 }
66
67 @Override
68 public MethodEntry cloneToNewClass(ClassEntry classEntry) {
69 return new MethodEntry(this, classEntry.getName());
70 }
71
72 @Override
73 public int hashCode() {
74 return Utils.combineHashesOrdered(this.classEntry, this.name, this.signature);
75 }
76
77 @Override
78 public boolean equals(Object other) {
79 return other instanceof MethodEntry && equals((MethodEntry) other);
80 }
81
82 public boolean equals(MethodEntry other) {
83 return this.classEntry.equals(other.classEntry) && this.name.equals(other.name) && this.signature.equals(other.signature);
84 }
85
86 @Override
87 public String toString() {
88 return this.classEntry.getName() + "." + this.name + this.signature;
89 }
90}