summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2024-05-31 18:56:00 +0200
committer zaaarf <me@zaaarf.foo>2024-05-31 18:56:00 +0200
commitf7123206100c7026bab4478ad276bcda63f1be6a (patch)
tree52120e0f9dae87cda80ff029b6c70c5dbcf7de46 /src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java
parentc48450085ba07655abc8b119629634f5ca43ebb9 (diff)
fix: solved various (glaring) mistakes, now it works!HEAD0.4.1dev
Diffstat (limited to 'src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java')
-rw-r--r--src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java b/src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java
index b4d51af..55bc54b 100644
--- a/src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java
+++ b/src/main/java/ftbsc/lll/mapper/impl/SRGMapper.java
@@ -78,17 +78,17 @@ public class SRGMapper implements IMappingFormat {
String[] split = tokens[1].split("/");
String memberName = split[split.length - 1];
String parent = tokens[1].substring(0, tokens[1].length() - split[split.length - 1].length() - 1);
- int obfPosition = field ? 2 : 3;
- split = tokens[obfPosition].split("/");
- String memberNameObf = split[split.length - 1];
- String parentObf = tokens[obfPosition].substring(0, tokens[obfPosition].length() - split[split.length - 1].length() - 1);
- this.registerMember(mapper, invertedMapper, parent, parentObf, memberName, memberNameObf,
+ int mappedPosition = field ? 2 : 3;
+ split = tokens[mappedPosition].split("/");
+ String memberNameMapped = split[split.length - 1];
+ String parentMapped = tokens[mappedPosition].substring(0, tokens[mappedPosition].length() - split[split.length - 1].length() - 1);
+ this.registerMember(mapper, invertedMapper, parent, parentMapped, memberName, memberNameMapped,
field ? null : tokens[2], field ? null : tokens[4]);
return true;
}
/**
- * Registers a class in the mapper, if it isn't already.
+ * Registers a class in the mapper, if it isn't already known.
* @param mapper the {@link Mapper} with normal mappings
* @param invertedMapper the {@link Mapper} with inverted mappings
* @param name the name
@@ -118,12 +118,10 @@ public class SRGMapper implements IMappingFormat {
this.registerClass(mapper, invertedMapper, parent, parentMapped);
ClassData data = mapper.getClassData(parent);
ClassData dataReverse = invertedMapper.getClassData(data.nameMapped);
- if(descriptor == null || descriptorMapped == null) {
- //field
+ if(descriptor == null || descriptorMapped == null) { // field
data.addField(name, nameMapped);
dataReverse.addField(nameMapped, name);
- } else {
- //method
+ } else { // method
data.addMethod(name, nameMapped, descriptor);
dataReverse.addMethod(nameMapped, name, descriptorMapped);
}