Since #363 (Spoon 10.4.2 -> 11.5.0), any record in the checked code crashes verification, even without refinements:
public record Point(int x, int y) {
int sum() { return x + y; }
}
On main 9045ecd:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.io.File.getAbsolutePath()" because the return value of "spoon.reflect.cu.SourcePosition.getFile()" is null
at liquidjava.processor.refinement_checker.TypeChecker.scan(TypeChecker.java:74)
at spoon.reflect.visitor.CtScanner.visitCtRecord(CtScanner.java:1065)
On be47cb6 (before the upgrade) it passes.
Cause: Spoon 11 dispatches records to visitCtRecord, not visitCtClass. ExternalRefinementTypeChecker skips classes (visitCtClass is empty) but not records, so it visits the record's methods with no external target (prefix is null): TypeFactory.createReference(null) throws. Reporting that error then fails too, because the record's implicit members have no source file, so TypeChecker.scan throws the NPE above instead of the real error.
Found re-checking our bank of real-bug examples on the new main (one of them is a record).
Since #363 (Spoon 10.4.2 -> 11.5.0), any
recordin the checked code crashes verification, even without refinements:On main 9045ecd:
On be47cb6 (before the upgrade) it passes.
Cause: Spoon 11 dispatches records to
visitCtRecord, notvisitCtClass.ExternalRefinementTypeCheckerskips classes (visitCtClassis empty) but not records, so it visits the record's methods with no external target (prefixis null):TypeFactory.createReference(null)throws. Reporting that error then fails too, because the record's implicit members have no source file, soTypeChecker.scanthrows the NPE above instead of the real error.Found re-checking our bank of real-bug examples on the new main (one of them is a record).