Skip to content

Commit

Permalink
refactor: cleanup for FieldsExtraUtils (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
alxkm authored Aug 2, 2024
1 parent 7c78e8c commit 51b18eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/reflector/FieldsExtraUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static Map<String, Field> getAllPrivateFieldsMap(final Class<?> clazz) {
* @return a map with field names as keys and Field objects as values
*/
public static Map<String, Field> getFieldsMap(final List<Field> fields) {
Map<String, Field> map = new HashMap<String, Field>();
Map<String, Field> map = new HashMap<>();
for (Field field : fields) {
map.put(field.getName(), field);
}
Expand All @@ -63,7 +63,7 @@ public static List<Field> getAllAnnotatedFields(final Class<?> type, final Class
throw new NullPointerException("Class type and annotation cannot be null");
}

List<Field> annotatedFields = new ArrayList<Field>();
List<Field> annotatedFields = new ArrayList<>();
for (Field field : FieldUtils.getAllFields(type)) {
if (field.isAnnotationPresent(annotation)) {
field.setAccessible(true); // Ensure the field is accessible
Expand Down

0 comments on commit 51b18eb

Please sign in to comment.