Skip to content

Commit cbd1dcd

Browse files
Fixes #1625 issue by caching the field list and validation state in addition to the existing layoutInfo and fieldOrder caches.
1 parent f38cabe commit cbd1dcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/com/sun/jna/Structure.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,10 +1018,10 @@ protected void sortFields(List<Field> fields, List<String> names) {
10181018
*/
10191019
protected List<Field> getFieldList() {
10201020
synchronized (fieldList) {
1021-
return fieldList.computeIfAbsent(getClass(), (c) -> {
1021+
return fieldList.computeIfAbsent(getClass(), (clazz) -> {
10221022
List<Field> flist = new ArrayList<>();
10231023
List<Field> classFields = new ArrayList<>();
1024-
for (Class<?> cls = getClass();
1024+
for (Class<?> cls = clazz;
10251025
!cls.equals(Structure.class);
10261026
cls = cls.getSuperclass()) {
10271027
for (Field field : cls.getDeclaredFields()) {

0 commit comments

Comments
 (0)