Skip to content

Commit dc7a3ed

Browse files
closes #130 (#131)
* closes #128 * closes #107 #127 * closes #130
1 parent b2b8cbc commit dc7a3ed

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Diff for: java/Coded-Json/src/main/java/com/codedjson/Json.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public Object parse() {
212212
* @return
213213
* @throws IllegalValueType
214214
*/
215-
public Object parse(String key) throws IllegalValueType, InvalidJPathError {
215+
public Object parse(String key) throws InvalidJPathError {
216216
if(key == null) throw new NullPointerException("Key cannot be null");
217217
else if(!key.startsWith("$.")) throw new InvalidJPathError();
218218

@@ -224,7 +224,7 @@ public Object parse(String key) throws IllegalValueType, InvalidJPathError {
224224
case "double": return Double.parseDouble(value.value.toString());
225225
case "String": return value.value.toString();
226226
case "null": return null;
227-
default: throw new IllegalValueType("Undefined value type : " + value.value.getClass().getTypeName());
227+
default: return value.value;
228228
}
229229
}
230230
}

Diff for: java/Coded-Json/src/test/com/codedjson/CjsonTests.java

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import org.junit.jupiter.api.Test;
1010

1111
import java.io.FileNotFoundException;
12+
import java.nio.file.Path;
13+
import java.nio.file.Paths;
1214
import java.util.Arrays;
1315
import java.util.HashMap;
1416

0 commit comments

Comments
 (0)