Actions
Bug #3382
closedCannot compile convertUntyped: com.saxonica.ee.bytecode.ByteCodeCandidate cannot be cast to net.sf.saxon.expr.AtomicSequenceConverter
Start date:
2017-08-10
Due date:
% Done:
100%
Estimated time:
Legacy ID:
Applies to branch:
9.8
Fix Committed on Branch:
9.8
Fixed in Maintenance Release:
Platforms:
Description
Reported by a user. See exception below. Shows up when we have -repeat:10, therefore it is clear that the counters used in ByteCodeCandidate are not being reset between run executions.
Replicate bug by running the following:
java -jar saxon9ee.jar -repeat:10 -xsl:https://raw.githubusercontent.com/RackerWilliams/api-checker/saxon_upgrade/core/src/main/resources/xsl/builder.xsl test.wadl
Exception throw:
Cannot compile convertUntyped: com.saxonica.ee.bytecode.ByteCodeCandidate cannot be cast to net.sf.saxon.expr.AtomicSequenceConverter
java.lang.ClassCastException: com.saxonica.ee.bytecode.ByteCodeCandidate cannot be cast to net.sf.saxon.expr.AtomicSequenceConverter
at com.saxonica.ee.bytecode.AtomicSequenceConverterCompiler.compileToPrimitive(AtomicSequenceConverterCompiler.java:75)
at com.saxonica.ee.bytecode.util.CompilerService.compileToPrimitive(CompilerService.java:905)
at com.saxonica.ee.bytecode.ConcatCompiler.compileToPrimitive(ConcatCompiler.java:44)
at com.saxonica.ee.bytecode.util.CompilerService.compileToPrimitive(CompilerService.java:905)
at com.saxonica.ee.bytecode.converter.StringToUntypedAtomicCompiler.compileToPrimitive(StringToUntypedAtomicCompiler.java:62)
at com.saxonica.ee.bytecode.converter.StringToUntypedAtomicCompiler.compileToItem(StringToUntypedAtomicCompiler.java:52)
at com.saxonica.ee.bytecode.CastExpressionCompiler.compileToItem(CastExpressionCompiler.java:36)
at com.saxonica.ee.bytecode.ToItemCompiler.compileToIterator(ToItemCompiler.java:26)
at com.saxonica.ee.bytecode.util.CompilerService.compileToIterator(CompilerService.java:796)
at com.saxonica.ee.bytecode.AtomicSequenceConverterCompiler.compileToIterator(AtomicSequenceConverterCompiler.java:200)
at com.saxonica.ee.bytecode.util.CompilerService.compileToIterator(CompilerService.java:796)
at com.saxonica.ee.bytecode.util.CompilerService.compileToByteCode(CompilerService.java:575)
at com.saxonica.ee.optim.OptimizerEE.compileToByteCode(OptimizerEE.java:1477)
at com.saxonica.ee.bytecode.ByteCodeCandidate.targetExpression(ByteCodeCandidate.java:187)
at com.saxonica.ee.bytecode.ByteCodeCandidate.iterate(ByteCodeCandidate.java:255)
at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:338)
at net.sf.saxon.expr.instruct.UserFunction.call(UserFunction.java:609)
at net.sf.saxon.expr.UserFunctionCall.callFunction(UserFunctionCall.java:554)
at net.sf.saxon.expr.UserFunctionCall.evaluateItem(UserFunctionCall.java:479)
at net.sf.saxon.expr.Expression.evaluateAsString(Expression.java:882)
at net.sf.saxon.expr.instruct.SimpleNodeConstructor.processLeavingTail(SimpleNodeConstructor.java:218)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:284)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:699)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
at com.saxonica.ee.bytecode.ByteCodeCandidate.process(ByteCodeCandidate.java:133)
at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:264)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:353)
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:411)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:880)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:880)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:880)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:699)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:347)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:502)
at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:66)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:478)
at net.sf.saxon.expr.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:553)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:432)
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:699)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:347)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:502)
at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:66)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:478)
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:284)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:151)
at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:302)
at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:50)
at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:326)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:509)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:690)
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:347)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:502)
at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:66)
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:478)
at net.sf.saxon.Controller.transformDocument(Controller.java:2396)
at net.sf.saxon.Controller.transform(Controller.java:1964)
at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:592)
at net.sf.saxon.Transform.processFile(Transform.java:1245)
at net.sf.saxon.Transform.doTransform(Transform.java:780)
Updated by O'Neil Delpratt over 6 years ago
- Status changed from New to Resolved
- Assignee set to O'Neil Delpratt
- % Done changed from 0 to 100
- Fix Committed on Branch 9.8 added
Methods such as CompilerService.compileToItem() and CompilerService.compileToIterator() check that if the expression supplied is a ByteCodeCandidate, they actually compile its operand expression.
The problem is we are failing to do this in two similar methods. Fix made in the methods compileToPrimitive and compileToLoop of the class CompilerService.
Updated by O'Neil Delpratt over 6 years ago
- Status changed from Resolved to Closed
- Fixed in Maintenance Release 9.8.0.4 added
Bug fix applied in the Saxon 9.8.0.4 maintenance release.
Please register to edit this issue
Actions