Skip to content

Commit 22299d4

Browse files
Synchronized collections to avoid test failures
DEVSIX-4235
1 parent a5b8f44 commit 22299d4

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

pdfocr-tesseract4/src/test/java/com/itextpdf/pdfocr/events/multithreading/MultiThreadingTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ private static Thread getThread(DoImageOcrRunnable runnable) {
124124
}
125125

126126
public static class TestEventCounter extends EventCounter {
127-
private List<IEvent> events = new ArrayList<>();
128-
private List<IMetaInfo> metaInfos = new ArrayList<>();
127+
private List<IEvent> events = new ArrayList<IEvent>();
128+
private List<IMetaInfo> metaInfos = new ArrayList<IMetaInfo>();
129129

130130
public List<IEvent> getEvents() {
131131
return events;
@@ -136,10 +136,9 @@ public List<IMetaInfo> getMetaInfos() {
136136
}
137137

138138
@Override
139-
protected void onEvent(IEvent event, IMetaInfo metaInfo) {
139+
synchronized protected void onEvent(IEvent event, IMetaInfo metaInfo) {
140140
this.events.add(event);
141141
this.metaInfos.add(metaInfo);
142142
}
143143
}
144-
145144
}

0 commit comments

Comments
 (0)