-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
1.0
-
x86
-
windows_xp
jdk 6.0.
CharacterData::substringData incorrectly throw INDEX_SIZE_ERR.
For example, the following code shouldn't throw DOMException.
"
Text text = document.createTextNode("tests");
text.substringData(5, 1); --> should be valid. but in jdk 6.0, DOMException is thrown.
"
According the spec, DOMException is throw when offset is greater than the number of 16-bit units in data.
In the above code, offset in substringData method is the same as number of 16-bit units in text node. Thus, no Exception should be thrown.
String substringData(int offset,
int count)
throws DOMException
"Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
"
CharacterData::substringData incorrectly throw INDEX_SIZE_ERR.
For example, the following code shouldn't throw DOMException.
"
Text text = document.createTextNode("tests");
text.substringData(5, 1); --> should be valid. but in jdk 6.0, DOMException is thrown.
"
According the spec, DOMException is throw when offset is greater than the number of 16-bit units in data.
In the above code, offset in substringData method is the same as number of 16-bit units in text node. Thus, no Exception should be thrown.
String substringData(int offset,
int count)
throws DOMException
"Throws:
DOMException - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
"