Skip to content

Commit 9eb63c1

Browse files
committed
erase types and make this if() a little less confusing
1 parent b02f5d4 commit 9eb63c1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

java/src/processing/mode/java/AutoFormat.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)