@@ -150,7 +150,7 @@ enum JitLimitation {
150150 @ Override
151151 public <T > List <Binding <T >> findBindingsByType (TypeLiteral <T > type ) {
152152 @ SuppressWarnings ("unchecked" ) // safe because we only put matching entries into the map
153- List < Binding < T >> list =
153+ var list =
154154 (List <Binding <T >>)
155155 (List ) bindingData .getIndexedExplicitBindings ().get (checkNotNull (type , "type" ));
156156 return Collections .unmodifiableList (list );
@@ -161,7 +161,7 @@ public <T> List<Binding<T>> findBindingsByType(TypeLiteral<T> type) {
161161 public <T > BindingImpl <T > getBinding (Key <T > key ) {
162162 Errors errors = new Errors (checkNotNull (key , "key" ));
163163 try {
164- BindingImpl < T > result = getBindingOrThrow (key , errors , JitLimitation .EXISTING_JIT );
164+ var result = getBindingOrThrow (key , errors , JitLimitation .EXISTING_JIT );
165165 errors .throwConfigurationExceptionIfErrorsExist ();
166166 return result ;
167167 } catch (ErrorsException e ) {
@@ -175,15 +175,14 @@ public <T> BindingImpl<T> getBinding(Key<T> key) {
175175 @ Override
176176 public <T > BindingImpl <T > getExistingBinding (Key <T > key ) {
177177 // Check explicit bindings, i.e. bindings created by modules.
178- BindingImpl < T > explicitBinding = bindingData .getExplicitBinding (checkNotNull (key , "key" ));
178+ var explicitBinding = bindingData .getExplicitBinding (checkNotNull (key , "key" ));
179179 if (explicitBinding != null ) {
180180 return explicitBinding ;
181181 }
182182 synchronized (jitBindingData .lock ()) {
183183 // See if any jit bindings have been created for this key.
184184 for (InjectorImpl injector = this ; injector != null ; injector = injector .parent ) {
185- @ SuppressWarnings ("unchecked" )
186- BindingImpl <T > jitBinding = (BindingImpl <T >) injector .jitBindingData .getJitBinding (key );
185+ var jitBinding = injector .jitBindingData .getJitBinding (key );
187186 if (jitBinding != null ) {
188187 return jitBinding ;
189188 }
@@ -196,7 +195,7 @@ public <T> BindingImpl<T> getExistingBinding(Key<T> key) {
196195 try {
197196 // This is safe because isProvider above ensures that T is a Provider<?>
198197 @ SuppressWarnings ("unchecked" )
199- Key <?> providedKey = (Key <?>) getProvidedKey ((Key ) key , new Errors ());
198+ var providedKey = (Key <?>) getProvidedKey ((Key ) key , new Errors ());
200199 if (getExistingBinding (providedKey ) != null ) {
201200 return getBinding (key );
202201 }
@@ -268,8 +267,8 @@ private <T> BindingImpl<T> getJustInTimeBinding(Key<T> key, Errors errors, JitLi
268267 synchronized (jitBindingData .lock ()) {
269268 // first try to find a JIT binding that we've already created
270269 for (InjectorImpl injector = this ; injector != null ; injector = injector .parent ) {
271- @ SuppressWarnings ( "unchecked" ) // we only store bindings that match their key
272- BindingImpl < T > binding = ( BindingImpl < T >) injector .jitBindingData .getJitBinding (key );
270+
271+ var binding = injector .jitBindingData .getJitBinding (key );
273272
274273 if (binding != null ) {
275274 // If we found a JIT binding and we don't allow them,
@@ -634,7 +633,7 @@ private boolean cleanup(BindingImpl<?> binding, Set<Key<?>> encountered) {
634633 Key <?> depKey = dep .getKey ();
635634 InjectionPoint ip = dep .getInjectionPoint ();
636635 if (encountered .add (depKey )) { // only check if we haven't looked at this key yet
637- BindingImpl <?> depBinding = jitBindingData .getJitBinding (depKey );
636+ var depBinding = jitBindingData .getJitBinding (depKey );
638637 if (depBinding != null ) { // if the binding still exists, validate
639638 boolean failed = cleanup (depBinding , encountered ); // if children fail, we fail
640639 if (depBinding instanceof ConstructorBindingImpl ) {
0 commit comments