Skip to content

Commit

Permalink
Synchronize on empty arrays instead of Integer instances.
Browse files Browse the repository at this point in the history
(followup to cl/660005124)

RELNOTES=n/a
PiperOrigin-RevId: 664961621
  • Loading branch information
cpovirk authored and Google Java Core Libraries committed Aug 19, 2024
1 parent 7c9455c commit 7810685
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author Louis Wasserman
*/
public class SynchronizedNavigableSetTest extends TestCase {
private static final Object MUTEX = new Integer(1); // something Serializable
private static final Object MUTEX = new Object[0]; // something Serializable

@SuppressWarnings("unchecked")
protected <E> NavigableSet<E> create() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected Queue<String> create() {

private static final class TestQueue<E> implements Queue<E> {
private final Queue<E> delegate = Lists.newLinkedList();
public final Object mutex = new Integer(1); // something Serializable
public final Object mutex = new Object[0]; // something Serializable

@Override
public boolean offer(E o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
* @author Louis Wasserman
*/
public class SynchronizedNavigableSetTest extends TestCase {
private static final Object MUTEX = new Integer(1); // something Serializable
private static final Object MUTEX = new Object[0]; // something Serializable

@SuppressWarnings("unchecked")
protected <E> NavigableSet<E> create() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected Queue<String> create() {

private static final class TestQueue<E> implements Queue<E> {
private final Queue<E> delegate = Lists.newLinkedList();
public final Object mutex = new Integer(1); // something Serializable
public final Object mutex = new Object[0]; // something Serializable

@Override
public boolean offer(E o) {
Expand Down

0 comments on commit 7810685

Please sign in to comment.