Remove unnecessary isAccessible check

https://github.com/square/moshi/issues/624
This commit is contained in:
Jorge Antonio Díaz-Benito Soriano
2018-08-19 20:46:43 +02:00
committed by GitHub
parent 354db6b46f
commit 56e67088a9

View File

@@ -227,9 +227,7 @@ public final class Types {
String fieldName) {
try {
Field field = clazz.getDeclaredField(fieldName);
if (!field.isAccessible()) {
field.setAccessible(true);
}
field.setAccessible(true);
Annotation[] fieldAnnotations = field.getDeclaredAnnotations();
Set<Annotation> annotations = new LinkedHashSet<>(fieldAnnotations.length);
for (Annotation annotation : fieldAnnotations) {