square/dagger — pull request #119 by patrickbaumann (2012-11-28 19:16:36+00:00)
Title: Fixing issue where InjectorProcessor can't look up generic types

I encountered an issue with the change in #117 that causes InjectorProcessor to throw a NullPointerException when it encounters a generic type that contains an Inject annotation.

Root cause: calling TypeMirror.toString() results in a canonical class name that includes the generic parts. e.g.: "com.example.core.SomeGenericType". When we later use that string to look up the type via the environment processor, it returns null as it requires just the type name ("com.example.core.SomeGenericType").

I've provided a fix that strips anything including and after a '<' from the type name before storing it. I was unable to find a way to do this without string manipulation (I was hoping for a method call on TypeMirror that would return just the type name without generics).