public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [RFA/JDWP] VMVirtualMachine StringBuffer cleanup
@ 2006-11-08 19:00 Keith Seitz
  2006-11-08 19:08 ` Andrew Haley
  2007-01-12  1:43 ` Keith Seitz
  0 siblings, 2 replies; 9+ messages in thread
From: Keith Seitz @ 2006-11-08 19:00 UTC (permalink / raw)
  To: Java Patch List

[-- Attachment #1: Type: text/plain, Size: 566 bytes --]

Hi,

I've been meaning to cleanup a lot of the gnu/classpath/jdwp/nat*.cc 
files, and this is one of the things that made it onto my pet peeve list 
recently. The attached patch switches to the 
gnu.gcj.runtime.StringBuffer instead of the java.lang one.

I've got some other little cleanups that I'll submit after this.

Keith

ChangeLog
2006-11-08  Keith Seitz  <keiths@redhat.com>

         * gnu/classpath/jdwp/natVMVirtualMachine.cc (suspendThread): Use
         gnu.gcj.runtime.StringBuffer instead of java.lang.StringBuffer.
         (resumeThread): Likewise.

[-- Attachment #2: vmvirtualmachine-stringbuffer.patch --]
[-- Type: text/x-patch, Size: 2284 bytes --]

Index: gnu/classpath/jdwp/natVMVirtualMachine.cc
===================================================================
--- gnu/classpath/jdwp/natVMVirtualMachine.cc	(revision 118009)
+++ gnu/classpath/jdwp/natVMVirtualMachine.cc	(working copy)
@@ -17,7 +17,6 @@
 #include <java/lang/ClassLoader.h>
 #include <java/lang/Integer.h>
 #include <java/lang/String.h>
-#include <java/lang/StringBuffer.h>
 #include <java/lang/Thread.h>
 #include <java/nio/ByteBuffer.h>
 #include <java/util/ArrayList.h>
@@ -30,6 +29,7 @@
 #include <gnu/classpath/jdwp/event/EventRequest.h>
 #include <gnu/classpath/jdwp/exception/JdwpInternalErrorException.h>
 #include <gnu/classpath/jdwp/util/MethodResult.h>
+#include <gnu/gcj/runtime/StringBuffer.h>
 
 using namespace java::lang;
 using namespace gnu::classpath::jdwp::event;
@@ -75,13 +75,12 @@
       jvmtiError err = _jdwp_jvmtiEnv->SuspendThread (thread);
       if (err != JVMTI_ERROR_NONE)
 	{
+	  using namespace gnu::gcj::runtime;
 	  using namespace gnu::classpath::jdwp::exception;
 	  char *reason;
 	  _jdwp_jvmtiEnv->GetErrorName (err, &reason);
-	  ::java::lang::String *txt
-	      = JvNewStringLatin1 ("could not suspend thread: ");
-	  ::java::lang::StringBuffer *msg
-	      = new ::java::lang::StringBuffer (txt);
+	  String *txt = JvNewStringLatin1 ("could not suspend thread: ");
+	  StringBuffer *msg = new StringBuffer (txt);
 	  msg->append (JvNewStringLatin1 (reason));
 	  _jdwp_jvmtiEnv->Deallocate ((unsigned char *) reason);
 	  throw new JdwpInternalErrorException (msg->toString ());
@@ -126,13 +125,12 @@
       jvmtiError err = _jdwp_jvmtiEnv->ResumeThread (thread);
       if (err != JVMTI_ERROR_NONE)
 	{
+	  using namespace gnu::gcj::runtime;
 	  using namespace gnu::classpath::jdwp::exception;
 	  char *reason;
 	  _jdwp_jvmtiEnv->GetErrorName (err, &reason);
-	  ::java::lang::String *txt 
-	      = JvNewStringLatin1 ("could not resume thread: ");
-	  ::java::lang::StringBuffer *msg
-	      = new ::java::lang::StringBuffer (txt);
+	  String *txt = JvNewStringLatin1 ("could not resume thread: ");
+	  StringBuffer *msg = new StringBuffer (txt);
 	  msg->append (JvNewStringLatin1 (reason));
 	  _jdwp_jvmtiEnv->Deallocate ((unsigned char *) reason);
 	  throw new JdwpInternalErrorException (msg->toString ());

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-01-16  1:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-08 19:00 [RFA/JDWP] VMVirtualMachine StringBuffer cleanup Keith Seitz
2006-11-08 19:08 ` Andrew Haley
2007-01-12  1:43 ` Keith Seitz
2007-01-12 12:18   ` Andrew Haley
2007-01-15 19:36     ` Andrew Haley
2007-01-15 19:46       ` Keith Seitz
2007-01-15 19:51         ` Andrew Haley
2007-01-15 23:39     ` Keith Seitz
2007-01-16  1:33       ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).