resolution for println() issues

This commit is contained in:
Ben Fry
2013-10-12 18:01:16 -04:00
parent 543d51fc3b
commit cf559b4a90
5 changed files with 29 additions and 3 deletions

View File

@@ -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) {

View File

@@ -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

View File

@@ -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");

View File

@@ -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()

View File

@@ -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