diff options
Diffstat (limited to 'src/main/java/cuchaz/enigma/convert/MatchesReader.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/convert/MatchesReader.java | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main/java/cuchaz/enigma/convert/MatchesReader.java b/src/main/java/cuchaz/enigma/convert/MatchesReader.java index 773566d..f7853ac 100644 --- a/src/main/java/cuchaz/enigma/convert/MatchesReader.java +++ b/src/main/java/cuchaz/enigma/convert/MatchesReader.java | |||
| @@ -28,7 +28,7 @@ public class MatchesReader { | |||
| 28 | throws IOException { | 28 | throws IOException { |
| 29 | try (BufferedReader in = new BufferedReader(new FileReader(file))) { | 29 | try (BufferedReader in = new BufferedReader(new FileReader(file))) { |
| 30 | ClassMatches matches = new ClassMatches(); | 30 | ClassMatches matches = new ClassMatches(); |
| 31 | String line = null; | 31 | String line; |
| 32 | while ((line = in.readLine()) != null) { | 32 | while ((line = in.readLine()) != null) { |
| 33 | matches.add(readClassMatch(line)); | 33 | matches.add(readClassMatch(line)); |
| 34 | } | 34 | } |
| @@ -56,8 +56,8 @@ public class MatchesReader { | |||
| 56 | public static <T extends Entry> MemberMatches<T> readMembers(File file) | 56 | public static <T extends Entry> MemberMatches<T> readMembers(File file) |
| 57 | throws IOException { | 57 | throws IOException { |
| 58 | try (BufferedReader in = new BufferedReader(new FileReader(file))) { | 58 | try (BufferedReader in = new BufferedReader(new FileReader(file))) { |
| 59 | MemberMatches<T> matches = new MemberMatches<T>(); | 59 | MemberMatches<T> matches = new MemberMatches<>(); |
| 60 | String line = null; | 60 | String line; |
| 61 | while ((line = in.readLine()) != null) { | 61 | while ((line = in.readLine()) != null) { |
| 62 | readMemberMatch(matches, line); | 62 | readMemberMatch(matches, line); |
| 63 | } | 63 | } |
| @@ -90,13 +90,8 @@ public class MatchesReader { | |||
| 90 | } | 90 | } |
| 91 | String[] parts = in.split(" "); | 91 | String[] parts = in.split(" "); |
| 92 | if (parts.length == 3 && parts[2].indexOf('(') < 0) { | 92 | if (parts.length == 3 && parts[2].indexOf('(') < 0) { |
| 93 | return (T) new FieldEntry( | 93 | return (T) new FieldEntry(new ClassEntry(parts[0]), parts[1], new Type(parts[2])); |
| 94 | new ClassEntry(parts[0]), | ||
| 95 | parts[1], | ||
| 96 | new Type(parts[2]) | ||
| 97 | ); | ||
| 98 | } else { | 94 | } else { |
| 99 | assert (parts.length == 2 || parts.length == 3); | ||
| 100 | if (parts.length == 2) { | 95 | if (parts.length == 2) { |
| 101 | return (T) EntryFactory.getBehaviorEntry(parts[0], parts[1]); | 96 | return (T) EntryFactory.getBehaviorEntry(parts[0], parts[1]); |
| 102 | } else if (parts.length == 3) { | 97 | } else if (parts.length == 3) { |