Skip to content

Commit

Permalink
I fixed things.
Browse files Browse the repository at this point in the history
  • Loading branch information
karelmikie3 committed Apr 20, 2018
1 parent 85d1936 commit d8df43e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 77 deletions.
1 change: 1 addition & 0 deletions src/main/java/hxckdms/hxcconfig/HxCConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public HxCConfig(Class<?> clazz, String configName, File configDirectory, String
@SuppressWarnings("ResultOfMethodCallIgnored")
public final void initConfiguration() {
configWritingData.clear();
currentLine = -1;

try {
configDirectory.mkdirs();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ private static <K, V> Map mainMapReader(Map<String, Object> info, Map<K, V> temp
if (key == null) key = (K) cKeyHandler.read(line.split("=")[0].trim(), mainInstance, keyInnerInfo);

if (mainInstance.getPreviousLine(false).contains("=")) {
tempMap.put(key, (V) cValueHandler.read(mainInstance.getPreviousLine(false).split("=")[1].trim(), mainInstance, valueInnerInfo));
String[] entry = mainInstance.getPreviousLine(false).split("=");
tempMap.put(key, (V) cValueHandler.read(entry.length > 0 ? entry[1].trim() : "", mainInstance, valueInnerInfo));
key = null;
}
} catch (Exception ignored) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ public Object read(String value, HxCConfig mainInstance, Map<String, Object> inf

IConfigurationHandler cHandler = mainInstance.getConfigurationTypeHandler(field.getType());

field.set(instance, cHandler.read(line.split("=")[1].trim(), mainInstance, innerInfo));
String[] entry = line.split("=");
field.set(instance, cHandler.read(entry.length > 1 ? entry[1].trim() : "", mainInstance, innerInfo));

fName = "";
}
Expand Down
75 changes: 0 additions & 75 deletions test/testConfig.cfg

This file was deleted.

0 comments on commit d8df43e

Please sign in to comment.