diff options
| author | 2014-09-03 00:20:36 -0400 | |
|---|---|---|
| committer | 2014-09-03 00:20:36 -0400 | |
| commit | b5338883d271779c335842c07047d60136316167 (patch) | |
| tree | 006477e8c1ea0ade75ae8a9003abaf1978995fd7 /src/cuchaz/enigma/mapping/MappingsWriter.java | |
| parent | fixed bug with export progress bar (diff) | |
| download | enigma-fork-b5338883d271779c335842c07047d60136316167.tar.gz enigma-fork-b5338883d271779c335842c07047d60136316167.tar.xz enigma-fork-b5338883d271779c335842c07047d60136316167.zip | |
big refactor to better model class/method mappings with no deobf name
Diffstat (limited to 'src/cuchaz/enigma/mapping/MappingsWriter.java')
| -rw-r--r-- | src/cuchaz/enigma/mapping/MappingsWriter.java | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/cuchaz/enigma/mapping/MappingsWriter.java b/src/cuchaz/enigma/mapping/MappingsWriter.java index 6203571..ea6e655 100644 --- a/src/cuchaz/enigma/mapping/MappingsWriter.java +++ b/src/cuchaz/enigma/mapping/MappingsWriter.java | |||
| @@ -37,7 +37,14 @@ public class MappingsWriter | |||
| 37 | private void write( PrintWriter out, ClassMapping classMapping, int depth ) | 37 | private void write( PrintWriter out, ClassMapping classMapping, int depth ) |
| 38 | throws IOException | 38 | throws IOException |
| 39 | { | 39 | { |
| 40 | out.format( "%sCLASS %s %s\n", getIndent( depth ), classMapping.getObfName(), classMapping.getDeobfName() ); | 40 | if( classMapping.getDeobfName() == null ) |
| 41 | { | ||
| 42 | out.format( "%sCLASS %s\n", getIndent( depth ), classMapping.getObfName() ); | ||
| 43 | } | ||
| 44 | else | ||
| 45 | { | ||
| 46 | out.format( "%sCLASS %s %s\n", getIndent( depth ), classMapping.getObfName(), classMapping.getDeobfName() ); | ||
| 47 | } | ||
| 41 | 48 | ||
| 42 | for( ClassMapping innerClassMapping : sorted( classMapping.innerClasses() ) ) | 49 | for( ClassMapping innerClassMapping : sorted( classMapping.innerClasses() ) ) |
| 43 | { | 50 | { |
| @@ -64,11 +71,21 @@ public class MappingsWriter | |||
| 64 | private void write( PrintWriter out, MethodMapping methodMapping, int depth ) | 71 | private void write( PrintWriter out, MethodMapping methodMapping, int depth ) |
| 65 | throws IOException | 72 | throws IOException |
| 66 | { | 73 | { |
| 67 | out.format( "%sMETHOD %s %s %s %s\n", | 74 | if( methodMapping.getDeobfName() == null ) |
| 68 | getIndent( depth ), | 75 | { |
| 69 | methodMapping.getObfName(), methodMapping.getDeobfName(), | 76 | out.format( "%sMETHOD %s %s\n", |
| 70 | methodMapping.getObfSignature(), methodMapping.getDeobfSignature() | 77 | getIndent( depth ), |
| 71 | ); | 78 | methodMapping.getObfName(), methodMapping.getObfSignature() |
| 79 | ); | ||
| 80 | } | ||
| 81 | else | ||
| 82 | { | ||
| 83 | out.format( "%sMETHOD %s %s %s %s\n", | ||
| 84 | getIndent( depth ), | ||
| 85 | methodMapping.getObfName(), methodMapping.getDeobfName(), | ||
| 86 | methodMapping.getObfSignature(), methodMapping.getDeobfSignature() | ||
| 87 | ); | ||
| 88 | } | ||
| 72 | 89 | ||
| 73 | for( ArgumentMapping argumentMapping : sorted( methodMapping.arguments() ) ) | 90 | for( ArgumentMapping argumentMapping : sorted( methodMapping.arguments() ) ) |
| 74 | { | 91 | { |