Commit Graph

73 Commits

Author SHA1 Message Date
Bernardo Gomez Palacio
3939f48dfb Guarding against NPE on element filtering
We are still observing some NPE in ModuleRegistryConfiguration.postProcessBeanDefinitionRegistry
The purpose of this commit is to guard against them and provide
additional context on the reason.
2019-12-11 10:45:30 -08:00
Dave Syer
f759e6e4ab Add test for binding to Map by generic signature
See #67
2019-11-19 10:57:34 +00:00
Kevin Wang
4277d3e0f5 Fix handling FactoryBean 2019-11-18 13:50:17 -08:00
Bernardo Gomez Palacio
1a40634c10 Cover against a null source provided by a Guice Element
We are observing an edge case where a Guice Element returns a `null`
source, see the reference of he error below.

```
Caused by: java.lang.NullPointerException
	at org.springframework.guice.annotation.ModuleRegistryConfiguration.lambda$null$0(ModuleRegistryConfiguration.java:197)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
	at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
	at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:499)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:486)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:531)
	at org.springframework.guice.annotation.ModuleRegistryConfiguration.lambda$postProcessBeanDefinitionRegistry$1(ModuleRegistryConfiguration.java:197)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:174)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
	at org.springframework.guice.annotation.ModuleRegistryConfiguration.postProcessBeanDefinitionRegistry(ModuleRegistryConfiguration.java:198)
```
2019-11-18 13:14:42 -08:00
Dave Syer
61b3ac9c8d Fix more compiler warnings 2019-10-25 17:42:51 +01:00
Dave Syer
0a64a06bbc Fix compiler warnings 2019-10-25 17:40:31 +01:00
Kevin Wang
dc2a0b6495 Bind to super types 2019-10-23 13:01:07 -07:00
Kevin Wang
d62d78e500 Fix NPE 2019-10-21 09:45:59 -07:00
Kevin Wang
368ebc4d36 Add property to enable/disable Guice just-in-time bindings and log just-in-time bindings usage 2019-10-15 15:59:47 -07:00
Kevin Wang
1e7cbb0e31 Support generic interfaces 2019-10-15 15:45:40 -07:00
Kevin Wang
4308f7498b Bind all super interfaces 2019-10-15 15:45:40 -07:00
Taylor Wicksell
741f6e3794 fixed issue where modules were only being filtered from AppContext and not the Injector 2019-08-07 09:53:58 -07:00
Taylor Wicksell
c7424b1c5c remove unnecessary application.properties file 2019-05-18 05:15:00 -07:00
Taylor Wicksell
0ecc98d4cb ensure BindingAnnotations are treated as Qualifiers in Spring 2019-05-06 10:03:05 -07:00
Taylor Wicksell
6fec10d19c fixed issue where multibindings in guice cause duplicate beans in Spring 2019-05-06 10:02:53 -07:00
Spring Operator
3650197554 URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# Fixed URLs

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://www.apache.org/licenses/LICENSE-2.0 with 25 occurrences migrated to:
  https://www.apache.org/licenses/LICENSE-2.0 ([https](https://www.apache.org/licenses/LICENSE-2.0) result 200).
