From d62425901018551abac297198a92001422a982ba Mon Sep 17 00:00:00 2001 From: GKFX Date: Wed, 4 Jun 2014 16:21:02 +0100 Subject: [PATCH] Autoformatter: avoid code being left in buf issue #2540 --- app/src/processing/mode/java/AutoFormat.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/processing/mode/java/AutoFormat.java b/app/src/processing/mode/java/AutoFormat.java index 38c29a512a..5e4080ecac 100644 --- a/app/src/processing/mode/java/AutoFormat.java +++ b/app/src/processing/mode/java/AutoFormat.java @@ -688,15 +688,10 @@ else if (forFlag) { } } // end switch } // end while not EOF + + if (buf.length() > 0) writeIndentedLine(); final String formatted = result.toString(); - if (!formatted.replaceAll("[\\s\\*/]","") - .equals(source.replaceAll("[\\s\\*/]",""))) { - // Double-check - this thing's so buggy it might be best to have one. - throw new RuntimeException("The autoformatter did something funny. Please" + - "copy and paste your sketch into a new issue on GitHub. \n" + - "https://github.com/processing/processing/issues/new"); - } return formatted.equals(cleanText) ? source : formatted; } }