Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Make the test for dependency cycles less brittle. #418

Merged
merged 1 commit into from
Jun 23, 2014

Conversation

cgruber
Copy link
Collaborator

@cgruber cgruber commented Jun 23, 2014

Loosens the brittle assumptions of the cycle detection test which implicitly relies on method processing order. We don't actually care that A or C is found first - they're a cycle - any node will do. We just care about the correct error being thrown. Method processing order is simply undefined but happens to be deterministic within a JVM release, and happened to change in Java8.

@cgruber cgruber mentioned this pull request Jun 23, 2014
@cgruber
Copy link
Collaborator Author

cgruber commented Jun 23, 2014

Side note - cycle detection is gross on Dagger 1, in that it isn't really a unified thing w.r.t. other analyses. This is partly because the ProblemDetector (which does this) is part of the runtime, so the error returned is not some validation error, it's an IllegalStateException and the processor which uses this just tosses it.

This could be fixed, but doesn't seem worth it given that 2.0 is close. Cycle detection will fit nicely into the ValidationReport system, and be handled more clearly.

@JakeWharton
Copy link
Collaborator

I agree. All efforts should be toward 2.0.

JakeWharton added a commit that referenced this pull request Jun 23, 2014
Make the test for dependency cycles less brittle.
@JakeWharton JakeWharton merged commit 078d82d into square:master Jun 23, 2014
@JakeWharton
Copy link
Collaborator

And thanks!

@cgruber cgruber deleted the java8 branch June 23, 2014 23:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants