typetools / typetools/checker-framework
Type argument inference crashed for Stream.map (since version 3.49.2)
@smillst is already working on this.
Since May 1, 2025.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 440
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 134
Description
Since version 3.49.2 of the checker-framework I see a crash in the type argument inference for Stream.map. The full error message is
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (verify-with-checkerframework) on project dmn-check-validators: Compilation failure
[ERROR] /home/pascal/projects/dmn-check/validators/src/main/java/de/redsix/dmncheck/validators/ConflictingRuleValidator.java:[36,20] error: [type.argument.inference.crashed] Type argument inference crashed for Stream.map
[ERROR] error: An exception occurred: False bound for: Constraint: Object <: Rule Result: FALSE
The full log is available at https://github.com/red6/dmn-check/actions/runs/14772748431/job/41475512159?pr=440 and the code in question is the following
@Override
public List<ValidationResult> validate(DecisionTable decisionTable, ValidationContext validationContext) {
return decisionTable.getRules().stream()
.collect(Collectors.groupingBy(ConflictingRuleValidator::extractInputEntriesTextContent))
.values()
.stream()
.map(rules -> rules.stream()
.collect(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(
ConflictingRuleValidator::extractInputAndOutputEntriesTextContent)))))
.filter(rules -> rules.size() > 1)
.map(rules -> ValidationResult.init
.message("Rule is conflicting with rules "
+ rules.stream().skip(1).map(Rule::getId).toList())
.severity(
Arrays.asList(HitPolicy.COLLECT, HitPolicy.RULE_ORDER)
.contains(decisionTable.getHitPolicy())
? Severity.WARNING
: Severity.ERROR)
.element(rules.first())
.build())
.collect(Collectors.toList());
}
private static String extractInputAndOutputEntriesTextContent(Rule rule) {
return Stream.concat(rule.getInputEntries().stream(), rule.getOutputEntries().stream())
.map(ModelElementInstance::getTextContent)
.collect(Collectors.joining());
}
The error seems to be triggered from the first map call in method validate.
The full code is available at https://github.com/red6/dmn-check/blob/master/validators/src/main/java/de/redsix/dmncheck/validators/ConflictingRuleValidator.java.
I hope that I will be able to provide a more minimal example in the next days.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.