2019-03-27 15:32:41 +00:00
Taylor Wicksell
ea8e68674c map all non-singleton bindings as prototype scoped beans 2019-03-13 15:38:34 -07:00
Asi Bross
0bc99b690a Ignore Collection types from GuiceAutowireCandidateResolver 2019-03-06 14:05:44 -07:00
Taylor Wicksell
697d2ede55 add property spring.guice.modules.exclude to filter guice modules by name 2019-03-06 14:04:44 -07:00
Dave Syer
fd835487d3 Ensure *Aware contracts can be satisfied in ModuleRegistryConfiguration
If the BeanFactoryProvider is used there is a partially refreshed
ApplicationContext floating around. It works better if it is able to
inject Environment etc. via the Aware interfaces into early beans
like post processors.
2019-01-10 09:21:51 +00:00
Dave Syer
af2497c6d8 Polish 2019-01-10 09:21:24 +00:00
Howard Yuan
3463028f3c Revert the scope for the class since we no longer need it 2018-11-09 14:36:57 -08:00
Howard Yuan
4398a3389a Fix lost Supplier<T> type info in Guice2Spring direction 2018-11-09 14:36:57 -08:00
Taylor Wicksell
2207c4f1d9 make bean names unique when considering binding annotations
translate binding annotations into Spring @Qualifiers
2018-11-09 10:55:53 -08:00
Taylor Wicksell
0153079327 use Key<?> for binding dedupe check in SpringModule to include annotations
fix issues where @Named was not considered when fetching beans of the same type
2018-11-09 10:55:53 -08:00
kashike
752091fcf7 Extract name from javax.inject.Named if found 2018-08-13 09:36:27 -07:00
Taylor Wicksell
b2a767e51a support Guice binding annotations in SpringModule 2018-03-28 09:35:48 -07:00
Taylor Wicksell
1680610faf create injector before embedded server initialization, after other BeanPostProcessors 2018-03-01 11:51:06 -06:00
Taylor Wicksell
5e3603c29d remove check for Tool stage from SpringModule as it is no longer required 2018-03-01 11:10:40 +00:00
Taylor Wicksell
a098f7854b Added an option to deduplicate bindings in favor of Spring
User can set Environment property spring.guice.dedup=true.
2018-03-01 09:53:31 +00:00
Taylor Wicksell
e94c94837f Restore support for Guice PrivateModule's
See #32
2018-02-28 18:04:41 +00:00
Taylor Wicksell
aae2e1fc47 support multiple stages, as can occur when using ElementVisitors 2018-02-27 16:50:46 +00:00
Taylor Wicksell
bd30107666 Ensure bean post processors are applied before injector is created
In this way, Guice modules can declare bindings asEagerSingleton()
2018-02-22 16:14:35 +00:00
Dave Syer
8e26ec0f3c Add a test for generic bean type
Fixes gh-26
2018-02-01 09:04:32 +00:00
Dave Syer
9a8af0efd6 Add another test
See gh-26
2017-12-21 16:18:05 +00:00
Dave Syer
becf90b951 Add another test for @EnableGuiceModules
See gh-22
2017-12-21 16:14:47 +00:00
Matt Metlis
fda2edb524 Make GuiceModuleRegistrar handle excludeNames filter correctly. 2017-12-21 16:03:22 +00:00
Taylor Wicksell
5e14e96248 make GuiceModuleMetadata handle ParameterizedType's correctly #20 2017-08-01 07:02:55 +01:00
Taylor Wicksell
dac9688e99 handle null types on bean definitions in SpringModule 2017-06-10 10:08:01 +01:00
Taylor Wicksell
1825c933d0 set resource description for beans provided by Guice modules 2017-06-10 07:04:14 +01:00
Dave Syer
63c8c2e47f Tidy up package structure a bit 2017-06-04 11:23:02 +01:00
Dave Syer
b810a80ae7 Fix javadocs 2017-06-04 11:09:00 +01:00
Dave Syer
6574913f2e Add some docs and a Closeable to BeanFactoryProvider 2017-06-04 11:05:26 +01:00
Dave Syer
490fc20cf7 Extract BeanFactoryProvider into convenience class 2017-06-01 11:12:54 +01:00
Dave Syer
a01511f269 Add Maven wrapper 2017-06-01 11:12:54 +01:00
Taylor Wicksell
b26bdb4125 Make SpringModule aware of bindings in wrapping Injector
See gh-13, gh-12
2017-06-01 11:12:32 +01:00
Dave Syer
c42ba69532 Move @SuppressWarnings to private methods 2017-06-01 08:43:25 +01:00
Taylor Wicksell
061aef36f2 support binding of generic interfaces from SpringModule 2017-06-01 08:32:23 +01:00
Dave Syer
9dae979d39 Add some tests 2017-05-26 14:22:25 +01:00
Dave Syer
5708ba0469 Add test for spring module including another guice module
This test is from a PR by @twicksell, but modified to run without
any changes in spring-guice. See gh-12 for discussion.
2017-05-24 17:40:03 +01:00