From 51b18eba7621d0d7c3da3cabbe9439227898cd47 Mon Sep 17 00:00:00 2001 From: Alex Klymenko Date: Fri, 2 Aug 2024 23:37:34 +0200 Subject: [PATCH] refactor: cleanup for FieldsExtraUtils (#100) --- src/main/java/org/reflector/FieldsExtraUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/reflector/FieldsExtraUtils.java b/src/main/java/org/reflector/FieldsExtraUtils.java index b941246..fd1aff6 100644 --- a/src/main/java/org/reflector/FieldsExtraUtils.java +++ b/src/main/java/org/reflector/FieldsExtraUtils.java @@ -42,7 +42,7 @@ public static Map getAllPrivateFieldsMap(final Class clazz) { * @return a map with field names as keys and Field objects as values */ public static Map getFieldsMap(final List fields) { - Map map = new HashMap(); + Map map = new HashMap<>(); for (Field field : fields) { map.put(field.getName(), field); } @@ -63,7 +63,7 @@ public static List getAllAnnotatedFields(final Class type, final Class throw new NullPointerException("Class type and annotation cannot be null"); } - List annotatedFields = new ArrayList(); + List annotatedFields = new ArrayList<>(); for (Field field : FieldUtils.getAllFields(type)) { if (field.isAnnotationPresent(annotation)) { field.setAccessible(true); // Ensure the field is accessible