From 522e2ebc9f60801cd09f30cae3f4f2f8c2eae372 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 21 Jul 2008 14:41:29 -0600 Subject: [PATCH 1/4] fix bug in debug helper function --- src/machine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine.cpp b/src/machine.cpp index 1e6556e3f5..eaeea44830 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -52,8 +52,8 @@ Thread** fill(Thread* t, Thread* o, Thread** array) { if (t != o) *(array++) = t; - if (t->peer) fill(t->peer, o, array); - if (t->child) fill(t->child, o, array); + if (t->peer) array = fill(t->peer, o, array); + if (t->child) array = fill(t->child, o, array); return array; } From 5b94b17ea227aca09c740c123328d9104ac1aa41 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 21 Jul 2008 15:35:14 -0600 Subject: [PATCH 2/4] clean up exception handling in java-nio.cpp --- classpath/java-nio.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/classpath/java-nio.cpp b/classpath/java-nio.cpp index 08b391bc6b..0ae031606b 100644 --- a/classpath/java-nio.cpp +++ b/classpath/java-nio.cpp @@ -95,8 +95,7 @@ init(JNIEnv* e, sockaddr_in* address, jstring hostString, jint port) hostent* host = gethostbyname(chars); e->ReleaseStringUTFChars(hostString, chars); if (host == 0) { - // herror("init: gethostbyname"); - throwIOException(e); + throwIOException(e, hstrerror(h_errno)); return; } memset(address, 0, sizeof(sockaddr_in)); @@ -236,7 +235,10 @@ makeSocket(JNIEnv* e, bool blocking = false) #endif int s = ::socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); - if (s < 0) { throwIOException(e); return s; } + if (s < 0) { + throwIOException(e); + return s; + } if (not blocking) makeNonblocking(e, s); @@ -260,9 +262,11 @@ Java_java_nio_channels_ServerSocketChannel_natDoListen(JNIEnv *e, { int s = makeSocket(e); if (s < 0) return s; + if (e->ExceptionOccurred()) return 0; sockaddr_in address; init(e, &address, host, port); + if (e->ExceptionOccurred()) return 0; ::doListen(e, s, &address); return s; @@ -276,9 +280,11 @@ Java_java_nio_channels_SocketChannel_natDoConnect(JNIEnv *e, jbooleanArray retVal) { int s = makeSocket(e); - + if (e->ExceptionOccurred()) return 0; + sockaddr_in address; init(e, &address, host, port); + if (e->ExceptionOccurred()) return 0; jboolean connected = ::doConnect(e, s, &address); e->SetBooleanArrayRegion(retVal, 0, 1, &connected); From b59422fa9455e2e9e73345085f24721ac9388fee Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Mon, 21 Jul 2008 15:29:02 -0600 Subject: [PATCH 3/4] fix windows build, where hstrerror is not available --- classpath/java-nio.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classpath/java-nio.cpp b/classpath/java-nio.cpp index 0ae031606b..e82f34f0dd 100644 --- a/classpath/java-nio.cpp +++ b/classpath/java-nio.cpp @@ -95,7 +95,11 @@ init(JNIEnv* e, sockaddr_in* address, jstring hostString, jint port) hostent* host = gethostbyname(chars); e->ReleaseStringUTFChars(hostString, chars); if (host == 0) { +#ifdef WIN32 + throwIOException(e); +#else throwIOException(e, hstrerror(h_errno)); +#endif return; } memset(address, 0, sizeof(sockaddr_in)); From 0bd29069f4c01dbeb6b994cb1147e04e50f849b6 Mon Sep 17 00:00:00 2001 From: Matt Weaver Date: Tue, 22 Jul 2008 11:33:55 -0600 Subject: [PATCH 4/4] Added override, soley for documentation purposes (mark methods overriding parent) --- classpath/java/lang/Override.java | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 classpath/java/lang/Override.java diff --git a/classpath/java/lang/Override.java b/classpath/java/lang/Override.java new file mode 100644 index 0000000000..ce25b9559a --- /dev/null +++ b/classpath/java/lang/Override.java @@ -0,0 +1,5 @@ +package java.lang; + +public @interface Override { + +}