src/share/classes/javax/print/attribute/HashAttributeSet.java
Print this page
*** 46,62 ****
* The interface of which all members of this attribute set must be an
* instance. It is assumed to be interface {@link Attribute Attribute}
* or a subinterface thereof.
* @serial
*/
! private Class myInterface;
/*
* A HashMap used by the implementation.
* The serialised form doesn't include this instance variable.
*/
! private transient HashMap attrMap = new HashMap();
/**
* Write the instance to a stream (ie serialize the object)
*
* @serialData
--- 46,62 ----
* The interface of which all members of this attribute set must be an
* instance. It is assumed to be interface {@link Attribute Attribute}
* or a subinterface thereof.
* @serial
*/
! private Class<?> myInterface;
/*
* A HashMap used by the implementation.
* The serialised form doesn't include this instance variable.
*/
! private transient HashMap<Class<?>, Attribute> attrMap = new HashMap<>();
/**
* Write the instance to a stream (ie serialize the object)
*
* @serialData
*** 80,90 ****
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException {
s.defaultReadObject();
! attrMap = new HashMap();
int count = s.readInt();
Attribute attr;
for (int i = 0; i < count; i++) {
attr = (Attribute)s.readObject();
add(attr);
--- 80,90 ----
*/
private void readObject(ObjectInputStream s)
throws ClassNotFoundException, IOException {
s.defaultReadObject();
! attrMap = new HashMap<>();
int count = s.readInt();
Attribute attr;
for (int i = 0; i < count; i++) {
attr = (Attribute)s.readObject();
add(attr);
*** 272,283 ****
* (unchecked exception) Thrown if the <CODE>category</CODE> is not a
* {@link java.lang.Class Class} that implements interface {@link
* Attribute Attribute}.
*/
public Attribute get(Class<?> category) {
! return (Attribute)
! attrMap.get(AttributeSetUtilities.
verifyAttributeCategory(category,
Attribute.class));
}
/**
--- 272,282 ----
* (unchecked exception) Thrown if the <CODE>category</CODE> is not a
* {@link java.lang.Class Class} that implements interface {@link
* Attribute Attribute}.
*/
public Attribute get(Class<?> category) {
! return attrMap.get(AttributeSetUtilities.
verifyAttributeCategory(category,
Attribute.class));
}
/**