mirror of
https://github.com/fankes/moshi.git
synced 2025-10-20 00:19:21 +08:00
Merge pull request #629 from stoyicker/patch-1
Remove unnecessary isAccessible check
This commit is contained in:
@@ -227,9 +227,7 @@ public final class Types {
|
|||||||
String fieldName) {
|
String fieldName) {
|
||||||
try {
|
try {
|
||||||
Field field = clazz.getDeclaredField(fieldName);
|
Field field = clazz.getDeclaredField(fieldName);
|
||||||
if (!field.isAccessible()) {
|
field.setAccessible(true);
|
||||||
field.setAccessible(true);
|
|
||||||
}
|
|
||||||
Annotation[] fieldAnnotations = field.getDeclaredAnnotations();
|
Annotation[] fieldAnnotations = field.getDeclaredAnnotations();
|
||||||
Set<Annotation> annotations = new LinkedHashSet<>(fieldAnnotations.length);
|
Set<Annotation> annotations = new LinkedHashSet<>(fieldAnnotations.length);
|
||||||
for (Annotation annotation : fieldAnnotations) {
|
for (Annotation annotation : fieldAnnotations) {
|
||||||
|
Reference in New Issue
Block a user