Skip to content

Commit

Permalink
Update to Bombe 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jamierocks committed Oct 6, 2018
1 parent dbb0a93 commit 0da1074
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ project('FernFlower') {

// Project repositories
repositories {
mavenLocal() // TODO: temporary
mavenCentral()
}

// Project dependencies
dependencies {
compile 'me.jamiemansfield:bombe-core:0.1.0'
compile 'com.google.guava:guava:19.0'
compile 'me.jamiemansfield:bombe-core:0.2.0'
compile project('FernFlower')

testCompile 'junit:junit:4.12'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public SelectableMember(CodeTab codeTab, MemberType type, String name, String de
if (type == MemberType.FIELD) {
this.sig = new FieldSignature(name, FieldType.of(descriptor));
} else if (type == MemberType.METHOD) {
this.sig = new MethodSignature(name, MethodDescriptor.compile(descriptor));
this.sig = new MethodSignature(name, MethodDescriptor.of(descriptor));
} else {
this.sig = null;
}
Expand Down Expand Up @@ -443,7 +443,7 @@ private void updateText() {
? classMapping.get().getFieldMappings()
: classMapping.get().getMethodMappings();
Mapping mapping = mappings.get(getType() == MemberType.METHOD
? new MethodSignature(getName(), MethodDescriptor.compile(getDescriptor()))
? new MethodSignature(getName(), MethodDescriptor.of(getDescriptor()))
: new FieldSignature(getName(), FieldType.of(getDescriptor())));
if (mapping != null) {
deobf = mapping.getDeobfuscatedName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public MappingContext read() {
+ lineNum);
}

MethodDescriptor desc = removeNonePrefixes(MethodDescriptor.compile(descStr));
MethodDescriptor desc = removeNonePrefixes(MethodDescriptor.of(descStr));

currentMethod = MappingsHelper.genMethodMapping(mappings, classStack.peek().getFullObfuscatedName(),
new MethodSignature(obf, desc), deobf, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private void genMethodMappings(MappingContext context, List<String> methodMappin
String desc = arr[3];
String deobf = arr[4];
MappingsHelper.genMethodMapping(context, owningClass,
new MethodSignature(obf, MethodDescriptor.compile(desc)), deobf, false);
new MethodSignature(obf, MethodDescriptor.of(desc)), deobf, false);
}
}

Expand All @@ -155,10 +155,10 @@ private void genMethodParamMappings(MappingContext context, List<String> paramMa
continue;
}
MethodMapping methodMapping = classMapping.get().getMethodMappings()
.get(new MethodSignature(owningMethod, MethodDescriptor.compile(owningMethodDesc)));
.get(new MethodSignature(owningMethod, MethodDescriptor.of(owningMethodDesc)));
if (methodMapping == null) {
methodMapping = new MethodMapping(classMapping.get(),
new MethodSignature(owningMethod, MethodDescriptor.compile(owningMethodDesc)), owningMethod,
new MethodSignature(owningMethod, MethodDescriptor.of(owningMethodDesc)), owningMethod,
false);
}
int index;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ private void genMethodMappings(MappingContext context, List<String> methodMappin
String descriptor = arr[2];
String deobf = arr[3].substring(arr[3].lastIndexOf(CLASS_PATH_SEPARATOR_CHAR) + 1);
MappingsHelper.genMethodMapping(context, owningClass,
new MethodSignature(obf, MethodDescriptor.compile(descriptor)), deobf, false);
new MethodSignature(obf, MethodDescriptor.of(descriptor)), deobf, false);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ private List<IndexedMethod> indexMethods(ByteBuffer buffer, ConstantPool pool) {
for (int i = 0; i < methodCount; i++) {
IndexedMethod.Visibility vis = IndexedMethod.Visibility.fromAccessFlags(buffer.getShort());
String name = getString(pool, buffer.getShort());
MethodDescriptor desc = MethodDescriptor.compile(getString(pool, buffer.getShort()));
MethodDescriptor desc = MethodDescriptor.of(getString(pool, buffer.getShort()));
MethodSignature sig = new MethodSignature(name, desc);
methods.add(new IndexedMethod(sig, vis));
jce.getCurrentMethods().put(sig, sig); // index the method sig for future reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static String getProcessedDescriptor(MemberType memberType, String desc)
}
case METHOD: {
if (!desc.contains(MEMBER_PREFIX)) { // if this condition is true then it's already been processed
MethodDescriptor md = MethodDescriptor.compile(desc);
MethodDescriptor md = MethodDescriptor.of(desc);
List<FieldType> newParams = new ArrayList<>();
for (FieldType param : md.getParamTypes()) {
if (param instanceof ArrayType && ((ArrayType) param).getComponent() instanceof ObjectType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void methodTest() {
assertTrue(mappings.getMappings().containsKey("a"));
ClassMapping mapping = mappings.getMappings().get("a");

MethodSignature aSig = new MethodSignature("a", MethodDescriptor.compile("(ILa;I)La;"));
MethodSignature aSig = new MethodSignature("a", MethodDescriptor.of("(ILa;I)La;"));
assertTrue(mapping.getMethodMappings().containsKey(aSig));

MethodMapping methodMapping = mapping.getMethodMappings().get(aSig);
Expand Down

0 comments on commit 0da1074

Please sign in to comment.