File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
main/java/org/glassfish/json
test/java/org/glassfish/json/tests Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -487,6 +487,10 @@ protected void writeComma() {
487487 currentContext .first = false ;
488488 }
489489
490+ protected boolean inNone () {
491+ return currentContext .scope == Scope .IN_NONE ;
492+ }
493+
490494 boolean isCommaAllowed () {
491495 return !currentContext .first && currentContext .scope != Scope .IN_FIELD ;
492496 }
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ private void writeIndent() {
8888 @ Override
8989 protected void writeComma () {
9090 super .writeComma ();
91- if (isCommaAllowed ()) {
91+ if (isCommaAllowed () && ! inNone () ) {
9292 writeChar ('\n' );
9393 writeIndent ();
9494 }
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ public void testPrettyPrinting() throws Exception {
225225 generator .close ();
226226 writer .close ();
227227
228- BufferedReader reader = new BufferedReader (new StringReader (writer .toString (). trim () ));
228+ BufferedReader reader = new BufferedReader (new StringReader (writer .toString ()));
229229 int numberOfLines = 0 ;
230230 String line ;
231231 while ((line = reader .readLine ()) != null ) {
You can’t perform that action at this time.
0 commit comments