Skip to content

Commit 5511f28

Browse files
Merge pull request #1687 from bendk/push-yyprxvvrrttk
Avoid threading issues in sortFields (#1686)
2 parents c401bca + b665e9e commit 5511f28

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Features
1010

1111
Bug Fixes
1212
---------
13-
13+
* [#1686](https://github.com/java-native-access/jna/issues/1686): Fix `sortFields` race condition while getting fields
1414

1515
Release 5.18.0
1616
==============

src/com/sun/jna/Structure.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ private static <T extends Comparable<T>> List<T> sort(Collection<? extends T> c)
11251125
and can't be generated automatically.
11261126
**/
11271127
protected List<Field> getFields(boolean force) {
1128-
List<Field> flist = getFieldList();
1128+
List<Field> flist = new ArrayList<>(getFieldList());
11291129
Set<String> names = new HashSet<>();
11301130
for (Field f : flist) {
11311131
names.add(f.getName());

0 commit comments

Comments
 (0)