@@ -151,26 +151,24 @@ public <Q> Supplier<Q> getCompiledBinding(Dependency<Q> dep) {
151
151
return compile (binding );
152
152
}
153
153
if (key .getRawType () == List .class ) {
154
- Set <Binding <Object >> res2 = null ; // getBindings(key.getTypeParameter(0));
155
- Set <Binding <Object >> res3 = res2 != null ? new HashSet <>(res2 ) : new HashSet <>();
154
+ Key <Object > elementType = key .getTypeParameter (0 );
155
+ // Set<Binding<Object>> res2 = getBindings(elementType);
156
+ Set <Binding <Object >> res3 = /*res2 != null ? new HashSet<>(res2) :*/ new HashSet <>();
156
157
try {
157
- List <Object > l = containerProvider
158
- .get ()
159
- .lookupList (key .getTypeParameter (0 ).getRawType ());
158
+ List <Object > l = containerProvider .get ().lookupList (elementType .getRawType ());
160
159
l .forEach (o -> res3 .add (new Binding .BindingToInstance <>(o )));
161
160
} catch (Throwable e ) {
162
- // ignore
163
- e .printStackTrace ();
161
+ throw new DIException ("Error looking up list of " + elementType .getRawType (), e );
164
162
}
165
163
List <Supplier <Object >> list = res3 .stream ().map (this ::compile ).collect (Collectors .toList ());
166
164
//noinspection unchecked
167
165
return () -> (Q ) list (list );
168
166
}
169
167
if (key .getRawType () == Map .class ) {
170
- Key <?> k = key .getTypeParameter (0 );
171
- // Key<Object> v = key.getTypeParameter(1);
172
- if ( k . getRawType () == String . class ) {
173
- Set <Binding <Object >> res2 = null ; // getBindings(v );
168
+ Key <?> keyType = key .getTypeParameter (0 );
169
+ if ( keyType . getRawType () == String . class ) {
170
+ Key < Object > valueType = key . getTypeParameter ( 1 );
171
+ Set <Binding <Object >> res2 = getBindings (valueType );
174
172
Set <Binding <Object >> res3 = res2 != null ? new HashSet <>(res2 ) : new HashSet <>();
175
173
Map <String , Supplier <Object >> map = res3 .stream ()
176
174
.filter (b -> b .getOriginalKey () == null
0 commit comments