-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: handle edge case where a null array was provided
- Loading branch information
1 parent
d457050
commit f0c9e9e
Showing
6 changed files
with
73 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/test/resources/sh/arnaud/javaserde/units/009-nullable/Generator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import java.io.*; | ||
import java.util.Date; | ||
|
||
public class Nullable implements Serializable { | ||
enum Enum { | ||
ONE, | ||
TWO | ||
} | ||
|
||
private final String null_string = null; | ||
private final int[] null_ints = null; | ||
private final Enum null_enum = null; | ||
|
||
public static void main(String args[]) throws Exception { | ||
var stream = new ObjectOutputStream(System.out); | ||
|
||
stream.writeObject(new Nullable()); | ||
stream.flush(); | ||
} | ||
} |
Binary file added
BIN
+114 Bytes
src/test/resources/sh/arnaud/javaserde/units/009-nullable/stream.bin
Binary file not shown.
37 changes: 37 additions & 0 deletions
37
src/test/resources/sh/arnaud/javaserde/units/009-nullable/stream.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[ | ||
{ | ||
"@handle": 8257540, | ||
"@class": { | ||
"@handle": 8257536, | ||
"@name": "Nullable", | ||
"@serial": 9613321951376902, | ||
"@flags": 2, | ||
"@fields": [ | ||
{ | ||
"@name": "null_enum", | ||
"@type": "LNullable$Enum;" | ||
}, | ||
{ | ||
"@name": "null_ints", | ||
"@type": "[I" | ||
}, | ||
{ | ||
"@name": "null_string", | ||
"@type": "Ljava/lang/String;" | ||
} | ||
], | ||
"@annotations": [], | ||
"@super": null | ||
}, | ||
"@data": [ | ||
{ | ||
"@values": [ | ||
null, | ||
null, | ||
null | ||
], | ||
"@annotations": [] | ||
} | ||
] | ||
} | ||
] |