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

validate against ambiguous references #1372

Merged
merged 4 commits into from
Jun 1, 2020

Conversation

carterkozak
Copy link
Contributor

Before this PR

After this PR

==COMMIT_MSG==

==COMMIT_MSG==

Possible downsides?

@policy-bot policy-bot bot requested a review from ferozco June 1, 2020 19:08
@carterkozak carterkozak changed the title Ckozak/fo/lambda methods/ambiguity validate against ambiguous references Jun 1, 2020
if (classSymbol == null) {
return false;
}
Set<Symbol.MethodSymbol> matching = ASTHelpers.findMatchingMethods(
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a super cool helper method! didn't know it existed

import org.junit.jupiter.api.Test;

public class LambdaMethodReferenceTest {

private CompilationTestHelper compilationHelper;
private RefactoringValidator refactoringValidator;
private CompilationTestHelper compile() {
Copy link
Contributor

Choose a reason for hiding this comment

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

gotta keep those tests fast 😛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

heh, most of our tests are structured this way so I moved it over. I think I migrated most of them after hitting a few cases where tests flaked after helper/validator instances were reused (due to either parallelism or multiple asserts in a single test). This way they're always clean regardless of other state!

@carterkozak
Copy link
Contributor Author

There's one more bug that I'm aware of where we trasform foo() to this.foo() regardless of whether the enclosing class (this) provides foo(). This breaks when foo() exists on an enclosing class, should be simple to check though.

@bulldozer-bot bulldozer-bot bot merged commit df14397 into fo/lambda-methods Jun 1, 2020
@bulldozer-bot bulldozer-bot bot deleted the ckozak/fo/lambda-methods/ambiguity branch June 1, 2020 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants