This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Fix infinite recursion in JobStateReasons.add()
- From: Andrew Haley <aph at redhat dot com>
- To: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: Fri, 30 Jul 2010 12:17:06 +0100
- Subject: Fix infinite recursion in JobStateReasons.add()
I'm doing software archaeology again.
This is an unfortunate bit of history. This bug was fixed by
2006-01-24 Wolfgang Baer <WBaer@gmx.de>
* javax/print/SimpleDoc.java: Make class final.
* javax/print/attribute/standard/PrinterIsAcceptingJobs.java: Likewise.
* javax/print/attribute/DateTimeSyntax.java:
(toString): New overridden method.
* javax/print/attribute/standard/JobStateReasons.java:
(add): Use the super.add method to avoid recursion.
* javax/print/attribute/standard/PrinterStateReasons.java:
(put): Use the super.put method to avoid recursion.
but was re-broken by the merge of generics-branch to HEAD:
diff -u -r1.6 -r1.7
--- javax/print/attribute/standard/JobStateReasons.java 24 Jan 2006 20:42:30 -0000 1.6
+++ javax/print/attribute/standard/JobStateReasons.java 10 Dec 2006 20:25:47 -0000 1.7
@@ -126,12 +126,12 @@
* @throws ClassCastException if given object is not an instance of
* <code>JobStateReason</code>.
*/
- public boolean add(Object o)
+ public boolean add(JobStateReason o)
{
if (o == null)
throw new NullPointerException("reason is null");
- return super.add((JobStateReason) o);
+ return add(o);
}
/**
Fixed thusly.
Andrew.
2010-07-30 Andrew Haley <aph@localhost.localdomain>
* javax/print/attribute/standard/JobStateReasons.java (add): Fix
infinite recursion with call to super.
Index: classpath/javax/print/attribute/standard/JobStateReasons.java
===================================================================
--- classpath/javax/print/attribute/standard/JobStateReasons.java (revision 159065)
+++ classpath/javax/print/attribute/standard/JobStateReasons.java (working copy)
@@ -129,7 +129,7 @@
if (o == null)
throw new NullPointerException("reason is null");
- return add(o);
+ return super.add(o);
}
/**