Commit Graph
1954 Commits
Author SHA1 Message Date
Guice TeamandXiaoming Jia dea06c1087 Make Guice builds with bazel.
This change only makes it possible to build with bazel and no changes to existing maven setup yet.

PiperOrigin-RevId: 422630465
2022-01-18 13:31:43 -08:00
Guice TeamandGuice Team bbd2f0d384 Remove jdk8-tests module since Guice now targets Java 8 and above by default.
PiperOrigin-RevId: 421354790
2022-01-12 11:40:38 -08:00
Guice TeamandGuice Team b7e5e331d2 Internal change.
PiperOrigin-RevId: 421158735
2022-01-12 11:40:14 -08:00
Guice TeamandGuice Team d88175a45b Delete a few classes that are not actually tests.
PiperOrigin-RevId: 420898057
2022-01-10 17:37:17 -08:00
Guice TeamandGuice Team 240406ceaf Internal change.
PiperOrigin-RevId: 420766497
2022-01-10 08:21:35 -08:00
Guice TeamandGuice Team 60fddb2c28 Provide a non-empty name for the test cookie.
PiperOrigin-RevId: 410290707
2021-11-16 10:32:16 -08:00
Guice TeamandGuice Team 0ce94279a1 Upgrade struct2 dependency version to 2.3.37.
PiperOrigin-RevId: 409001068
2021-11-10 16:07:13 -08:00
Guice TeamandGuice Team 34eca95f9e Make ServletScopes final.
PiperOrigin-RevId: 408431479
2021-11-08 13:46:29 -08:00
Guice TeamandGuice Team 2aefd54946 Remove COMPLETE option for flag guice_include_stack_traces.
This option does not provide much benefits and doesn't even work correctly in some cases.

PiperOrigin-RevId: 407408634
2021-11-03 13:12:03 -07:00
Eric ChangandGuice Team 15c5230490 Internal refactor
RELNOTES=n/a
PiperOrigin-RevId: 407145553
2021-11-02 12:11:58 -07:00
Sam BerlinandGuice Team 9d12b481dd Instantiate modules if necessary in DaggerAdapter.
PiperOrigin-RevId: 403715358
2021-10-17 00:51:25 -07:00
Stuart McCullochandGuice Team c6fd1423ce Import https://github.com/google/guice/pull/1530.
Fixes issue #1526 by taking return types into account when selecting candidates for interception

