Patch: FYI: class loader fixlet

Tom Tromey tromey@redhat.com
Tue Apr 2 14:16:00 GMT 2002


I'm checking this in to the trunk and the branch.
We were trying to load a library named `lib'.  There's really no point
in doing this, and it just slows things down a bit.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* java/lang/natClassLoader.cc (findClass): Compare against `3',
	not `0'.

Index: java/lang/natClassLoader.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natClassLoader.cc,v
retrieving revision 1.47
diff -u -r1.47 natClassLoader.cc
--- java/lang/natClassLoader.cc 2001/12/21 21:59:27 1.47
+++ java/lang/natClassLoader.cc 2002/04/02 22:15:09
@@ -1,6 +1,6 @@
 // natClassLoader.cc - Implementation of java.lang.ClassLoader native methods.
 
-/* Copyright (C) 1999, 2000, 2001  Free Software Foundation
+/* Copyright (C) 1999, 2000, 2001, 2002  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -203,7 +203,8 @@
       java::lang::StringBuffer *sb = new java::lang::StringBuffer (JvNewStringLatin1("lib-"));
       jstring so_base_name = (sb->append (name)->toString ())->replace ('.', '-');
 
-      while (! klass && so_base_name && so_base_name->length() > 0)
+      // Compare against `3' because that is the length of "lib".
+      while (! klass && so_base_name && so_base_name->length() > 3)
 	{
 	  using namespace ::java::lang;
 	  Runtime *rt = Runtime::getRuntime();



More information about the Java-patches mailing list