Skip to content

Commit

Permalink
ARTEMIS-5233 make style for commas consistent
Browse files Browse the repository at this point in the history
This commit enforces a consistent style for commas, namely that a space
should follow a comma. Futhermore, it update all the code that violates
this styling up to date so that the code is styled consistently across
the entire code-base.
  • Loading branch information
jbertram committed Jan 8, 2025
1 parent f1088d8 commit 2e329c1
Show file tree
Hide file tree
Showing 88 changed files with 231 additions and 228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ public Object run(ActionContext context) throws Exception {
if (noMqttAcceptor) {
filters.put("${mqtt-acceptor}", "");
} else {
filters.put("${mqtt-acceptor}",readTextFile(ETC_MQTT_ACCEPTOR_TXT, filters));
filters.put("${mqtt-acceptor}", readTextFile(ETC_MQTT_ACCEPTOR_TXT, filters));
}

if (noStompAcceptor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private void appendJsonIntervalSampleOnFile(final boolean warmup, final ReportIn
jsonBuilder.add("sampleType", "interval");
jsonBuilder.add("warmup", warmup);
jsonBuilder.add("time", sampleTime);
addRate(jsonBuilder,"sent", sentMsg, interval);
addRate(jsonBuilder, "sent", sentMsg, interval);
addRate(jsonBuilder, "delayed", blockedMsg, interval);
addRate(jsonBuilder, "completed", completedMsg, interval);
addRate(jsonBuilder, "received", receivedMsg, interval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2288,7 +2288,7 @@ private String getStoredPassword(String user, File userFile, boolean basicSecuri
}

private boolean checkPassword(String user, String password, File userFile) throws Exception {
return checkPassword(user, password, userFile,false);
return checkPassword(user, password, userFile, false);
}

private boolean checkPassword(String user, String password, File userFile, boolean basicSecurityManager) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static ActiveMQBuffer dynamicBuffer(final int size) {
}

public static ActiveMQBuffer pooledBuffer(final int size) {
return new ChannelBufferWrapper(ALLOCATOR.heapBuffer(size),true, true);
return new ChannelBufferWrapper(ALLOCATOR.heapBuffer(size), true, true);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ public ActiveMQBuffer readSlice(final int length) {
int read = fromBuffer.readerIndex();
int writ = fromBuffer.writerIndex();
fromBuffer.readerIndex(0);
fromBuffer.readBytes(newNettyBuffer,0,writ);
newNettyBuffer.setIndex(read,writ);
ActiveMQBuffer returnBuffer = new ChannelBufferWrapper(newNettyBuffer,releasable,false);
returnBuffer.setIndex(read,writ);
fromBuffer.readBytes(newNettyBuffer, 0, writ);
newNettyBuffer.setIndex(read, writ);
ActiveMQBuffer returnBuffer = new ChannelBufferWrapper(newNettyBuffer, releasable, false);
returnBuffer.setIndex(read, writ);
return returnBuffer;
}
return new ChannelBufferWrapper(buffer.readSlice(length), releasable, isPooled);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ protected String getFromEnv(final String envVarName) {
}

public static String envVarNameFromSystemPropertyName(final String systemPropertyName) {
return systemPropertyName.replace(".","_").toUpperCase(Locale.getDefault());
return systemPropertyName.replace(".", "_").toUpperCase(Locale.getDefault());
}

private static class PBKDF2Algorithm extends CodecAlgorithm {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
* @param <K> the key type.
* @param <V> the value type.
*/
public class NoOpMap<K,V> extends AbstractMap<K,V> {
public class NoOpMap<K, V> extends AbstractMap<K, V> {

private static final Map NO_OP_MAP = new NoOpMap<>();

@SuppressWarnings("unchecked")
public static <K,V> Map<K,V> instance() {
return (Map<K,V>) NO_OP_MAP;
public static <K, V> Map<K, V> instance() {
return (Map<K, V>) NO_OP_MAP;
}

private NoOpMap() {
Expand Down Expand Up @@ -84,7 +84,7 @@ public Collection<V> values() {
}

@Override
public Set<Entry<K,V>> entrySet() {
public Set<Entry<K, V>> entrySet() {
return Collections.emptySet();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void testMultipleSizeAdd() throws Exception {

@Test
public void testMaxElements() {
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 10,10);
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 10, 10);

AtomicBoolean over = new AtomicBoolean(false);
metric.setOverCallback(() -> over.set(true));
Expand All @@ -255,8 +255,8 @@ public void testMaxElements() {
}
@Test
public void testMaxElementsReleaseNonSizeParentMetric() {
SizeAwareMetric metricMain = new SizeAwareMetric(10000, 500, 10,10);
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 1000,1000);
SizeAwareMetric metricMain = new SizeAwareMetric(10000, 500, 10, 10);
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 1000, 1000);

metric.setOnSizeCallback(metricMain::addSize);

Expand Down Expand Up @@ -303,7 +303,7 @@ public void testMaxElementsReleaseNonSizeParentMetric() {

@Test
public void testMaxElementsReleaseNonSize() {
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 10,10);
SizeAwareMetric metric = new SizeAwareMetric(10000, 500, 10, 10);

AtomicBoolean over = new AtomicBoolean(false);
metric.setOverCallback(() -> over.set(true));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public ClientSessionFactory createSessionFactory(final TransportConfiguration tr

initialize();

ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(this, transportConfiguration, config, reconnectAttempts, threadPool, scheduledThreadPool, flowControlThreadPool,incomingInterceptors, outgoingInterceptors);
ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(this, transportConfiguration, config, reconnectAttempts, threadPool, scheduledThreadPool, flowControlThreadPool, incomingInterceptors, outgoingInterceptors);

addToConnecting(factory);
try {
Expand Down Expand Up @@ -1855,7 +1855,7 @@ private synchronized void createConnectors() {
connectors = new ArrayList<>();
if (initialConnectors != null) {
for (TransportConfiguration initialConnector : initialConnectors) {
ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(ServerLocatorImpl.this, initialConnector, config, config.reconnectAttempts, threadPool, scheduledThreadPool,flowControlThreadPool, incomingInterceptors, outgoingInterceptors);
ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(ServerLocatorImpl.this, initialConnector, config, config.reconnectAttempts, threadPool, scheduledThreadPool, flowControlThreadPool, incomingInterceptors, outgoingInterceptors);

connectors.add(new Connector(initialConnector, factory));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public SessionQueueQueryResponseMessage_V3(final QueueQueryResult result) {
}

public SessionQueueQueryResponseMessage_V3() {
this(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, -1, null, null,null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
this(null, null, false, false, null, 0, 0, false, false, false, false, RoutingType.MULTICAST, -1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
}

private SessionQueueQueryResponseMessage_V3(final SimpleString name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static void autoCreateQueue(ClientSession session, SimpleString destAddr
QueueConfiguration queueConfiguration = QueueConfiguration.of(queueName)
.setAutoCreated(true)
.setAddress(destAddress);
setRequiredQueueConfigurationIfNotSet(queueConfiguration,response, RoutingType.ANYCAST, selectorString, true);
setRequiredQueueConfigurationIfNotSet(queueConfiguration, response, RoutingType.ANYCAST, selectorString, true);
session.createQueue(queueConfiguration);
logger.debug("The queue {} was created automatically", destAddress);
} catch (ActiveMQQueueExistsException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void writeDirect(final ByteBuffer bytes, final boolean sync) throws Excep
}

@Override
public void blockingWriteDirect(ByteBuffer bytes,boolean sync, boolean releaseBuffer) throws Exception {
public void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception {
logger.trace("Write Direct, Sync: true File: {}", getFileName());

final SimpleWaitIOCallback completion = new SimpleWaitIOCallback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void delete() throws IOException, InterruptedException, ActiveMQException
}

@Override
public void blockingWriteDirect(ByteBuffer bytes,boolean sync, boolean releaseBuffer) throws Exception {
public void blockingWriteDirect(ByteBuffer bytes, boolean sync, boolean releaseBuffer) throws Exception {
this.sequentialFile.blockingWriteDirect(bytes, sync, releaseBuffer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2843,7 +2843,7 @@ public synchronized void start() {
if (providedIOThreadPool == null) {
ThreadFactory factory = AccessController.doPrivileged((PrivilegedAction<ThreadFactory>) () -> new ActiveMQThreadFactory("ArtemisIOThread", true, JournalImpl.class.getClassLoader()));

threadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L,TimeUnit.SECONDS, new SynchronousQueue(), factory);
threadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60L, TimeUnit.SECONDS, new SynchronousQueue(), factory);
ioExecutorFactory = new OrderedExecutorFactory(threadPool);
} else {
ioExecutorFactory = providedIOThreadPool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public void verifyLayoutInZK() throws Exception {
}

private void dumpZK(ZooKeeper zooKeeper, String path, List<String> entries) throws InterruptedException, KeeperException {
List<String> children = ZKPaths.getSortedChildren(zooKeeper,path);
List<String> children = ZKPaths.getSortedChildren(zooKeeper, path);
for (String s: children) {
if (!s.equals("zookeeper")) {
String qualifiedPath = (path.endsWith("/") ? path : path + "/") + s;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ public void testBodyOnlyMessage() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}
totalDuration += System.nanoTime() - startTime;

Expand All @@ -97,15 +97,15 @@ public void testMessageWithNoPropertiesOrAnnotations() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}
totalDuration += System.nanoTime() - startTime;

Expand All @@ -119,15 +119,15 @@ public void testTypicalQpidJMSMessage() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}
totalDuration += System.nanoTime() - startTime;

Expand All @@ -142,15 +142,15 @@ public void testComplexQpidJMSMessage() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}
totalDuration += System.nanoTime() - startTime;

Expand All @@ -165,15 +165,15 @@ public void testTypicalQpidJMSMessageInBoundOnly() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

totalDuration += System.nanoTime() - startTime;
Expand All @@ -188,15 +188,15 @@ public void testTypicalQpidJMSMessageOutBoundOnly() throws Exception {
// Warm up
for (int i = 0; i < WARM_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

long totalDuration = 0;

long startTime = System.nanoTime();
for (int i = 0; i < PROFILE_CYCLES; ++i) {
ICoreMessage intermediate = encoded.toCore();
encode(AMQPConverter.getInstance().fromCore(intermediate,null));
encode(AMQPConverter.getInstance().fromCore(intermediate, null));
}

totalDuration += System.nanoTime() - startTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class OpenWireMessageConverterTest {

final OpenWireFormatFactory formatFactory = new OpenWireFormatFactory();
final WireFormat openWireFormat = formatFactory.createWireFormat();
final byte[] content = new byte[] {'a','a'};
final byte[] content = new byte[] {'a', 'a'};
final String address = "Q";
final ActiveMQDestination destination = new ActiveMQQueue(address);
final UUID nodeUUID = UUIDGenerator.getInstance().generateUUID();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public void testActorStateVisibility() throws Exception {
Mockito.doReturn(serverSession).when(server).createSession(Mockito.anyString(), Mockito.any(), Mockito.any(), Mockito.anyInt(), Mockito.any(), Mockito.anyBoolean(), Mockito.anyBoolean(), Mockito.anyBoolean(),
Mockito.anyBoolean(), Mockito.any(), Mockito.any(), Mockito.anyBoolean(), Mockito.any(), Mockito.any(), Mockito.anyString(), Mockito.any(), Mockito.anyBoolean());

OpenWireProtocolManager openWireProtocolManager = new OpenWireProtocolManager(null, server,null, null);
OpenWireProtocolManager openWireProtocolManager = new OpenWireProtocolManager(null, server, null, null);
openWireProtocolManager.setSecurityDomain("securityDomain");
openWireProtocolManager.setSupportAdvisory(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ public static HAPolicy getHAPolicy(HAPolicyConfiguration conf,
HAPolicy primaryPolicy;
//if null default to colocated
if (primaryConfig == null) {
primaryPolicy = new ReplicatedPolicy(server.getNetworkHealthCheck(),ActiveMQDefaultConfiguration.getDefaultQuorumVoteWait());
primaryPolicy = new ReplicatedPolicy(server.getNetworkHealthCheck(), ActiveMQDefaultConfiguration.getDefaultQuorumVoteWait());
} else {
primaryPolicy = getHAPolicy(primaryConfig, server);
}
HAPolicyConfiguration backupConf = pc.getBackupConfig();
BackupPolicy backupPolicy;
if (backupConf == null) {
if (primaryPolicy instanceof ReplicatedPolicy) {
backupPolicy = new ReplicaPolicy(server.getNetworkHealthCheck(),ActiveMQDefaultConfiguration.getDefaultQuorumVoteWait());
backupPolicy = new ReplicaPolicy(server.getNetworkHealthCheck(), ActiveMQDefaultConfiguration.getDefaultQuorumVoteWait());
} else if (primaryPolicy instanceof SharedStorePrimaryPolicy) {
backupPolicy = new SharedStoreBackupPolicy();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ protected static String extractPropertyClassName(String property) {
return property.substring(0, property.length() - PROPERTY_CLASS_SUFFIX.length());
}

private void trackError(HashMap<String, String> errors, Map.Entry<String,?> entry, Throwable oops) {
private void trackError(HashMap<String, String> errors, Map.Entry<String, ?> entry, Throwable oops) {
logger.debug("failed to populate property entry({}), reason: {}", entry, oops);
errors.put(entry.toString(), oops.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public void addDataSourceProperty(String key, String value) {
}
}

public Map<String,Object> getDataSourceProperties() {
public Map<String, Object> getDataSourceProperties() {
return dataSourceProperties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2194,7 +2194,7 @@ private void parseAMQPBrokerConnections(final Element e,

if (nodeType == AMQPBrokerConnectionAddressType.MIRROR) {
boolean messageAcks = getBooleanAttribute(e2, "message-acknowledgements", true);
boolean queueCreation = getBooleanAttribute(e2,"queue-creation", true);
boolean queueCreation = getBooleanAttribute(e2, "queue-creation", true);
boolean durable = getBooleanAttribute(e2, "durable", true);
boolean queueRemoval = getBooleanAttribute(e2, "queue-removal", true);
boolean sync = getBooleanAttribute(e2, "sync", false);
Expand Down Expand Up @@ -2813,7 +2813,7 @@ private FederationDownstreamConfiguration getDownstream(final Element downstream
final FederationDownstreamConfiguration downstreamConfiguration =
getFederationStream(new FederationDownstreamConfiguration(), downstreamNode, mainConfig);

final String upstreamRef = getString(downstreamNode,"upstream-connector-ref", null, NOT_NULL_OR_EMPTY);
final String upstreamRef = getString(downstreamNode, "upstream-connector-ref", null, NOT_NULL_OR_EMPTY);
downstreamConfiguration.setUpstreamConfigurationRef(upstreamRef);

return downstreamConfiguration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ protected synchronized void init(Configuration config, IOCriticalErrorListener c
sqlProviderFactory.create(dbConf.getBindingsTableName(), SQLProvider.DatabaseStoreType.BINDINGS_JOURNAL),
scheduledExecutorService,
executorFactory.getExecutor(),
criticalErrorListener,dbConf.getJdbcJournalSyncPeriodMillis());
criticalErrorListener, dbConf.getJdbcJournalSyncPeriodMillis());
messageJournal = new JDBCJournalImpl(
connectionProvider,
sqlProviderFactory.create(dbConf.getMessageTableName(), SQLProvider.DatabaseStoreType.MESSAGE_JOURNAL),
Expand Down
Loading

0 comments on commit 2e329c1

Please sign in to comment.