Skip to content

Commit

Permalink
Make Assertions#validateTypes() public
Browse files Browse the repository at this point in the history
`FindMissingTypes#findMissingTypes()` should possibly build on the service model to allow other languages to supply their own type validations.
  • Loading branch information
knutwannheden committed Nov 14, 2023
1 parent 171d4b1 commit d925bc2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static void customizeExecutionContext(ExecutionContext ctx) {
}
}

static SourceFile validateTypes(SourceFile source, TypeValidation typeValidation) {
public static SourceFile validateTypes(SourceFile source, TypeValidation typeValidation) {
if (source instanceof JavaSourceFile) {
assertValidTypes(typeValidation, (JavaSourceFile) source);
}
Expand Down Expand Up @@ -83,7 +83,7 @@ private static void assertValidTypes(TypeValidation typeValidation, J sf) {
})
.collect(Collectors.toList());
if (!missingTypeResults.isEmpty()) {
throw new IllegalStateException("AST contains missing or invalid type information\n" + missingTypeResults.stream().map(v -> v.getPath() + "\n" + v.getPrintedTree())
throw new IllegalStateException("LST contains missing or invalid type information\n" + missingTypeResults.stream().map(v -> v.getPath() + "\n" + v.getPrintedTree())
.collect(Collectors.joining("\n\n")));
}
}
Expand Down

0 comments on commit d925bc2

Please sign in to comment.