File tree Expand file tree Collapse file tree
java/src/processing/mode/java Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -436,8 +436,10 @@ static private void trimRight(final StringBuilder sb) {
436436 /** Entry point */
437437 public String format (final String source ) {
438438 final String normalizedText = source .replaceAll ("\r " , "" );
439- final String cleanText =
440- normalizedText + (normalizedText .endsWith ("\n " ) ? "" : "\n " );
439+ String cleanText = normalizedText ;
440+ if (!normalizedText .endsWith ("\n " )) {
441+ cleanText += "\n " ;
442+ }
441443
442444 // Globals' description at top of file.
443445 result .setLength (0 );
@@ -459,8 +461,8 @@ public String format(final String source) {
459461 ind = new boolean [10 ];
460462 p_flg = new int [10 ];
461463 s_tabs = new int [20 ][10 ];
462- doWhileFlags = new Stack <Boolean >();
463- ifWhileForFlags = new Stack <Boolean >();
464+ doWhileFlags = new Stack <>();
465+ ifWhileForFlags = new Stack <>();
464466
465467 chars = cleanText .toCharArray ();
466468
You can’t perform that action at this time.
0 commit comments