From cf559b4a90f1bfa830cb8b92e283066eae99657f Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Sat, 12 Oct 2013 18:01:16 -0400 Subject: [PATCH] resolution for println() issues --- app/src/processing/mode/java/runner/Runner.java | 2 +- build/shared/revisions.txt | 7 +++++++ core/src/processing/core/PApplet.java | 15 +++++++++++++++ core/todo.txt | 3 ++- todo.txt | 5 ++++- 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/app/src/processing/mode/java/runner/Runner.java b/app/src/processing/mode/java/runner/Runner.java index 4bc3cb72d..31e9bf2a1 100644 --- a/app/src/processing/mode/java/runner/Runner.java +++ b/app/src/processing/mode/java/runner/Runner.java @@ -470,7 +470,7 @@ public class Runner implements MessageConsumer { // PApplet.println("launchJava stderr:"); // PApplet.println(errorStrings); // PApplet.println("launchJava stdout:"); - PApplet.println(inputStrings); + PApplet.printArray(inputStrings); if (errorStrings != null && errorStrings.length > 1) { if (errorStrings[0].indexOf("Invalid maximum heap size") != -1) { diff --git a/build/shared/revisions.txt b/build/shared/revisions.txt index 53d874efb..134ac7d0a 100644 --- a/build/shared/revisions.txt +++ b/build/shared/revisions.txt @@ -1,3 +1,10 @@ +PROCESSING 2.1 beta 1 (REV 0222) - XX October 2013 + ++ Added printArray() function for people who want to avoid the compiler warnings with Eclipse or whatever else, and deprecating the old println(Object) in favor of people using printArray(). In the PDE, this should be transparent (the warnings are not shown). + +. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . + + PROCESSING 2.0.3 (REV 0221) - 5 September 2013 Lots of bug fixes, primarily a ton of work by Andres to improve diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 9e6e20b4a..1077b794a 100755 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -4397,6 +4397,7 @@ public class PApplet extends Applet } + /* static public void print(Object what) { if (what == null) { // special case since this does fuggly things on > 1.1 @@ -4405,6 +4406,7 @@ public class PApplet extends Applet System.out.println(what.toString()); } } + */ /** @@ -4487,6 +4489,8 @@ public class PApplet extends Applet // Breaking this out since the compiler doesn't know the difference between // Object... and just Object (with an array passed in). This should take care // of the confusion for at least the most common case (a String array). + // On second thought, we're going the printArray() route, since the other + // object types are also used frequently. static public void println(String[] array) { for (int i = 0; i < array.length; i++) { System.out.println("[" + i + "] \"" + array[i] + "\""); @@ -4496,7 +4500,18 @@ public class PApplet extends Applet */ + /** + * Use printArray() instead. This function causes a warning because the new + * print(Object...) and println(Object...) functions can't be reliably + * bound by the compiler. + */ + @Deprecated static public void println(Object what) { + printArray(what); + } + + + static public void printArray(Object what) { if (what == null) { // special case since this does fuggly things on > 1.1 System.out.println("null"); diff --git a/core/todo.txt b/core/todo.txt index 43fcad9c1..9f0071548 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -19,7 +19,8 @@ X JSONObject/Array.format(-1) not working on embedded JSONObjects X https://github.com/processing/processing/issues/2119 X allow println() and print() to take varargs o https://github.com/processing/processing/issues/2056 -_ causes conflict with printing arrays +X causes conflict with printing arrays +X added printArray() function instead opengl X fix inconsistency with P2D and resetMatrix() diff --git a/todo.txt b/todo.txt index 8e71e3b2d..007b5eecb 100644 --- a/todo.txt +++ b/todo.txt @@ -588,6 +588,8 @@ _ see how library installation goes, then possibly do same w/ examples PDE / Libraries +_ Add a means to specify packages to import in library.properties +_ https://github.com/processing/processing/issues/2134 _ need to deal with classpath conflicts _ avoid garbage that people have installed on their machines _ antlr.jar in the classpath will cause trouble.. @@ -632,7 +634,8 @@ _ String osName = System.getProperty("os.name"); _ String osArch = System.getProperty("os.arch"); _ http://stackoverflow.com/questions/1611357/how-to-make-a-jar-file-that-include-dll-files _ add control for dependencies (i.e. svg needs xml), needed for export -_ http://code.google.com/p/processing/issues/detail?id=70 +X http://code.google.com/p/processing/issues/detail?id=70 +_ https://github.com/processing/processing/issues/109 _ need better platform designation setup for libs _ library installation should use the sketchbook folder, not the p5 folder _ actually enforce this, give users a warning about other libs