Skip to content

Commit

Permalink
7414: Avoid volatile writes from Atomics default values
Browse files Browse the repository at this point in the history
Reviewed-by: hirt
  • Loading branch information
dreis2211 authored and thegreystone committed Oct 4, 2021
1 parent 085a4a6 commit 14b8357
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import org.openjdk.jmc.agent.test.util.TestToolkit;

public class TestConverterTransforms {
private static AtomicInteger runCount = new AtomicInteger(0);
private static AtomicInteger runCount = new AtomicInteger();

public static String getTemplate() throws IOException {
return TestToolkit.readTemplate(TestConverterTransforms.class, TestToolkit.DEFAULT_TEMPLATE_NAME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
import org.openjdk.jmc.agent.test.util.TestToolkit;

public class TestJFRTransformer {
private static AtomicInteger runCount = new AtomicInteger(0);
private static AtomicInteger runCount = new AtomicInteger();

@Test
public void testRunTransforms()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class RJMXConnection implements Closeable, IMBeanHelperService {
*/
private static final long VALUE_RECALIBRATION_INTERVAL = 120000;
private static final long REMOTE_START_TIME_UNDEFINED = -1;
private static final AtomicInteger CONNECTION_COUNTER = new AtomicInteger(0);
private static final AtomicInteger CONNECTION_COUNTER = new AtomicInteger();

// The ConnectionDescriptor used to create this RJMXConnection
private final IConnectionDescriptor m_connectionDescriptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.openjdk.jmc.rjmx.subscription.internal.AbstractSyntheticNotification;

public class TestNotification extends AbstractSyntheticNotification {
private final static AtomicInteger THREAD_ID_PROVIDER = new AtomicInteger(0);
private final static AtomicInteger THREAD_ID_PROVIDER = new AtomicInteger();
private final int notificationId = THREAD_ID_PROVIDER.getAndIncrement();
private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor(new ThreadFactory() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ protected WeakReference<Chunk> initialValue() {

private final OutputStream outputStream;

private final AtomicBoolean closed = new AtomicBoolean(false);
private final AtomicBoolean closed = new AtomicBoolean();

private final BlockingDeque<LEB128Writer> chunkDataQueue = new LinkedBlockingDeque<>();
private final ExecutorService chunkDataMergingService = Executors.newSingleThreadExecutor();
Expand Down

0 comments on commit 14b8357

Please sign in to comment.