From f1466cbe3020bbb192ffa7d7ec27119fbc1abe8a Mon Sep 17 00:00:00 2001 From: A Pottinger Date: Wed, 1 Jul 2020 15:04:15 -0700 Subject: [PATCH] Made minor edits as described at https://github.com/processing/processing4/pull/99. --- app/src/processing/app/ui/Editor.java | 2 +- .../java/CompileErrorMessageSimplifier.java | 3 +-- java/src/processing/mode/java/Compiler.java | 22 +++++++++---------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/src/processing/app/ui/Editor.java b/app/src/processing/app/ui/Editor.java index 500ff20cee..1cbfcb6b4e 100644 --- a/app/src/processing/app/ui/Editor.java +++ b/app/src/processing/app/ui/Editor.java @@ -1303,7 +1303,7 @@ public void showReferenceFile(File file) { } - static public void showChanges() { + static public void showChangesV3() { // http://code.google.com/p/processing/issues/detail?id=1520 if (!Base.isCommandLine()) { Platform.openURL("https://github.com/processing/processing/wiki/Changes"); diff --git a/java/src/processing/mode/java/CompileErrorMessageSimplifier.java b/java/src/processing/mode/java/CompileErrorMessageSimplifier.java index c5bac678c4..157be81142 100644 --- a/java/src/processing/mode/java/CompileErrorMessageSimplifier.java +++ b/java/src/processing/mode/java/CompileErrorMessageSimplifier.java @@ -245,8 +245,7 @@ public static String getSimplifiedErrorMessage(IProblem iprob, String badCode) { final String undefinedName = args[0]; if (undefinedName.equals("frame")) { result = Language.interpolate("editor.status.item_removed", undefinedName, "surface"); - } - else { + } else { result = Language.interpolate("editor.status.undef_name", undefinedName); } } diff --git a/java/src/processing/mode/java/Compiler.java b/java/src/processing/mode/java/Compiler.java index 2cd34b3fd5..6050a0174e 100644 --- a/java/src/processing/mode/java/Compiler.java +++ b/java/src/processing/mode/java/Compiler.java @@ -182,7 +182,7 @@ public void close() { } exception.setMessage("processing.xml no longer exists, this code needs to be updated for 2.0."); System.err.println("The processing.xml library has been replaced " + "with a new 'XML' class that's built-in."); - handleCrustyCode(); + handleCrustyCodeV3(); } else { exception.setMessage("The package " + @@ -206,7 +206,7 @@ public void close() { } what.equals("BGraphics") || what.equals("BImage")) { exception.setMessage(what + " has been replaced with P" + what.substring(1)); - handleCrustyCode(); + handleCrustyCodeV3(); } else { exception.setMessage("Cannot find a class or type " + @@ -230,22 +230,22 @@ public void close() { } what.equals("LINE_STRIP")) { exception.setMessage("LINE_LOOP and LINE_STRIP are not available, " + "please update your code."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (what.equals("framerate")) { exception.setMessage("framerate should be changed to frameRate."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (what.equals("screen")) { exception.setMessage("Change screen.width and screen.height to " + "displayWidth and displayHeight."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (what.equals("screenWidth") || what.equals("screenHeight")) { exception.setMessage("Change screenWidth and screenHeight to " + "displayWidth and displayHeight."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (what.equals("frame")) { exception.setMessage("frame was removed, use surface instead."); @@ -283,15 +283,15 @@ public void close() { } if (parts != null) { if (parts[1].equals("framerate(int)")) { exception.setMessage("framerate() no longer exists, use frameRate() instead."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (parts[1].equals("push()")) { exception.setMessage("push() no longer exists, use pushMatrix() instead."); - handleCrustyCode(); + handleCrustyCodeV3(); } else if (parts[1].equals("pop()")) { exception.setMessage("pop() no longer exists, use popMatrix() instead."); - handleCrustyCode(); + handleCrustyCodeV3(); } else { String mess = "The function " + parts[1] + " does not exist."; @@ -325,9 +325,9 @@ static protected void printCrustyCodeMessage() { "please read the Changes page on the Wiki."); } - static protected void handleCrustyCode() { + static protected void handleCrustyCodeV3() { printCrustyCodeMessage(); - Editor.showChanges(); + Editor.showChangesV3(); } static protected void handleCrustyCodeV4() {