Revision: 1325
Author: sberlin
Date: Thu Oct 28 19:44:32 2010
Log: Jesse's suggestion for fixing Nullability -- check the String just for
name=="Nullable", but add class==Nullable.class to catch the jarjar'd
c.g.i.i.util.Nullable.
http://code.google.com/p/google-guice/source/detail?r=1325
Modified:
/trunk/core/src/com/google/inject/internal/Nullability.java
=======================================
--- /trunk/core/src/com/google/inject/internal/Nullability.java Tue Oct 26
19:40:07 2010
+++ /trunk/core/src/com/google/inject/internal/Nullability.java Thu Oct 28
19:44:32 2010
@@ -2,6 +2,8 @@
import java.lang.annotation.Annotation;
+import com.google.inject.internal.util.Nullable;
+
/**
* Whether a member supports null values injected.
*
@@ -22,9 +24,11 @@
public static boolean allowsNull(Annotation[] annotations) {
for(Annotation a : annotations) {
- String name = a.annotationType().getSimpleName();
- // Check for $Nullable also because jarjar renames it.
- if ("Nullable".equals(name) || "$Nullable".equals(name)) {
+ Class<? extends Annotation> type = a.annotationType();
+ // Check for Nullable.class because our c.g.i.internal.util.Nullable
+ // gets jarjar'd into $Nullable, and we want extensions that
reference
+ // it to continue working.
+ if ("Nullable".equals(type.getSimpleName()) || type ==
Nullable.class) {
return true;
}
}
--
You received this message because you are subscribed to the Google Groups
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice-dev?hl=en.