Bug 26103 - Wrong exception thrown
Summary: Wrong exception thrown
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libgcj (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.1.1
Assignee: Tom Tromey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-05 13:12 UTC by Michael Koch
Modified: 2006-03-07 21:41 UTC (History)
2 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2006-03-07 18:52:05


Attachments
testcase (132 bytes, text/plain)
2006-02-05 13:14 UTC, Michael Koch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Koch 2006-02-05 13:12:24 UTC
When running the attached testcase gcj 4.1 throws a StringIndexOutOfBoundsException instead of ClassNotFoundException. GNU classpath 0.20 is not affected as jamvm 1.4.2 and cacao 0.94 and kaffe 1.1.7rc1 throw the correct exception.
Comment 1 Michael Koch 2006-02-05 13:14:16 UTC
Created attachment 10781 [details]
testcase
Comment 2 Mark Wielaard 2006-02-05 14:44:32 UTC
I added a mauve test for this and some other cases. gcj fails a couple of them because it tries to handle array classes specially through loadClassFromSig().

See gnu.testlet.java.lang.ClassLoader.loadClass in Mauve.
Comment 3 Tom Tromey 2006-03-07 18:52:05 UTC
Testing a patch.
Comment 4 Tom Tromey 2006-03-07 21:34:49 UTC
Subject: Bug 26103

Author: tromey
Date: Tue Mar  7 21:34:46 2006
New Revision: 111819

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111819
Log:
	PR libgcj/26103:
	* java/lang/ClassLoader.java (loadClass): Don't throw
	StringIndexOutOfBoundsException if name is empty.
	* java/lang/natClassLoader.cc (loadClassFromSig): Throw exception
	if class not found.

Modified:
    branches/gcc-4_1-branch/libjava/ChangeLog
    branches/gcc-4_1-branch/libjava/java/lang/ClassLoader.java
    branches/gcc-4_1-branch/libjava/java/lang/natClassLoader.cc

Comment 5 Tom Tromey 2006-03-07 21:39:48 UTC
Subject: Bug 26103

Author: tromey
Date: Tue Mar  7 21:39:44 2006
New Revision: 111820

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=111820
Log:
	PR libgcj/26103:
	* java/lang/ClassLoader.java (loadClass): Don't throw
	StringIndexOutOfBoundsException if name is empty.
	* java/lang/natClassLoader.cc (loadClassFromSig): Throw exception
	if class not found.

Modified:
    trunk/libjava/ChangeLog
    trunk/libjava/java/lang/ClassLoader.java
    trunk/libjava/java/lang/natClassLoader.cc

Comment 6 Tom Tromey 2006-03-07 21:41:37 UTC
Fix checked in.