Skip to content

Commit c120484

Browse files
tzolotuhinlukeis
authored andcommitted
Fix bug in ShortTermMemoryHandler with ArrayIndexOutOfBoundsException (#2811)
1 parent 12d92aa commit c120484

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/server/src/org/openqa/selenium/remote/server/log/ShortTermMemoryHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public ShortTermMemoryHandler(int capacity, Level minimumLevel, Formatter format
5555

5656

5757
@Override
58-
public void publish(LogRecord record) {
58+
public synchronized void publish(LogRecord record) {
5959
if (record.getLevel().intValue() < minimumLevel) {
6060
return;
6161
}
@@ -67,12 +67,12 @@ public void publish(LogRecord record) {
6767
}
6868

6969
@Override
70-
public void flush() {
70+
public synchronized void flush() {
7171
/* NOOP */
7272
}
7373

7474
@Override
75-
public void close() throws SecurityException {
75+
public synchronized void close() throws SecurityException {
7676
for (int i = 0; i < capacity; i++) {
7777
lastRecords[i] = null;
7878
}
@@ -95,7 +95,7 @@ public synchronized LogRecord[] records() {
9595
return validRecords.toArray(new LogRecord[validRecords.size()]);
9696
}
9797

98-
public String formattedRecords() {
98+
public synchronized String formattedRecords() {
9999
final StringWriter writer;
100100

101101
writer = new StringWriter();

0 commit comments

Comments
 (0)