This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
FYI: Patch: javax.print.attribute
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 20 Apr 2004 12:49:31 +0200
- Subject: FYI: Patch: javax.print.attribute
Hi list,
I just commited the attached patch to merge some fixes done in GNU
classpath to javax.print.attribute.
Michael
2004-04-20 Michael Koch <konqueror@gmx.de>
* javax/print/attribute/EnumSyntax.java
(getOffset): Made protected.
* javax/print/attribute/HashAttributeSet.java
(HashAttributeSet): Likewise.
* javax/print/attribute/ResolutionSyntax.java
(getFeedResolution): Fixed typo in exception name.
(getCrossFeedResolution): Likewise.
* javax/print/attribute/SetOfIntegerSyntax.java
(SetOfIntegerSyntax): Fixed HTML entities in javadoc.
* javax/print/attribute/TextSyntax.java
(TextSyntax): Handle locale correctly.
(hashCode): Calc better hashcode value.
(equals): Fixed @return tag.
(toString): New method.
Index: javax/print/attribute/EnumSyntax.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/print/attribute/EnumSyntax.java,v
retrieving revision 1.2
diff -u -r1.2 EnumSyntax.java
--- javax/print/attribute/EnumSyntax.java 10 Jan 2004 22:16:01 -0000 1.2
+++ javax/print/attribute/EnumSyntax.java 20 Apr 2004 10:48:36 -0000
@@ -139,7 +139,7 @@
return null;
}
- public int getOffset()
+ protected int getOffset()
{
return 0;
}
Index: javax/print/attribute/HashAttributeSet.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/print/attribute/HashAttributeSet.java,v
retrieving revision 1.2
diff -u -r1.2 HashAttributeSet.java
--- javax/print/attribute/HashAttributeSet.java 23 Dec 2003 10:21:31 -0000 1.2
+++ javax/print/attribute/HashAttributeSet.java 20 Apr 2004 10:48:36 -0000
@@ -151,7 +151,7 @@
* @exception ClassCastException if any element of attributes is not an
* interface of interfaceName
*/
- public HashAttributeSet(AttributeSet attributes, Class interfaceName)
+ protected HashAttributeSet(AttributeSet attributes, Class interfaceName)
{
this(interfaceName);
Index: javax/print/attribute/ResolutionSyntax.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/print/attribute/ResolutionSyntax.java,v
retrieving revision 1.2
diff -u -r1.2 ResolutionSyntax.java
--- javax/print/attribute/ResolutionSyntax.java 27 Dec 2003 14:21:07 -0000 1.2
+++ javax/print/attribute/ResolutionSyntax.java 20 Apr 2004 10:48:36 -0000
@@ -104,7 +104,7 @@
*
* @return the resolution
*
- * @exception IllegalArgumenException if units < 1
+ * @exception IllegalArgumentException if units < 1
*/
public int getCrossFeedResolution(int units)
{
@@ -130,7 +130,7 @@
*
* @return the resolution
*
- * @exception IllegalArgumenException if units < 1
+ * @exception IllegalArgumentException if units < 1
*/
public int getFeedResolution(int units)
{
Index: javax/print/attribute/SetOfIntegerSyntax.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/print/attribute/SetOfIntegerSyntax.java,v
retrieving revision 1.2
diff -u -r1.2 SetOfIntegerSyntax.java
--- javax/print/attribute/SetOfIntegerSyntax.java 27 Dec 2003 14:21:07 -0000 1.2
+++ javax/print/attribute/SetOfIntegerSyntax.java 20 Apr 2004 10:48:36 -0000
@@ -148,8 +148,8 @@
* @param lowerBound the lower bound value
* @param upperBound the upper bound value
*
- * @exception IllegalArgumentException if lowerBound <= uppbound
- * and lowerBound < 0
+ * @exception IllegalArgumentException if lowerBound <= upperbound
+ * and lowerBound < 0
*/
protected SetOfIntegerSyntax(int lowerBound, int upperBound)
{
Index: javax/print/attribute/TextSyntax.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/print/attribute/TextSyntax.java,v
retrieving revision 1.1
diff -u -r1.1 TextSyntax.java
--- javax/print/attribute/TextSyntax.java 21 Dec 2003 11:10:54 -0000 1.1
+++ javax/print/attribute/TextSyntax.java 20 Apr 2004 10:48:36 -0000
@@ -1,5 +1,5 @@
/* TextSyntax.java --
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -57,12 +57,12 @@
* @param value the value for this syntax
* @param locale the locale to use
*
- * @exception NullPointerException if value is null
+ * @exception NullPointerException if value and/or locale is null
*/
protected TextSyntax(String value, Locale locale)
{
- if (value == null)
- throw new NullPointerException("value may not be null");
+ if (value == null || locale == null)
+ throw new NullPointerException("value and/or locale may not be null");
this.value = value;
this.locale = locale;
@@ -95,7 +95,7 @@
*/
public int hashCode()
{
- return value.hashCode() + locale.hashCode();
+ return value.hashCode() ^ locale.hashCode();
}
/**
@@ -103,7 +103,7 @@
*
* @param obj the object to test
*
- * @returns true if both objects are equal, false otherwise.
+ * @return true if both objects are equal, false otherwise.
*/
public boolean equals(Object obj)
{
@@ -114,5 +114,13 @@
return (value.equals(tmp.getValue())
&& locale.equals(tmp.getLocale()));
+ }
+
+ /**
+ * Returns a string representing the object.
+ */
+ public String toString()
+ {
+ return value;
}
}