public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mario Torre <mario.torre@aicas.com>
To: mauve-patches@sources.redhat.com
Subject: FYI: Update test to follow 1.6 specification behaviour.
Date: Fri, 24 Jul 2009 12:31:00 -0000	[thread overview]
Message-ID: <4A69A990.2010609@aicas.com> (raw)

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

A bit of explantion:

The test expects an ArrayIndexOutOfBoundsException where a 
RuntimeException should be thrown.  This is a bug in JDK up to 1.5: 
while assembling the RuntimeException, the 
ArrayIndexOutOfBoundsException is raised.  This is fixed in JDK 1.6.

See also http://bugs.sun.com/view_bug.do?bug_id=4511992 and 
http://bugs.sun.com/view_bug.do?bug_id=6204552.

2009-07-09  Mario Torre  <neugens@aicas.com>

     * gnu/testlet/java/beans/EventHandler/check14c.java:
     Update test to follow 1.6 specification behaviour.

-- 
Mario Torre, Software Developer, http://www.jroller.com/neugens/
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-44
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

USt-Id: DE216375633, Handelsregister HRB 109481, AG Mannheim
Geschäftsführer: Dr. James J. Hunt

Please, support open standards:
http://endsoftpatents.org/


[-- Attachment #2: 2009-07-24-beans-event-handler-1.6.patch --]
[-- Type: text/x-patch, Size: 2187 bytes --]

# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: mauve/gnu/testlet/java/beans/EventHandler/check14c.java
--- mauve/gnu/testlet/java/beans/EventHandler/check14c.java Base (1.3)
+++ mauve/gnu/testlet/java/beans/EventHandler/check14c.java Locally Modified (Based On 1.3)
@@ -81,11 +81,10 @@
 
 	public void test(TestHarness harness) {
 
-		// The first test checks whether a ArrayIndexOutOfBoundsException is
-		// thrown
+		// The first test checks whether a RuntimeException is thrown
 		// when the targetMethod cannot be found (Especially because of missing
-		// access
-		// rights).
+		// access rights).
+                // JDK 1.4 and 1.5 erroneously throw an ArrayIndexOutOfBoundsException.
 		Listener l = (Listener) EventHandler.create(Listener.class, this,
 				"targetMethod");
 
@@ -93,7 +92,7 @@
 		try {
 			l.listen();
 		} catch (Exception e) {
-			correctException = e.getClass() == ArrayIndexOutOfBoundsException.class;
+			correctException = e.getClass() == RuntimeException.class;
 		}
 		harness.check(correctException, true, "missing target method");
 
@@ -146,10 +145,11 @@
 		// One may think that a creation like this will forward the Event
 		// instance to the 'setEventProperty'
 		// method but this is wrong and will cause a
-		// ArrayIndexOutOfBoundsException to be as if could not
+		// RuntimeException to be as if could not
 		// find a method. In other words: If no property is defined action will
 		// never be treated as a
 		// property but always like a method name.
+                // JDK 1.4 and 1.5 erroneously throw an ArrayIndexOutOfBoundsException.
 		l2 = (Listener2) EventHandler.create(Listener2.class, this,
 				"eventProperty");
 
@@ -157,7 +157,7 @@
 		try {
 			l2.listen(new Event());
 		} catch (Exception e) {
-			correctException = e.getClass() == ArrayIndexOutOfBoundsException.class;
+			correctException = e.getClass() == RuntimeException.class;
 		}
 		harness.check(correctException, true, "action is method");
 

                 reply	other threads:[~2009-07-24 12:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A69A990.2010609@aicas.com \
    --to=mario.torre@aicas.com \
    --cc=mauve-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).