diff options
Diffstat (limited to '')
| -rw-r--r-- | src/main/java/cuchaz/enigma/mapping/EntryFactory.java | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java index 3584ebbf..2351dcfb 100644 --- a/src/main/java/cuchaz/enigma/mapping/EntryFactory.java +++ b/src/main/java/cuchaz/enigma/mapping/EntryFactory.java | |||
| @@ -38,19 +38,11 @@ public class EntryFactory { | |||
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | public static FieldEntry getFieldEntry(CtField field) { | 40 | public static FieldEntry getFieldEntry(CtField field) { |
| 41 | return new FieldEntry( | 41 | return new FieldEntry(getClassEntry(field.getDeclaringClass()), field.getName(), new Type(field.getFieldInfo().getDescriptor())); |
| 42 | getClassEntry(field.getDeclaringClass()), | ||
| 43 | field.getName(), | ||
| 44 | new Type(field.getFieldInfo().getDescriptor()) | ||
| 45 | ); | ||
| 46 | } | 42 | } |
| 47 | 43 | ||
| 48 | public static FieldEntry getFieldEntry(FieldAccess call) { | 44 | public static FieldEntry getFieldEntry(FieldAccess call) { |
| 49 | return new FieldEntry( | 45 | return new FieldEntry(new ClassEntry(Descriptor.toJvmName(call.getClassName())), call.getFieldName(), new Type(call.getSignature())); |
| 50 | new ClassEntry(Descriptor.toJvmName(call.getClassName())), | ||
| 51 | call.getFieldName(), | ||
| 52 | new Type(call.getSignature()) | ||
| 53 | ); | ||
| 54 | } | 46 | } |
| 55 | 47 | ||
| 56 | public static FieldEntry getFieldEntry(String className, String name, String type) { | 48 | public static FieldEntry getFieldEntry(String className, String name, String type) { |
| @@ -58,19 +50,11 @@ public class EntryFactory { | |||
| 58 | } | 50 | } |
| 59 | 51 | ||
| 60 | public static FieldEntry getObfFieldEntry(ClassMapping classMapping, FieldMapping fieldMapping) { | 52 | public static FieldEntry getObfFieldEntry(ClassMapping classMapping, FieldMapping fieldMapping) { |
| 61 | return new FieldEntry( | 53 | return new FieldEntry(getObfClassEntry(classMapping), fieldMapping.getObfName(), fieldMapping.getObfType()); |
| 62 | getObfClassEntry(classMapping), | ||
| 63 | fieldMapping.getObfName(), | ||
| 64 | fieldMapping.getObfType() | ||
| 65 | ); | ||
| 66 | } | 54 | } |
| 67 | 55 | ||
| 68 | public static MethodEntry getMethodEntry(CtMethod method) { | 56 | public static MethodEntry getMethodEntry(CtMethod method) { |
| 69 | return new MethodEntry( | 57 | return new MethodEntry(getClassEntry(method.getDeclaringClass()), method.getName(), new Signature(method.getMethodInfo().getDescriptor())); |
| 70 | getClassEntry(method.getDeclaringClass()), | ||
| 71 | method.getName(), | ||
| 72 | new Signature(method.getMethodInfo().getDescriptor()) | ||
| 73 | ); | ||
| 74 | } | 58 | } |
| 75 | 59 | ||
| 76 | public static MethodEntry getMethodEntry(MethodCall call) { | 60 | public static MethodEntry getMethodEntry(MethodCall call) { |
| @@ -106,10 +90,6 @@ public class EntryFactory { | |||
| 106 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); | 90 | return getBehaviorEntry(new ClassEntry(className), behaviorName, new Signature(behaviorSignature)); |
| 107 | } | 91 | } |
| 108 | 92 | ||
| 109 | public static BehaviorEntry getBehaviorEntry(String className, String behaviorName) { | ||
| 110 | return getBehaviorEntry(new ClassEntry(className), behaviorName); | ||
| 111 | } | ||
| 112 | |||
| 113 | public static BehaviorEntry getBehaviorEntry(String className) { | 93 | public static BehaviorEntry getBehaviorEntry(String className) { |
| 114 | return new ConstructorEntry(new ClassEntry(className)); | 94 | return new ConstructorEntry(new ClassEntry(className)); |
| 115 | } | 95 | } |
| @@ -125,14 +105,6 @@ public class EntryFactory { | |||
| 125 | } | 105 | } |
| 126 | } | 106 | } |
| 127 | 107 | ||
| 128 | public static BehaviorEntry getBehaviorEntry(ClassEntry classEntry, String behaviorName) { | ||
| 129 | if (behaviorName.equals("<clinit>")) { | ||
| 130 | return new ConstructorEntry(classEntry); | ||
| 131 | } else { | ||
| 132 | throw new IllegalArgumentException("Only class initializers don't have signatures"); | ||
| 133 | } | ||
| 134 | } | ||
| 135 | |||
| 136 | public static BehaviorEntry getObfBehaviorEntry(ClassEntry classEntry, MethodMapping methodMapping) { | 108 | public static BehaviorEntry getObfBehaviorEntry(ClassEntry classEntry, MethodMapping methodMapping) { |
| 137 | return getBehaviorEntry(classEntry, methodMapping.getObfName(), methodMapping.getObfSignature()); | 109 | return getBehaviorEntry(classEntry, methodMapping.getObfName(), methodMapping.getObfSignature()); |
| 138 | } | 110 | } |