Fixed the Implicit bindings for parameterized types bug
git-svn-id: https://google-guice.googlecode.com/svn/trunk@431 d779f126-a31b-0410-b53b-1d3aecad763e
diff --git a/src/com/google/inject/InjectorImpl.java b/src/com/google/inject/InjectorImpl.java
index 4c5b7a5..30b2f31 100644
--- a/src/com/google/inject/InjectorImpl.java
+++ b/src/com/google/inject/InjectorImpl.java
@@ -722,18 +722,9 @@
? getBinding(key.withoutAttributes()) : null;
}
- Type type = key.getTypeLiteral().getType();
-
- // If the keys type isn't a Class, bail out.
- if (!(type instanceof Class)) {
- return null;
- }
-
- // This is safe after the preceding check.
+ // Create a binding based on the raw type.
@SuppressWarnings("unchecked")
- Class<T> clazz = (Class<T>) type;
-
- // Create a binding based on the type.
+ Class<T> clazz = (Class<T>) key.getTypeLiteral().getRawType();
return createBindingFromType(clazz);
}