diff options
| author | 2019-01-24 14:48:32 +0200 | |
|---|---|---|
| committer | 2019-01-24 13:48:32 +0100 | |
| commit | 00fcd0550fcdda621c2e4662f6ddd55ce673b931 (patch) | |
| tree | 6f9e4c24dbcc6d118fceec56adf7bf9d747a485c /src/main/java/cuchaz/enigma/analysis/ParsedJar.java | |
| parent | mark as 0.13.0-SNAPSHOT for preliminary development (diff) | |
| download | enigma-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.java | 10 |
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 @@ | |||
| 12 | package cuchaz.enigma.analysis; | 12 | package cuchaz.enigma.analysis; |
| 13 | 13 | ||
| 14 | import com.google.common.io.ByteStreams; | 14 | import com.google.common.io.ByteStreams; |
| 15 | import cuchaz.enigma.mapping.entry.ClassEntry; | 15 | import cuchaz.enigma.translation.representation.entry.ClassEntry; |
| 16 | import org.objectweb.asm.ClassReader; | 16 | import org.objectweb.asm.ClassReader; |
| 17 | import org.objectweb.asm.ClassVisitor; | 17 | import org.objectweb.asm.ClassVisitor; |
| 18 | import org.objectweb.asm.tree.ClassNode; | 18 | import org.objectweb.asm.tree.ClassNode; |
| 19 | 19 | ||
| 20 | import javax.annotation.Nullable; | ||
| 20 | import java.io.BufferedInputStream; | 21 | import java.io.BufferedInputStream; |
| 21 | import java.io.IOException; | 22 | import java.io.IOException; |
| 22 | import java.io.InputStream; | 23 | import 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; |