-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0
-
beta2
-
generic
-
generic
Name: dkR10031 Date: 05/15/2001
Specification of the method
javax.imageio.metadata.IIOMetadataNode.setAttributeNode says:
"public Attr setAttributeNode(Attr newAttr) throws DOMException"
However, the implementation (JDK 1.4.0beta, build b64) of the method
throws IIODOMException: Node not an IIOAttr! when a legal Attr parameter
is passed to the method. Note that the spec does not describe IIOAttr
class.
This bug affects new JCK test:
api/javax_imageio/metadata/IIOMetadataNode/index.html#setAttributeNode
To reproduce the bug run the following test:
------------ test08.java ------------------------
import javax.imageio.metadata.IIOMetadataNode;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
public class test08 {
public static void main(String argv[]) {
IIOMetadataNode elem = new IIOMetadataNode("elem");
MyAttrNode attrNode = new MyAttrNode("attr", "2001");
elem.setAttributeNode(attrNode);
attrNode.owner = elem;
System.out.println("Passed");
}
}
class MyAttrNode extends IIOMetadataNode implements Attr {
public Element owner;
private String name;
private String value;
public MyAttrNode(String name, String value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public Element getOwnerElement() {
return owner;
}
public boolean getSpecified() {
return false;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
------------ Logs -----------------------------
$ java -version
java version "1.4.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta-b64)
Java HotSpot(TM) Client VM (build 1.4.0-beta-b64, mixed mode)
$ javac test08.java
$ java test08
Exception in thread "main" javax.imageio.metadata.IIODOMException: Node not an
IIOAttr!
at
javax.imageio.metadata.IIOMetadataNode.setAttributeNode(IIOMetadataNode.java:721)
at test08.main(test08.java:12)
======================================================================
- relates to
-
JDK-4496652 IIOMetadataNode.setAttributeNode does not work as described
- Resolved
-
JDK-4507254 method IIOMetadataNode.setAttributeNode does not throw DOMException
- Closed