Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused parameters, which fixes a warning suppression #761

Merged
merged 10 commits into from
May 29, 2024

Conversation

Ao-senXiong
Copy link
Member

Fixed #662

@Ao-senXiong
Copy link
Member Author

@wmdietl Looks like time out limit 110s is still not enough for some cases. Can you trigger the nonjunit_jdk8 to rerun?

* @param backup value to use if no most specific value is found
*/
@SuppressWarnings("UnusedVariable") // TODO clean this up
public MostSpecificVisitor(TypeMirror aTypeMirror, TypeMirror bTypeMirror, V backup) {
public MostSpecificVisitor(V backup) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!
Above, if (ms.error) { return backup; }, is backup always null if ms.error is true?
A few nullness annotations also seem to be missing, e.g. on backupAMSet.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is backup always null if ms.error is true?

I think no, the visitor will not reassign the value of backup. It only depends on the input.

A few nullness annotations also seem to be missing, e.g. on backupAMSet.

I will add it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is backup always null if ms.error is true?

I think no, the visitor will not reassign the value of backup. It only depends on the input.

I don't understand what you mean.
The only place where error is set to true is when if (backupAMSet == null).
I think the only way that can happen is if backup is null.
So in

        if (ms.error) {
            return backup;
        }

I would expect that the returned value is always null.
Wouldn't the code be clearer if null is returned explicitly, possibly with a comment that backup == null?
If that argument is flawed, what am I missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarification. See new commit d2baafd

@Ao-senXiong Ao-senXiong assigned wmdietl and unassigned Ao-senXiong May 29, 2024
Copy link
Member

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@wmdietl wmdietl changed the title Remove unused variable and clear up suppress warning Remove unused parameters, which fixes a warning suppression May 29, 2024
@wmdietl wmdietl enabled auto-merge (squash) May 29, 2024 20:21
@wmdietl wmdietl merged commit dad55e6 into eisop:master May 29, 2024
38 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate MostSpecificVisitor
2 participants