Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2076908 | 1.3.0 | Kohsuke Kawaguchi | P3 | Closed | Fixed | 1.3 |
Name: inR10064 Date: 11/07/2003
The method
javax.xml.parsers.DocumentBuilder.getSecureProcessing()
returns null while the DocumentBuilderFactory is set with SecureProcessing
object and the SecureProcessingState is set to true (see the code sample below).
The SecureProcessing object set for the Factory is expected to be returned.
Note that null is returned also in cases when
setSecureProcessingState(false)
is invoked for the DocumentBuilderFactory and when SecureProcessingState isn't set.
The bug affects new tests in JCK 1.5 (not yet integrated):
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing004]
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing005]
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing006]
The bug found in the JDK 1.5.0-beta-b26.
--------------------------------------------------------------------------
package tests;
import javax.xml.SecureProcessing;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
public class GetSecureProcessing005 {
public static void main(String argv[]) {
DocumentBuilderFactory docBFactory = DocumentBuilderFactory.newInstance();
// no SecureProcessing Object set for DocumentBuilderFactory by default
SecureProcessing securePr = new SecureProcessing();
docBFactory.setSecureProcessing(securePr);
docBFactory.setSecureProcessingState(true);
DocumentBuilder docBuilder = null;
try {
docBuilder = docBFactory.newDocumentBuilder();
} catch (ParserConfigurationException pce) {
System.out.println(pce.toString());
return;
}
SecureProcessing getSP = docBuilder.getSecureProcessing();
if (getSP != securePr) {
System.out.println("Returns "+ getSP +" instead of "+ securePr);
} else {
System.out.println("OK");
}
}
}
--------------------------------------------------------------------------
% java -showversion tests.GetSecureProcessing005
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b26)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b26, mixed mode)
Returns null instead of javax.xml.SecureProcessing@10ef90c
--------------------------------------------------------------------------
======================================================================
The method
javax.xml.parsers.DocumentBuilder.getSecureProcessing()
returns null while the DocumentBuilderFactory is set with SecureProcessing
object and the SecureProcessingState is set to true (see the code sample below).
The SecureProcessing object set for the Factory is expected to be returned.
Note that null is returned also in cases when
setSecureProcessingState(false)
is invoked for the DocumentBuilderFactory and when SecureProcessingState isn't set.
The bug affects new tests in JCK 1.5 (not yet integrated):
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing004]
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing005]
api/javax_xml/parsers/DocumentBuilder/index.html#SecureProcessing[GetSecureProcessing006]
The bug found in the JDK 1.5.0-beta-b26.
--------------------------------------------------------------------------
package tests;
import javax.xml.SecureProcessing;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
public class GetSecureProcessing005 {
public static void main(String argv[]) {
DocumentBuilderFactory docBFactory = DocumentBuilderFactory.newInstance();
// no SecureProcessing Object set for DocumentBuilderFactory by default
SecureProcessing securePr = new SecureProcessing();
docBFactory.setSecureProcessing(securePr);
docBFactory.setSecureProcessingState(true);
DocumentBuilder docBuilder = null;
try {
docBuilder = docBFactory.newDocumentBuilder();
} catch (ParserConfigurationException pce) {
System.out.println(pce.toString());
return;
}
SecureProcessing getSP = docBuilder.getSecureProcessing();
if (getSP != securePr) {
System.out.println("Returns "+ getSP +" instead of "+ securePr);
} else {
System.out.println("OK");
}
}
}
--------------------------------------------------------------------------
% java -showversion tests.GetSecureProcessing005
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b26)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b26, mixed mode)
Returns null instead of javax.xml.SecureProcessing@10ef90c
--------------------------------------------------------------------------
======================================================================
- backported by
-
JDK-2076908 DocumentBuilder.getSecureProcessing() returns null instead of reference
-
- Closed
-