* Patch: FYI: add another newInstance test
@ 2006-02-28 18:31 Tom Tromey
2006-03-02 9:04 ` Christian Thalinger
0 siblings, 1 reply; 2+ messages in thread
From: Tom Tromey @ 2006-02-28 18:31 UTC (permalink / raw)
To: Mauve Patch List; +Cc: Christian Thalinger
Twisti said on irc that the xalan problem is caused by something in
newInstance.
I added a quick test case for this ... but the test already passes on
jamvm, gij, and the JDK.
So perhaps I'm misunderstanding what the bug is actually supposed to
be. Twisti, any comments?
Tom
2006-02-28 Tom Tromey <tromey@redhat.com>
* gnu/testlet/java/lang/Class/newInstance.java (test6): New class.
(test): Updated comment. Run test6 test.
Index: gnu/testlet/java/lang/Class/newInstance.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/java/lang/Class/newInstance.java,v
retrieving revision 1.5
diff -u -r1.5 newInstance.java
--- gnu/testlet/java/lang/Class/newInstance.java 22 Dec 2005 12:46:02 -0000 1.5
+++ gnu/testlet/java/lang/Class/newInstance.java 28 Feb 2006 18:27:45 -0000
@@ -23,6 +23,8 @@
package gnu.testlet.java.lang.Class;
+import java.io.IOException;
+
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
@@ -135,6 +137,29 @@
}
}
+ public static class test6
+ {
+ public test6() throws IOException
+ {
+ throw new IOException("hi bob");
+ }
+
+ static void check(TestHarness harness)
+ {
+ boolean ok = false;
+ try
+ {
+ test6.class.newInstance();
+ }
+ catch (Throwable t)
+ {
+ harness.debug(t);
+ ok = t instanceof IOException;
+ }
+ harness.check(ok);
+ }
+ }
+
public void test(TestHarness harness)
{
test1.check(harness);
@@ -150,9 +175,11 @@
// Just see to it that the following is legal.
new test5();
// If new test5() is legal, why should test5.class.newInstance()
- // throw IllegalAccessException? But the runtime access control
- // is somewhat different from the compile time access control.
- // So it may be OK that Sun's JDK throws IllegalAccessException here.
+ // throw IllegalAccessException? The reason that it is different is
+ // that 'new test5()' will call a compiler-generated accessor
+ // constructor. This accessor has package-private access and an
+ // extra argument (to differentiate it from the user-written
+ // constructor).
checkFail(harness, test5.class);
checkSuccess(harness, test1.inner.class);
@@ -169,6 +196,8 @@
harness.debug(x);
harness.fail("test configuration failure");
}
+
+ test6.check(harness);
}
static void checkSuccess(TestHarness harness, Class c)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Patch: FYI: add another newInstance test
2006-02-28 18:31 Patch: FYI: add another newInstance test Tom Tromey
@ 2006-03-02 9:04 ` Christian Thalinger
0 siblings, 0 replies; 2+ messages in thread
From: Christian Thalinger @ 2006-03-02 9:04 UTC (permalink / raw)
To: tromey; +Cc: Mauve Patch List
On Tue, 2006-02-28 at 11:26 -0700, Tom Tromey wrote:
> I added a quick test case for this ... but the test already passes on
> jamvm, gij, and the JDK.
>
> So perhaps I'm misunderstanding what the bug is actually supposed to
> be. Twisti, any comments?
The bug is/was actually in ResourceBundle.tryBundle. We didn't catch
enough exceptions. Jeroen's patch fixed it and xalan does work now.
Probably we should add an according ResourceBundle test to mauve.
TWISTI
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-03-02 9:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-28 18:31 Patch: FYI: add another newInstance test Tom Tromey
2006-03-02 9:04 ` Christian Thalinger
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).