summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/mapping/FieldEntry.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/FieldEntry.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/FieldEntry.java')
-rw-r--r--src/main/java/cuchaz/enigma/mapping/FieldEntry.java87
1 files changed, 0 insertions, 87 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java b/src/main/java/cuchaz/enigma/mapping/FieldEntry.java
deleted file mode 100644
index 0f1f506..0000000
--- a/src/main/java/cuchaz/enigma/mapping/FieldEntry.java
+++ /dev/null
@@ -1,87 +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 FieldEntry implements Entry {
17
18 private ClassEntry classEntry;
19 private String name;
20 private Type type;
21
22 // NOTE: this argument order is important for the MethodReader/MethodWriter
23 public FieldEntry(ClassEntry classEntry, String name, Type type) {
24 if (classEntry == null) {
25 throw new IllegalArgumentException("Class cannot be null!");
26 }
27 if (name == null) {
28 throw new IllegalArgumentException("Field name cannot be null!");
29 }
30 if (type == null) {
31 throw new IllegalArgumentException("Field type cannot be null!");
32 }
33
34 this.classEntry = classEntry;
35 this.name = name;
36 this.type = type;
37 }
38
39 public FieldEntry(FieldEntry other, ClassEntry newClassEntry) {
40 this.classEntry = newClassEntry;
41 this.name = other.name;
42 this.type = other.type;
43 }
44
45 @Override
46 public ClassEntry getClassEntry() {
47 return this.classEntry;
48 }
49
50 @Override
51 public String getName() {
52 return this.name;
53 }
54
55 @Override
56 public String getClassName() {
57 return this.classEntry.getName();
58 }
59
60 public Type getType() {
61 return this.type;
62 }
63
64 @Override
65 public FieldEntry cloneToNewClass(ClassEntry classEntry) {
66 return new FieldEntry(this, classEntry);
67 }
68
69 @Override
70 public int hashCode() {
71 return Utils.combineHashesOrdered(this.classEntry, this.name, this.type);
72 }
73
74 @Override
75 public boolean equals(Object other) {
76 return other instanceof FieldEntry && equals((FieldEntry) other);
77 }
78
79 public boolean equals(FieldEntry other) {
80 return this.classEntry.equals(other.classEntry) && this.name.equals(other.name) && this.type.equals(other.type);
81 }
82
83 @Override
84 public String toString() {
85 return this.classEntry.getName() + "." + this.name + ":" + this.type;
86 }
87}