This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: do not throw UnsupportedOperationException from deprecated Thread methods
- From: Thomas Fitzsimmons <fitzsim at redhat dot com>
- To: java-patches at gcc dot gnu dot org
- Date: Sun, 28 May 2006 21:55:13 -0400
- Subject: Patch: do not throw UnsupportedOperationException from deprecated Thread methods
Hi,
Some old applets still call these methods and fail with
UnsupportedOperationExceptions. This patch makes these deprecated methods
simply return.
OK to commit?
Tom
2006-05-28 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/lang/natThread.cc (countStackFrames): Do not throw
UnsupportedOperationException.
(resume): Likewise.
(stop): Likewise.
(suspend): Likewise.
Index: java/lang/natThread.cc
===================================================================
--- java/lang/natThread.cc (revision 114136)
+++ java/lang/natThread.cc (working copy)
@@ -20,7 +20,6 @@
#include <java/lang/Thread.h>
#include <java/lang/ThreadGroup.h>
#include <java/lang/IllegalArgumentException.h>
-#include <java/lang/UnsupportedOperationException.h>
#include <java/lang/IllegalThreadStateException.h>
#include <java/lang/InterruptedException.h>
#include <java/lang/NullPointerException.h>
@@ -91,8 +90,6 @@
java::lang::Thread::countStackFrames (void)
{
// NOTE: This is deprecated in JDK 1.2.
- throw new UnsupportedOperationException
- (JvNewStringLatin1 ("Thread.countStackFrames unimplemented"));
return 0;
}
@@ -150,8 +147,6 @@
java::lang::Thread::resume (void)
{
checkAccess ();
- throw new UnsupportedOperationException
- (JvNewStringLatin1 ("Thread.resume unimplemented"));
}
void
@@ -335,16 +330,12 @@
java::lang::Thread::stop (java::lang::Throwable *)
{
checkAccess ();
- throw new UnsupportedOperationException
- (JvNewStringLatin1 ("Thread.stop unimplemented"));
}
void
java::lang::Thread::suspend (void)
{
checkAccess ();
- throw new UnsupportedOperationException
- (JvNewStringLatin1 ("Thread.suspend unimplemented"));
}
static int nextThreadNumber = 0;