Skip to content

Unsupported Type as a return type or field is not recoagnized (mojo) #74

@LZaruba

Description

@LZaruba

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions