Skip to content

Commit cd7461b

Browse files
committed
Disable coercing errors for AbstractNull and return null instead to replicate the previous behavior
1 parent 367699b commit cd7461b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<properties>
88
<maven.compiler.source>8</maven.compiler.source>
99
<maven.compiler.target>8</maven.compiler.target>
10-
<buildVersion>1.0.3-SNAPSHOT</buildVersion>
10+
<buildVersion>1.0.4-SNAPSHOT</buildVersion>
1111
</properties>
1212

1313
<groupId>org.javawebstack</groupId>

src/main/java/org/javawebstack/abstractdata/AbstractNull.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,22 @@ public boolean isNull() {
1919
}
2020

2121
public String string(boolean strict) throws AbstractCoercingException {
22-
if(strict)
23-
throw new AbstractCoercingException(Type.STRING, Type.NULL);
2422
return null;
2523
}
2624

2725
public Boolean bool(boolean strict) throws AbstractCoercingException {
28-
if(strict)
29-
throw new AbstractCoercingException(Type.STRING, Type.NULL);
3026
return null;
3127
}
3228

3329
public Number number(boolean strict) throws AbstractCoercingException {
34-
if(strict)
35-
throw new AbstractCoercingException(Type.STRING, Type.NULL);
30+
return null;
31+
}
32+
33+
public AbstractObject object(boolean strict) throws AbstractCoercingException {
34+
return null;
35+
}
36+
37+
public AbstractArray array(boolean strict) throws AbstractCoercingException {
3638
return null;
3739
}
3840

0 commit comments

Comments
 (0)