Skip to content

Commit 2eeaba4

Browse files
LeviticusMBjoeferner
authored andcommitted
Wait for list.addPromise() to finish before adding next item.
Prevents ConcurrentModificationException in JDK 20.
1 parent d092e64 commit 2eeaba4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/promises-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,13 @@ exports['Promises'] = nodeunit.testCase({
9696
test.strictEqual(name, "java.util.ArrayList");
9797
})
9898
.then(function() {
99-
list.addPromise('hello');
99+
return list.addPromise('hello');
100100
})
101101
.then(function() {
102-
list.addPromise('world');
102+
return list.addPromise('world');
103103
})
104104
.then(function() {
105-
list.addPromise('boo');
105+
return list.addPromise('boo');
106106
})
107107
.then(function() {
108108
return list.iteratorPromise();

0 commit comments

Comments
 (0)