Skip to content

Commit

Permalink
Empty scalar is null, use double quotes for empty string.
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Mar 8, 2017
1 parent fdb4ee1 commit c902cdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ private ScalarAnalysis (String scalar, boolean empty, boolean multiline, boolean
}

static public ScalarAnalysis analyze (String scalar, boolean escapeUnicode) {
if (scalar == null || "".equals(scalar)) return new ScalarAnalysis(scalar, true, false, false, true, true, true, false);
if (scalar == null) return new ScalarAnalysis(scalar, true, false, false, true, true, true, false);
if ("".equals(scalar)) return new ScalarAnalysis(scalar, false, false, false, false, false, true, false);
boolean blockIndicators = false;
boolean flowIndicators = false;
boolean lineBreaks = false;
Expand Down
2 changes: 1 addition & 1 deletion src/com/esotericsoftware/yamlbeans/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ public Event produce () {
};
table[P_EMPTY_SCALAR] = new Production() {
public Event produce () {
return new ScalarEvent(null, null, new boolean[] {true, false}, "", (char)0);
return new ScalarEvent(null, null, new boolean[] {true, false}, null, (char)0);
}
};
}
Expand Down

0 comments on commit c902cdd

Please sign in to comment.