JDK-8373617 : [jaxp] TransformerTest fails due to InstructionComparator gap
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 27
  • Priority: P4
  • Status: New
  • Resolution: Unresolved
  • Submitted: 2025-12-12
  • Updated: 2025-12-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Causes :  
Description
An experimental change to HashMap exposed a deficiency in the transform InstructionComparator .equals method.
The change in HashMap was to remove the `==` test of a key with an entry, relying on the .equals method of InstructionComparator to return true when comparing an Instruction to itself.
However, InstructionComparator.equals method does not satisfy the requirements of the contract for .equals.

The BCEL-195 issue has some discussion of the rationale, however, they missed the important case needed by HashMap that an instance must be .equal to itself. To be used with HashMap all instructions must be equal to themselves.

The test failure as seen is:

11:20:15.784] test transform.TransformerTest$Test8169112.run(): failure [98ms]
javax.xml.transform.TransformerConfigurationException: Not targeting 66542: nop[0](1), but null
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:1067)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:824)
	at transform.util.TransformerTestTemplate.getTransformer(TransformerTestTemplate.java:135)
	at transform.util.TransformerTestTemplate.getTransformer(TransformerTestTemplate.java:121)
	at transform.TransformerTest$Test8169112.run(TransformerTest.java:584)
	at java.base/
...

Caused by: com.sun.org.apache.bcel.internal.generic.ClassGenException: Not targeting 66542: nop[0](1), but null
	at java.xml/com.sun.org.apache.bcel.internal.generic.BranchInstruction.updateTarget(BranchInstruction.java:273)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator.outline(MethodGenerator.java:1698)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator.outlineChunks(MethodGenerator.java:1145)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator.getGeneratedMethods(MethodGenerator.java:1859)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator.addMethod(ClassGenerator.java:137)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileNamedTemplate(Mode.java:539)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileTemplates(Mode.java:548)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Mode.compileApplyTemplates(Mode.java:807)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.compileModes(Stylesheet.java:622)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.Stylesheet.translate(Stylesheet.java:735)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:509)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.compiler.XSLTC.compile(XSLTC.java:579)
	at java.xml/com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:1026)
Comments
A patch with a fix and test are attached.
12-12-2025