1 <p> The code synchronizes on an apparently unshared boxed primitive,
4 private static final Integer fileLock = new Integer(1);
6 synchronized(fileLock) {
12 <p>It would be much better, in this code, to redeclare fileLock as
14 private static final Object fileLock = new Object();
16 The existing code might be OK, but it is confusing and a
17 future refactoring, such as the "Remove Boxing" refactoring in IntelliJ,
18 might replace this with the use of an interned Integer object shared
19 throughout the JVM, leading to very confusing behavior and potential deadlock.