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
This will ensure that the key will not be modified by Guice's package name compressor.
Also fix package name compressor to handle single letter class names.
PiperOrigin-RevId: 334653432
Previously any string that matches the package name pattern will be shortened and this is undesirable when the text is not actually meant to be interpreted as a package name.
This change gives user a way to disable the package name compressor by putting the text in double quotation marks.
PiperOrigin-RevId: 334254171
When an optional binder binding was linked to the same class like below, infinite recursion occurs. There is a check for recursive binding in BindingProcessor class for all linked bindings but that did not work for OptionalBinder since OptionalBinder original key annotation is wrapped into something. So, comparing the original key and linked binding key didn't work.
Added a check for that.
Example:
```
OptionalBinder.newOptionalBinder(binder(), MyClass.class)
.setBinding()
.to(MyClass.class);
```
PiperOrigin-RevId: 332062297
This avoid mistaking normal sentences in user added error message as class names. It is also rare and less useful to compress a short class name anyway.
PiperOrigin-RevId: 329401381
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
Automated g4 rollback of changelist 324101718.
*** Reason for rollback ***
Roll forward of [] with fix: Stopwatch's Duration elapsed() method cannot be used here. Possibly related to b/156759807.
*** Original change description ***
Automated g4 rollback of changelist 324072869.
*** Reason for rollback ***
Broke a bunch of things.
*** Original change description ***
Rewrite the Guice Stopwatch class to make it testable. Rename this Stopwatch to ContinuousStopwatch to avoid a naming collision with its internal Stopwatch.
***
***
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324246423
Without this fix @RBS doesn't work with @ProvidesForRequest, because it provides the binding via a module installed in the scanner.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324205733
All new errors will be formatted using with the following format:
```
1 ): [Guice/SOME_ERROR]: Summary about this error
Detail from the implementation of ErrorDetail subclass.
Learn more:
http://github.com/google/guice/wiki/SOME_ERROR
```
Also add the initial documentation on MISSING_IMPLEMENTATION error.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=324051288
Create a new multibinder alternate for Set<? extends T>
Closes#1366
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=323843272
This is a better place for the lock, since it is needed for JIT bindings.
Also inline InjectorShell's getBindingData(): it's only called from one place.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=322466470
InheritingState is the only implementation of State outside of testing, and both are package private, so it's unnecessary to have both an interface and an implementation class.
This refactor should not change any observed behavior.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=321065049
Make State return immutable lists for some of its methods.
This refactor shouldn't change any observable behavior.
This CL will make it easier to merge State and InheritingState.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=321014769
Changed to skip certain tests explicitly instead of excluding the test class, which makes the setup easier.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320982966
In particular:
- Move jitBindings and failedJitBindings out of InjectorImpl and into a new InjectorJitBindingData class, which is constructed in parallel with State in the InjectorShell.
- Move blacklistedKeys (and associated methods) out of InheritingState and into InjectorJitBindingData.
- Rename blacklistedKeys methods: blacklist -> banKey; isBlacklisted -> isBannedKey; getSourcesForBlacklistedKey -> getSourcesForBannedKey
- Replace parent().blacklist() with banKeyInParent() since it's the only reason the parent jit binding data is ever accessed.
This should be a refactor only: no change in behavior is expected from this CL.
This is Step 1 of this design doc: https://docs.google.com/document/d/1az6yShBLpN9DKr1uvFlMUQEqj-2eXl0frckmVWDEdkg/edit
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=320495996
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
Since `Message` is used in various public APIs it's infesiable to change
it to be a subclass of a error message class. Instead this CL moves all the
details about the error into an `ErrorDetail` class and wraps it with `Message`. Errors that needs custom formatting can inherit `ErrorDetail` and a generic implementation is added that uses the current formatting options.
Follow up changes to add different implementations for specific errors that should be formatted differently if the experimental new error feature is enabled.
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=318520440