Skip to content

Commit 482506b

Browse files
ghislainpiotsonartech
authored andcommitted
SONARPY-2891 Add synchronization to the WriteCache to avoid corruption (#240)
GitOrigin-RevId: 16e9458b65c04e9498a75050f7e2c2392d77198f
1 parent 1eaad95 commit 482506b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

python-frontend/src/main/java/org/sonar/python/caching/PythonWriteCacheImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@
2121

2222
public class PythonWriteCacheImpl implements PythonWriteCache {
2323

24-
private WriteCache writeCache;
24+
private final WriteCache writeCache;
2525

2626
public PythonWriteCacheImpl(WriteCache writeCache) {
2727
this.writeCache = writeCache;
2828
}
2929

3030
@Override
31-
public void write(String key, byte[] data) {
31+
public synchronized void write(String key, byte[] data) {
3232
this.writeCache.write(key, data);
3333
}
3434

0 commit comments

Comments
 (0)