The private constructor used in looking up method handles has changed to take an extra parameter. This change update the code to look for both constructor signatures.
PiperOrigin-RevId: 339124988
Changes include:
- update Guice tests that asserts error messages
- export new errors tests
- update Guice compiler flag so parameter names are available at runtime, which is required for the errors tests
PiperOrigin-RevId: 337602195
Changes include:
- update Guice tests that asserts error messages
- export new errors tests
- update Guice compiler flag so parameter names are available at runtime, which is required for the errors tests
PiperOrigin-RevId: 337401912
Changes include:
- skip tests that are testing bytecode generation enabled behaviors
- make line number and source file name information available even when bytecode generation is disabled since it does not use bytecode generation and makes testing easier (some tests rely on the information being available)
- update maven pom files to stop producing a no-aop version of Guice
- added test profile to execute tests with bytecode generation disabled
PiperOrigin-RevId: 336306344
Since it's actually possible to use assisted inject with field or method injection, an `@Inject` annotated constructor is not necessary.
This does mean that assisted injection does not respect the `binder().requireAtInjectOnConstructors()` requirement and it is non-trivial to propagate the injector option down to enforce this because the injection point is looked up at module configuration time.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=326730924
This also merge MISSING_CONSTRUCTOR with AT_INJECT_REQUIRED into a single error since they are essentially about the same issue.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=325867978
Replace CGLIB with custom code to generate "enhancers" and "fast-classes".
Some user visible changes from using cglib:
- intercepted method that has a return type of int but returns null from the interceptor will no longer be automatically converted to 0, instead a NullPointerException will be thrown.
- Scope implementation can no longer check for circular proxy instance using CircularDependencyProxy marker class, instead should use Scopes.isCircularProxy
- Depending on which custom class loading option is used, Guice enhanced class may no longer be mockable/spyable
- Generated class name is slightly longer.
Closes#1298
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320433559
Left the googlecode test as junit3 since moving to junit4 runner causes issue with the OSGiContainerTest, as junit4 does not allow test class that doesn't have any test methods.
Also need to move ThrowingProviderTest to junit4 because somehow the class initialization constructor is called before the Suite's BeforeClass method thus reading the flag before the flag gets parsed, causing flag parsing to throw exception.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320426928
Only the methods which satisfy the predicate will be processed by the DaggerAdapter. The objective is to conditionally limit Guice bindings exposed by the DaggerAdapter based on an external condition.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=302462640
We were incorrectly checking for Class.class in this case, which is never what we wanted.
In the process, also refactor the set of annotations which should have caught this discrepancy when we added support for abstract binding methods.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=256027168
Also validate that duplicates are passed as the declared modules to DaggerAdapter
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=255511592
Renames may include:
- containsAllOf => containsAtLeast
- containsAllIn => containsAtLeastElementsIn
- isSameAs => isSameInstanceAs
- isOrdered => isInOrder
- isStrictlyOrdered => isInStrictOrder
The other major change is to change custom subjects to extend raw Subject instead of supplying type parameters. The type parameters are being removed from Subject. This CL will temporarily produce rawtypes warnings, which will go away when I remove the type parameters (as soon as this batch of CLs is submitted).
Some CLs in this batch also migrate calls away from actualAsString(). Its literal replacement is `"<" + actual + ">"` (unless an object overrides actualCustomStringRepresentation()), but usually I've made a larger change, such as switching from an old-style "Not true that..." failure message to one generated with the Fact API. In that case, the new code usually contains a direct reference to this.actual (a field that I occasionally had to create). Another larger change I sometimes made is to switch from a manual check-and-fail approach to instead use check(...). And sometimes I just remove a withMessage() call that's no longer necessary now that the code uses check(...), or I introduce a check(...) call. (An assertion made with check(...) automatically includes the actual value from the original subject, so there's no need to set it again with withMessage().)
Finally, there's one CL in this batch in which I migrate a Correspondence subclass to instead use Correspondence.from.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=251472122
The overload that accepts a description generally produces better failure messages:
- The first line of the message it produces is something like: "value of: myProto.getResponse()" (where "getResponse()" is taken from the provided description)
- The last line of the message it produces is something like: "myProto was: response: query was throttled" (the full value of myProto)
- And the existing text goes in between.
Additional motivation: We are deleting the no-arg overload externally (and probably internally thereafter).
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=247095743
Supporting it correctly requires a fair amount of thought - Guice and Dagger scopes are different, multibindings are different, and implementing subcomponent factories+builders would be non-trivial. (We could possibly take advantage of child injectors to help?) Anyway, there's more to considered before traversing down this path.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=246354857