summaryrefslogtreecommitdiff
path: root/src/main/java/cuchaz/enigma/analysis/ParsedJar.java
diff options
context:
space:
mode:
authorGravatar Gegy2019-01-24 14:48:32 +0200
committerGravatar Adrian Siekierka2019-01-24 13:48:32 +0100
commit00fcd0550fcdda621c2e4662f6ddd55ce673b931 (patch)
tree6f9e4c24dbcc6d118fceec56adf7bf9d747a485c /src/main/java/cuchaz/enigma/analysis/ParsedJar.java
parentmark as 0.13.0-SNAPSHOT for preliminary development (diff)
downloadenigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.tar.gz
enigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.tar.xz
enigma-fork-00fcd0550fcdda621c2e4662f6ddd55ce673b931.zip
[WIP] Mapping rework (#91)
* Move packages * Mapping & entry refactor: first pass * Fix deobf -> obf tree remapping * Resolve various issues * Give all entries the potential for parents and treat inner classes as children * Deobf UI tree elements * Tests pass * Sort mapping output * Fix delta tracking * Index separation and first pass for #97 * Keep track of remapped jar index * Fix child entries not being remapped * Drop non-root entries * Track dropped mappings * Fix enigma mapping ordering * EntryTreeNode interface * Small tweaks * Naive full index remap on rename * Entries can resolve to more than one root entry * Support alternative resolution strategies * Bridge method resolution * Tests pass * Fix mappings being used where there are none * Fix methods with different descriptors being considered unique. closes #89
Diffstat (limited to 'src/main/java/cuchaz/enigma/analysis/ParsedJar.java')
-rw-r--r--src/main/java/cuchaz/enigma/analysis/ParsedJar.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/cuchaz/enigma/analysis/ParsedJar.java b/src/main/java/cuchaz/enigma/analysis/ParsedJar.java
index 86655d0..ad3aceb 100644
--- a/src/main/java/cuchaz/enigma/analysis/ParsedJar.java
+++ b/src/main/java/cuchaz/enigma/analysis/ParsedJar.java
@@ -12,11 +12,12 @@
12package cuchaz.enigma.analysis; 12package cuchaz.enigma.analysis;
13 13
14import com.google.common.io.ByteStreams; 14import com.google.common.io.ByteStreams;
15import cuchaz.enigma.mapping.entry.ClassEntry; 15import cuchaz.enigma.translation.representation.entry.ClassEntry;
16import org.objectweb.asm.ClassReader; 16import org.objectweb.asm.ClassReader;
17import org.objectweb.asm.ClassVisitor; 17import org.objectweb.asm.ClassVisitor;
18import org.objectweb.asm.tree.ClassNode; 18import org.objectweb.asm.tree.ClassNode;
19 19
20import javax.annotation.Nullable;
20import java.io.BufferedInputStream; 21import java.io.BufferedInputStream;
21import java.io.IOException; 22import java.io.IOException;
22import java.io.InputStream; 23import java.io.InputStream;
@@ -100,9 +101,14 @@ public class ParsedJar {
100 return entries; 101 return entries;
101 } 102 }
102 103
104 @Nullable
103 public ClassNode getClassNode(String name) { 105 public ClassNode getClassNode(String name) {
104 return nodeCache.computeIfAbsent(name, (n) -> { 106 return nodeCache.computeIfAbsent(name, (n) -> {
105 ClassReader reader = new ClassReader(classBytes.get(name)); 107 byte[] bytes = classBytes.get(name);
108 if (bytes == null) {
109 return null;
110 }
111 ClassReader reader = new ClassReader(bytes);
106 ClassNode node = new ClassNode(); 112 ClassNode node = new ClassNode();
107 reader.accept(node, 0); 113 reader.accept(node, 0);
108 return node; 114 return node;