reverts commit
@@ -214,7 +214,14 @@ public final class ReflectionKit {
if (Objects.isNull(clazz)) {
return Collections.emptyList();
}
- return CLASS_FIELD_CACHE.computeIfAbsent(clazz, ReflectionKit::doGetFieldList);
+ List<Field> fields = CLASS_FIELD_CACHE.get(clazz);
+ if (CollectionUtils.isEmpty(fields)) {
+ synchronized (CLASS_FIELD_CACHE) {
+ fields = doGetFieldList(clazz);
+ CLASS_FIELD_CACHE.put(clazz, fields);
+ }
+ }
+ return fields;
}
/**
