diff options
| author | 2015-03-16 12:52:09 -0400 | |
|---|---|---|
| committer | 2015-03-16 12:52:09 -0400 | |
| commit | 563c5e08e3d61bfd39402a94e78bbaaf75623b04 (patch) | |
| tree | 34e72c074fe35f62e46f395c01c586096ae4fece /src/cuchaz/enigma/mapping | |
| parent | fix a zillion issues with inner classes (diff) | |
| download | enigma-fork-563c5e08e3d61bfd39402a94e78bbaaf75623b04.tar.gz enigma-fork-563c5e08e3d61bfd39402a94e78bbaaf75623b04.tar.xz enigma-fork-563c5e08e3d61bfd39402a94e78bbaaf75623b04.zip | |
fix more inner class issues
Diffstat (limited to 'src/cuchaz/enigma/mapping')
| -rw-r--r-- | src/cuchaz/enigma/mapping/ClassEntry.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/cuchaz/enigma/mapping/ClassEntry.java b/src/cuchaz/enigma/mapping/ClassEntry.java index 5f3b5e2..e6400b8 100644 --- a/src/cuchaz/enigma/mapping/ClassEntry.java +++ b/src/cuchaz/enigma/mapping/ClassEntry.java | |||
| @@ -105,20 +105,31 @@ public class ClassEntry implements Entry, Serializable { | |||
| 105 | 105 | ||
| 106 | public String getOutermostClassName() { | 106 | public String getOutermostClassName() { |
| 107 | if (isInnerClass()) { | 107 | if (isInnerClass()) { |
| 108 | return m_name.substring(0, m_name.lastIndexOf('$')); | 108 | return m_name.substring(0, m_name.indexOf('$')); |
| 109 | } | 109 | } |
| 110 | return m_name; | 110 | return m_name; |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | public String getInnermostClassName() { | 113 | public ClassEntry getOutermostClassEntry() { |
| 114 | return new ClassEntry(getOutermostClassName()); | ||
| 115 | } | ||
| 116 | |||
| 117 | public String getOuterClassName() { | ||
| 114 | if (!isInnerClass()) { | 118 | if (!isInnerClass()) { |
| 115 | throw new Error("This is not an inner class!"); | 119 | throw new Error("This is not an inner class!"); |
| 116 | } | 120 | } |
| 117 | return m_name.substring(m_name.lastIndexOf('$') + 1); | 121 | return m_name.substring(0, m_name.lastIndexOf('$')); |
| 118 | } | 122 | } |
| 119 | 123 | ||
| 120 | public ClassEntry getOutermostClassEntry() { | 124 | public ClassEntry getOuterClassEntry() { |
| 121 | return new ClassEntry(getOutermostClassName()); | 125 | return new ClassEntry(getOuterClassName()); |
| 126 | } | ||
| 127 | |||
| 128 | public String getInnermostClassName() { | ||
| 129 | if (!isInnerClass()) { | ||
| 130 | throw new Error("This is not an inner class!"); | ||
| 131 | } | ||
| 132 | return m_name.substring(m_name.lastIndexOf('$') + 1); | ||
| 122 | } | 133 | } |
| 123 | 134 | ||
| 124 | public boolean isInDefaultPackage() { | 135 | public boolean isInDefaultPackage() { |