diff options
Diffstat (limited to 'enigma/src/main/java')
| -rw-r--r-- | enigma/src/main/java/cuchaz/enigma/translation/mapping/IdentifierValidation.java | 9 | ||||
| -rw-r--r-- | enigma/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/enigma/src/main/java/cuchaz/enigma/translation/mapping/IdentifierValidation.java b/enigma/src/main/java/cuchaz/enigma/translation/mapping/IdentifierValidation.java index 097c9e9..8979767 100644 --- a/enigma/src/main/java/cuchaz/enigma/translation/mapping/IdentifierValidation.java +++ b/enigma/src/main/java/cuchaz/enigma/translation/mapping/IdentifierValidation.java | |||
| @@ -31,8 +31,15 @@ public final class IdentifierValidation { | |||
| 31 | "long", "strictfp", "volatile", "const", "float", "native", "super", "while", "_" | 31 | "long", "strictfp", "volatile", "const", "float", "native", "super", "while", "_" |
| 32 | ); | 32 | ); |
| 33 | 33 | ||
| 34 | public static boolean validateClassName(ValidationContext vc, String name) { | 34 | public static boolean validateClassName(ValidationContext vc, String name, boolean isInner) { |
| 35 | if (!StandardValidation.notBlank(vc, name)) return false; | 35 | if (!StandardValidation.notBlank(vc, name)) return false; |
| 36 | |||
| 37 | if (isInner) { | ||
| 38 | // When renaming, inner class names do not contain the package name, | ||
| 39 | // but only the class name. | ||
| 40 | return validateIdentifier(vc, name); | ||
| 41 | } | ||
| 42 | |||
| 36 | String[] parts = name.split("/"); | 43 | String[] parts = name.split("/"); |
| 37 | for (String part : parts) { | 44 | for (String part : parts) { |
| 38 | validateIdentifier(vc, part); | 45 | validateIdentifier(vc, part); |
diff --git a/enigma/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java b/enigma/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java index 15b0a9b..a167e21 100644 --- a/enigma/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java +++ b/enigma/src/main/java/cuchaz/enigma/translation/representation/entry/ClassEntry.java | |||
| @@ -99,7 +99,7 @@ public class ClassEntry extends ParentedEntry<ClassEntry> implements Comparable< | |||
| 99 | 99 | ||
| 100 | @Override | 100 | @Override |
| 101 | public void validateName(ValidationContext vc, String name) { | 101 | public void validateName(ValidationContext vc, String name) { |
| 102 | IdentifierValidation.validateClassName(vc, name); | 102 | IdentifierValidation.validateClassName(vc, name, this.isInnerClass()); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | @Override | 105 | @Override |