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() {
487
487
currentContext .first = false ;
488
488
}
489
489
490
+ protected boolean inNone () {
491
+ return currentContext .scope == Scope .IN_NONE ;
492
+ }
493
+
490
494
boolean isCommaAllowed () {
491
495
return !currentContext .first && currentContext .scope != Scope .IN_FIELD ;
492
496
}
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ private void writeIndent() {
88
88
@ Override
89
89
protected void writeComma () {
90
90
super .writeComma ();
91
- if (isCommaAllowed ()) {
91
+ if (isCommaAllowed () && ! inNone () ) {
92
92
writeChar ('\n' );
93
93
writeIndent ();
94
94
}
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ public void testPrettyPrinting() throws Exception {
225
225
generator .close ();
226
226
writer .close ();
227
227
228
- BufferedReader reader = new BufferedReader (new StringReader (writer .toString (). trim () ));
228
+ BufferedReader reader = new BufferedReader (new StringReader (writer .toString ()));
229
229
int numberOfLines = 0 ;
230
230
String line ;
231
231
while ((line = reader .readLine ()) != null ) {
You can’t perform that action at this time.
0 commit comments