add special case for null in println(), remove println() from dataPath()

This commit is contained in:
Ben Fry
2014-01-21 18:21:46 -05:00
parent cfb40240b3
commit f1fa2f3a03

View File

@@ -4512,7 +4512,9 @@ public class PApplet extends Applet
* be reliably bound by the compiler.
*/
static public void println(Object what) {
if (what != null && what.getClass().isArray()) {
if (what == null) {
System.out.println("null");
} else if (what.getClass().isArray()) {
printArray(what);
} else {
System.out.println(what.toString());
@@ -7876,7 +7878,6 @@ public class PApplet extends Applet
// http://code.google.com/p/processing/issues/detail?id=1073
File containingFolder = new File(urlDecode(jarPath)).getParentFile();
File dataFolder = new File(containingFolder, "data");
System.out.println(dataFolder);
return new File(dataFolder, where);
}
// Windows, Linux, or when not using a Mac OS X .app file
@@ -10894,7 +10895,7 @@ public class PApplet extends Applet
final String[] argsWithSketchName = new String[args.length + 1];
System.arraycopy(args, 0, argsWithSketchName, 0, args.length);
final String className = this.getClass().getSimpleName();
final String cleanedClass =
final String cleanedClass =
className.replaceAll("__[^_]+__\\$", "").replaceAll("\\$\\d+", "");
argsWithSketchName[args.length] = cleanedClass;
runSketch(argsWithSketchName, this);