PiperOrigin-RevId: 402869321
2021-10-13 10:44:47 -07:00
Stuart McCullochandGuice Team cf759d44c7 Update unsafe class defining to work on Java 17+ (close #1529)
Java 17 has removed Unsafe.defineAnonymousClass in favor of Lookup.defineHiddenClass

PiperOrigin-RevId: 399274715
2021-09-27 14:01:19 -07:00
plindnerandGuice Team 25fe439254 Minor memory and performance fixes for Guice.
- Use char where available
- Replace usage of LinkedHashMap with ImmutableSet

PiperOrigin-RevId: 398739059
2021-09-24 08:43:52 -07:00
nivertiusandGuice Team ffd9d017a4 Allow access to InterceptorBindings from SPI (close #1503)
This PR allows calls to Injector SPI to get configured InterceptorBinding when asking for getElements. This will allow tools to extract aspects applied on created instances.

No major changes beside returning those interceptor bindings were made. Now, the InterceptorBinding list is kept within InjectorBindingData and transformed into MethodAspects when creating constructor.

There are no API changes here. Injector#getElements does specify that some elements are not returned, but doesn't specify which. As I understand that means that it can return those interceptor bindings now, and this change isn't breaking the contract of this method. Tools that extract those elements should search for specific ones anyway.

PiperOrigin-RevId: 398582345
2021-09-23 14:47:19 -07:00
Guice TeamandGuice Team 0477f05101 Disable support for injection into local Kotlin classes.
PiperOrigin-RevId: 395992007
2021-09-10 13:10:33 -07:00
Alan MalloyandGuice Team b007a40f71 Annotate Key with @CheckReturnValue
PiperOrigin-RevId: 391859733
2021-08-19 15:39:25 -07:00
Stuart McCullochandGuice Team db3f41b7b2 Update asm version to 9.2.
Closes #1528.

PiperOrigin-RevId: 391384759
2021-08-17 15:02:27 -07:00
Guice TeamandGuice Team 7d7e3da20c No visible change.
PiperOrigin-RevId: 382141204
2021-06-29 12:31:41 -07:00
Guice TeamandGuice Team c1c1a763d0 Remove unneeded Thread.yield() statement from test.
PiperOrigin-RevId: 373631407
2021-05-13 12:23:10 -07:00
Guice TeamandGuice Team 738d317387 Fix bug in UriEncoder that interpreted and stripped numeric prefixes.
RELNOTES=Fix bug in UriEncoder that interpreted and stripped numeric prefixes.
PiperOrigin-RevId: 373550033
2021-05-13 03:53:56 -07:00
Kurt Alfred KlueverandGuice Team 350659cc07 Demonstrate a bug in UriEncoder.
RELNOTES=n/a
PiperOrigin-RevId: 373454466
2021-05-12 14:42:04 -07:00
Guice TeamandGuice Team 1dbfbce488 Explain why ErrorsException is ignored in createJustInTimeBindingRecursive internal method.
PiperOrigin-RevId: 373157192
2021-05-11 08:33:09 -07:00
Guice TeamandGuice Team e960b66d3d Handle kotlin object declaration with permit annotations.
If the permit annotation is placed before the object keyword then the annotation will be present on the anonymous class. So this change update BoundFieldModule.WithPermits to also check annotations on the anonymous class itself.

PiperOrigin-RevId: 367707010
2021-04-09 14:42:59 -07:00
Guice TeamandGuice Team 053d0a5f29 Update workflow to cancel previous runs and upgrade to setup-java@v2.
PiperOrigin-RevId: 367692521
2021-04-09 13:23:53 -07:00
Guice TeamandGuice Team 6fc8ad454a no visible change.
PiperOrigin-RevId: 367246328
2021-04-07 10:25:08 -07:00
Sam BerlinandGuice Team a260458b28 Rework MapBinder to avoid a linked binding for the Map<K, ? extends V> binding to reduce noise in the graph.
PiperOrigin-RevId: 366251178
2021-04-01 07:59:57 -07:00
Sam BerlinandGuice Team e6ec2a4a94 Rework the way we bind the Set<? extends T> multibound object so that we can avoid the linked binding. This removes one unnecessary dependency from the graph, making graph visualizations more straight forward.
PiperOrigin-RevId: 366250039
2021-04-01 07:51:04 -07:00
Guice TeamandGuice Team dc7f4858f9 Support TYPE_USE type Nullable annotations.
This change only add support for top level annotation like `@Nullable List<String>` and not `List<@Nullable String>`.

PiperOrigin-RevId: 361592529
2021-03-08 10:00:47 -08:00
Guice TeamandGuice Team 27ae45775c Add a script to diff release jars with new release to do a quick check before approving the new release in maven central.
PiperOrigin-RevId: 360546122
2021-03-02 16:54:50 -08:00
Guice TeamandGuice Team 54cccd3406 bump snapshot version, update README & prior API xml
PiperOrigin-RevId: 360302867
2021-03-01 16:23:20 -08:00
Guice TeamandGuice Team e09d1eebd0 Add back build.properties files that were still used.
PiperOrigin-RevId: 359826559
2021-02-26 13:28:21 -08:00
Guice TeamandGuice Team 2872237b01 Throw an error if there is no MapKey annotation on @IntoMap dagger provider methods.
PiperOrigin-RevId: 359792774
2021-02-26 10:53:57 -08:00
Guice TeamandGuice Team 9dc98cb7c7 Add a test to verify that failure in scanning one key doesn't effect other bindings that depends on the key.
PiperOrigin-RevId: 359786415
2021-02-26 10:25:14 -08:00
boris-unckelandGuice Team 420400684c Upgrad guava to latest release 30.1-jre.
Closes #1472

PiperOrigin-RevId: 359383637
2021-02-24 15:28:44 -08:00
Matthias KurzandGuice Team 4a66eb4dec Upgrade asm from 9.0 to version 9.1
Closes #1487

PiperOrigin-RevId: 359373325
2021-02-24 14:39:50 -08:00
Guice TeamandGuice Team 6fa83e476a Add missing @since methods
PiperOrigin-RevId: 359326331
2021-02-24 11:11:23 -08:00
Guice TeamandGuice Team 96e835f098 Update @since tags
PiperOrigin-RevId: 359195197
2021-02-23 20:12:19 -08:00
Sam BerlinandXiaoming Jia bfc2e48f4a If all reasonable sources are filtered via skipSource, then show the source as "unknown source" instead of InjectorShell.build (which should be an internal detail).
PiperOrigin-RevId: 358853443
2021-02-22 13:50:35 -08:00
Guice TeamandGuice Team df622abf7c Fixing javadoc, map bindings were actually implemented some time ago
PiperOrigin-RevId: 356987382
2021-02-11 09:08:19 -08:00
Guice TeamandGuice Team 826a97fced Update the description for Key class.
PiperOrigin-RevId: 356859347
2021-02-10 16:51:38 -08:00
Guice TeamandGuice Team 015ed75b5c Restore the default method log message to WARNING level.
The test failures due to unexpected log messages are now resolved.

PiperOrigin-RevId: 355880552
2021-02-05 10:39:38 -08:00
Guice TeamandGuice Team f78f7cfb3b Temporarily down grade the warning to INFO level.
The warning is causing some test failures due to unexpected log messages.

PiperOrigin-RevId: 355507369
2021-02-03 16:25:41 -08:00
Stuart McCullochandGuice Team 9a83236e2f Fixes the way AssistedInject deals with default methods that javac generates.
Gory details:
  javac sometimes generates default methods for factories.
  We can't proxy them directly because the return type is different, and AssistedInject cares about the return type (to know what class to inject), so we must execute the default method as-is and let java route it.
  Calling the actual default method requires using MethodHandles, but if the factory isn't public the MethodHandles.lookups() that Guice constructs won't be able to see it.
  Previously, we used reflection to hack the ability to use ALL_MODES in Lookups, but that's bad and triggers a reflective access warning in newer JDKs.
  We now properly use findSpecial or unreflectSpecial on a user-provided Lookups.
  The user only needs to provide the Lookups if the factory is non-public. If they don't, we continue to fallback to hacky methods that may stop working at any time (and we log a warning).

Also adds a new test in a subpackage to guarantee that we trigger this (b/c code in the same package won't care about Lookups access issues).

Note: this is a modified version of mcculls' PR @  https://github.com/google/guice/pull/1448.

Closes https://github.com/google/guice/pull/1448
Closes https://github.com/google/guice/issues/1321

PiperOrigin-RevId: 355485022
2021-02-03 14:38:02 -08:00
Guice TeamandGuice Team e292838c89 Add a CI status badge.
PiperOrigin-RevId: 354580188
2021-01-29 11:57:18 -08:00
Guice TeamandGuice Team a26bb0100b Update workflow to cache maven packages.
PiperOrigin-RevId: 354555203
2021-01-29 10:06:13 -08:00
Guice TeamandGuice Team 62276f87be Configure github actions to publish latest javadoc and snapshot after a success test run.
PiperOrigin-RevId: 354360420
2021-01-28 11:51:21 -08:00
Guice TeamandXiaoming Jia 345316ace8 Initial setup for migrating from Travis to Github Actions.
Closes #1456

ORIGINAL_AUTHOR=Carl Dea <carl.dea@gmail.com>
PiperOrigin-RevId: 353906843
2021-01-26 15:02:06 -08:00
Guice TeamandGuice Team 2157fa9f12 revert support for TYPE_USE Nullable annotation.
PiperOrigin-RevId: 353872238
2021-01-26 08:29:20 -08:00
Sam BerlinandGuice Team 1a299822f0 Use respectful terms.
PiperOrigin-RevId: 353310819
2021-01-22 13:44:44 -08:00