mirror of
https://github.com/processing/processing4.git
synced 2026-02-11 17:40:48 +01:00
fixing exception handling stuff, println(byte) added
This commit is contained in:
@@ -103,7 +103,6 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
//PApplet.println(PApplet.join(command, " "));
|
||||
process = Runtime.getRuntime().exec(command);
|
||||
new SystemOutSiphon(process.getInputStream());
|
||||
//new PdeMessageSiphon(process.getErrorStream(), this);
|
||||
new PdeMessageSiphon(process.getErrorStream(), this);
|
||||
processOutput = process.getOutputStream();
|
||||
|
||||
@@ -436,18 +435,22 @@ java.lang.NullPointerException
|
||||
if (colonIndex != -1) {
|
||||
String filename = fileAndLine.substring(0, colonIndex);
|
||||
// "javatest.java" and "5"
|
||||
//System.out.println("filename = " + filename);
|
||||
//System.out.println("pre0 = " + sketch.code[0].preprocName);
|
||||
for (int i = 0; i < sketch.codeCount; i++) {
|
||||
if (sketch.code[i].preprocName.equals(filename)) {
|
||||
codeIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// lineIndex is 1-indexed, but editor wants zero-indexed
|
||||
lineIndex = Integer.parseInt(fileAndLine.substring(colonIndex + 1));
|
||||
//System.out.println("code/line is " + codeIndex + " " + lineIndex);
|
||||
exception = new PdeException(exception.getMessage(),
|
||||
codeIndex, lineIndex - 1, -1);
|
||||
foundMessageSource = true;
|
||||
if (codeIndex != -1) {
|
||||
// lineIndex is 1-indexed, but editor wants zero-indexed
|
||||
lineIndex = Integer.parseInt(fileAndLine.substring(colonIndex + 1));
|
||||
//System.out.println("code/line is " + codeIndex + " " + lineIndex);
|
||||
exception = new PdeException(exception.getMessage(),
|
||||
codeIndex, lineIndex - 1, -1);
|
||||
foundMessageSource = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
editor.error(exception);
|
||||
@@ -527,14 +530,13 @@ java.lang.NullPointerException
|
||||
public void run() {
|
||||
byte boofer[] = new byte[1024];
|
||||
|
||||
// read, block until something good comes through
|
||||
while (Thread.currentThread() == thread) {
|
||||
// read, block until something good comes through
|
||||
//if (input.available() > 0) {
|
||||
try {
|
||||
int count = input.read(boofer, 0, boofer.length);
|
||||
if (count == -1) break;
|
||||
if (count == -1) thread = null;
|
||||
//System.out.print("bc" + count + " " + new String(boofer, 0, count));
|
||||
|
||||
//PApplet.println(boofer);
|
||||
|
||||
} catch (IOException e) {
|
||||
thread = null;
|
||||
|
||||
@@ -952,6 +952,11 @@ public class PApplet extends Applet
|
||||
// ------------------------------------------------------------
|
||||
|
||||
|
||||
static public void print(byte what) {
|
||||
System.out.print(what);
|
||||
System.out.flush();
|
||||
}
|
||||
|
||||
static public void print(boolean what) {
|
||||
System.out.print(what);
|
||||
System.out.flush();
|
||||
@@ -989,6 +994,11 @@ public class PApplet extends Applet
|
||||
|
||||
//
|
||||
|
||||
static public void print(byte what[]) {
|
||||
for (int i = 0; i < what.length; i++) System.out.print(what[i]);
|
||||
System.out.flush();
|
||||
}
|
||||
|
||||
static public void print(boolean what[]) {
|
||||
for (int i = 0; i < what.length; i++) System.out.print(what[i]);
|
||||
System.out.flush();
|
||||
@@ -1026,6 +1036,10 @@ public class PApplet extends Applet
|
||||
|
||||
//
|
||||
|
||||
static public void println(byte what) {
|
||||
print(what); System.out.println();
|
||||
}
|
||||
|
||||
static public void println(boolean what) {
|
||||
print(what); System.out.println();
|
||||
}
|
||||
@@ -1060,6 +1074,11 @@ public class PApplet extends Applet
|
||||
|
||||
//
|
||||
|
||||
static public void println(byte what[]) {
|
||||
for (int i = 0; i < what.length; i++) System.out.println(what[i]);
|
||||
System.out.flush();
|
||||
}
|
||||
|
||||
static public void println(boolean what[]) {
|
||||
for (int i = 0; i < what.length; i++) System.out.println(what[i]);
|
||||
System.out.flush();
|
||||
|
||||
5
todo.txt
5
todo.txt
@@ -4,6 +4,11 @@ X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs
|
||||
X fixed one bug in PdeRuntime error message stuff
|
||||
X was this the big one? a big one?
|
||||
|
||||
040715 late
|
||||
X threading issues resolved
|
||||
X fixed bug with errors not coming through
|
||||
X fixed bug with errors not being recognized amonst exceptions
|
||||
|
||||
_ moving p5 prefs on mac into documents? or inside sketchbook?
|
||||
_ Documents -> Processing -> preferences.txt
|
||||
_ do the same for windows, with sketchbook as a subfolder
|
||||
|
||||
Reference in New Issue
Block a user