Error Prone: Enable and fix GetClassOnEnum
Change-Id: I42b0df3926b8c8633067e5d8cab81987fb6a71bf
This commit is contained in:

committed by
David Pursehouse

parent
aebb4eae25
commit
f66892abb5
@@ -127,8 +127,10 @@ public class Section {
|
||||
|
||||
public <T extends Enum<?>, E extends EnumSet<? extends T>> T select(
|
||||
String title, String name, T defValue, boolean nullIfDefault) {
|
||||
@SuppressWarnings("rawtypes")
|
||||
Class<? extends Enum> declaringClass = defValue.getDeclaringClass();
|
||||
@SuppressWarnings("unchecked")
|
||||
E allowedValues = (E) EnumSet.allOf(defValue.getClass());
|
||||
E allowedValues = (E) EnumSet.allOf(declaringClass);
|
||||
return select(title, name, defValue, allowedValues, nullIfDefault);
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,7 @@ java_package_configuration(
|
||||
"-Xep:FragmentNotInstantiable:ERROR",
|
||||
"-Xep:FunctionalInterfaceClash:ERROR",
|
||||
"-Xep:FutureReturnValueIgnored:ERROR",
|
||||
#"-Xep:GetClassOnEnum:ERROR",
|
||||
"-Xep:GetClassOnEnum:ERROR",
|
||||
"-Xep:ImmutableAnnotationChecker:ERROR",
|
||||
#"-Xep:ImmutableEnumChecker:ERROR",
|
||||
"-Xep:IncompatibleModifiers:ERROR",
|
||||
|
Reference in New Issue
Block a user