Skip to content

Conversation

@commonquail
Copy link
Contributor

Teach UnusedVariable to ignore fields referenced by a @FieldSource annotation the same way UnusedMethod ignores methods referenced by a @MethodSource annotation.

(@FieldSource is only "experimental" in v5.12.0, though)

References: #4713
References: https://junit.org/junit5/docs/current/api/org.junit.jupiter.params/org/junit/jupiter/params/provider/FieldSource.html

Teach `UnusedVariable` to ignore fields referenced by a `@FieldSource`
annotation the same way `UnusedMethod` ignores methods referenced by a
`@MethodSource` annotation.

References: google#4713
References: https://junit.org/junit5/docs/current/api/org.junit.jupiter.params/org/junit/jupiter/params/provider/FieldSource.html
|| referencedNames.contains(
unusedSym.owner.getQualifiedName() + "#" + simpleName);
}));
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is all copypasta from UnusedMethod.

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.

1 participant