summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cuchaz/enigma/bytecode/ClassRenamer.java20
-rw-r--r--src/cuchaz/enigma/mapping/ClassEntry.java4
2 files changed, 20 insertions, 4 deletions
diff --git a/src/cuchaz/enigma/bytecode/ClassRenamer.java b/src/cuchaz/enigma/bytecode/ClassRenamer.java
index efe22a1..86a0433 100644
--- a/src/cuchaz/enigma/bytecode/ClassRenamer.java
+++ b/src/cuchaz/enigma/bytecode/ClassRenamer.java
@@ -74,7 +74,7 @@ public class ClassRenamer
74 } 74 }
75 } 75 }
76 76
77 public static Set<ClassEntry> getAllClassEntries( CtClass c ) 77 public static Set<ClassEntry> getAllClassEntries( final CtClass c )
78 { 78 {
79 // get the classes that javassist knows about 79 // get the classes that javassist knows about
80 final Set<ClassEntry> entries = Sets.newHashSet(); 80 final Set<ClassEntry> entries = Sets.newHashSet();
@@ -85,7 +85,23 @@ public class ClassRenamer
85 { 85 {
86 if( obj instanceof String ) 86 if( obj instanceof String )
87 { 87 {
88 entries.add( new ClassEntry( (String)obj ) ); 88 String str = (String)obj;
89
90 // javassist throws a lot of weird things at this map
91 // I either have to implement my on class scanner, or just try to filter out the weirdness
92 // I'm opting to filter out the weirdness for now
93
94 // skip anything with generic arguments
95 if( str.indexOf( '<' ) >= 0 || str.indexOf( '>' ) >= 0 || str.indexOf( ';' ) >= 0 )
96 {
97 return null;
98 }
99
100 // convert path/to/class.inner to path/to/class$inner
101 str = str.replace( '.', '$' );
102
103 // remember everything else
104 entries.add( new ClassEntry( str ) );
89 } 105 }
90 return null; 106 return null;
91 } 107 }
diff --git a/src/cuchaz/enigma/mapping/ClassEntry.java b/src/cuchaz/enigma/mapping/ClassEntry.java
index f8477c9..c6faa50 100644
--- a/src/cuchaz/enigma/mapping/ClassEntry.java
+++ b/src/cuchaz/enigma/mapping/ClassEntry.java
@@ -27,14 +27,14 @@ public class ClassEntry implements Entry, Serializable
27 } 27 }
28 if( className.indexOf( '.' ) >= 0 ) 28 if( className.indexOf( '.' ) >= 0 )
29 { 29 {
30 throw new IllegalArgumentException( "Class name must be in JVM format. ie, path/to/package/class$inner" ); 30 throw new IllegalArgumentException( "Class name must be in JVM format. ie, path/to/package/class$inner : " + className );
31 } 31 }
32 32
33 m_name = className; 33 m_name = className;
34 34
35 if( isInnerClass() && getInnerClassName().indexOf( '/' ) >= 0 ) 35 if( isInnerClass() && getInnerClassName().indexOf( '/' ) >= 0 )
36 { 36 {
37 throw new IllegalArgumentException( "Inner class must not have a package: " + getInnerClassName() ); 37 throw new IllegalArgumentException( "Inner class must not have a package: " + className );
38 } 38 }
39 } 39 }
40 40