This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: ResourceBundle fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 21 Jan 2003 14:14:21 -0700
- Subject: Patch: FYI: ResourceBundle fix
- Reply-to: tromey at redhat dot com
I'm checking this in to the trunk and the 3.3 branch.
The classloader lookup code in ResourceBundle starts with the wrong
index and will thus miss the user's class.
Tom
2003-01-21 Tom Tromey <tromey@redhat.com>
* java/util/natResourceBundle.cc (getCallingClassLoader): Start
search at 2, not 3.
Index: java/util/natResourceBundle.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/util/natResourceBundle.cc,v
retrieving revision 1.6
diff -u -r1.6 natResourceBundle.cc
--- java/util/natResourceBundle.cc 20 Dec 2002 02:06:21 -0000 1.6
+++ java/util/natResourceBundle.cc 21 Jan 2003 21:13:54 -0000
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002 Free Software Foundation
+/* Copyright (C) 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -25,7 +25,10 @@
gnu::gcj::runtime::StackTrace *t = new gnu::gcj::runtime::StackTrace(6);
try
{
- for (int i = 3; ; ++i)
+ /* Frame 0 is this method, frame 1 is getBundle, so starting at
+ frame 2 we might see the user's class. FIXME: should account
+ for reflection, JNI, etc, here. */
+ for (int i = 2; ; ++i)
{
jclass klass = t->classAt(i);
if (klass != NULL)