Hi,
following example passes java17 check:
public class IllegalTypeReturn {
public LocalDateTime localDateTime() {
return null;
}
}
The return statement gets examined, but it is ignored due to the Mojo adding all classes to ignoredPackages. The return type of the method signature is not checked at all.
Similarily following code passes the check for java17:
public class IllegalFieldSample {
private String stringField;
private LocalDateTime localDateTimeField;
}
Fields are not examined at all, and while there is no manipulation (calls) to the fields, it passes.
I will attach a pull request with a proposed solution to both of the issues shortly.