This commit is contained in:
Clebert Suconic 2019-02-20 17:11:59 -05:00
commit 951a061555
15 changed files with 27 additions and 39 deletions

View File

@ -43,7 +43,7 @@ public interface ClientSession extends XAResource, AutoCloseable {
*
* @see ClientSession#addressQuery(SimpleString)
*/
public interface AddressQuery {
interface AddressQuery {
/**
* Returns <code>true</code> if the binding exists, <code>false</code> else.
@ -87,7 +87,7 @@ public interface ClientSession extends XAResource, AutoCloseable {
*
* @see ClientSession#queueQuery(SimpleString)
*/
public interface QueueQuery {
interface QueueQuery {
/**
* Returns <code>true</code> if the queue exists, <code>false</code> else.

View File

@ -19,5 +19,5 @@ package org.apache.activemq.artemis.api.core.client;
public enum FailoverEventType {
FAILURE_DETECTED,
FAILOVER_COMPLETED,
FAILOVER_FAILED;
FAILOVER_FAILED
}

View File

@ -1496,8 +1496,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
@Override
public ClientProducerCredits getCredits(final SimpleString address, final boolean anon) {
synchronized (producerCreditManager) {
ClientProducerCredits credits = producerCreditManager.getCredits(address, anon, sessionContext);
return credits;
return producerCreditManager.getCredits(address, anon, sessionContext);
}
}
@ -1574,7 +1573,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
} catch (Throwable t) {
ActiveMQClientLogger.LOGGER.failoverDuringCommit();
XAException xaException = null;
XAException xaException;
if (onePhase) {
logger.debug("Throwing oneFase RMFAIL on xid=" + xid, t);
//we must return XA_RMFAIL
@ -2020,8 +2019,7 @@ public final class ClientSessionImpl implements ClientSessionInternal, FailureLi
private ClientConsumerInternal getConsumer(final ConsumerContext consumerContext) {
synchronized (consumers) {
ClientConsumerInternal consumer = consumers.get(consumerContext);
return consumer;
return consumers.get(consumerContext);
}
}

View File

@ -741,8 +741,7 @@ public class LargeMessageControllerImpl implements LargeMessageController {
}
public int readInt(final int pos) {
int v = getInt(pos);
return v;
return getInt(pos);
}
@Override

View File

@ -317,8 +317,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
private static DiscoveryGroup createDiscoveryGroup(String nodeID,
DiscoveryGroupConfiguration config) throws Exception {
DiscoveryGroup group = new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
return group;
return new DiscoveryGroup(nodeID, config.getName(), config.getRefreshTimeout(), config.getBroadcastEndpointFactory(), null);
}
private ServerLocatorImpl(final Topology topology,
@ -333,7 +332,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
this.discoveryGroupConfiguration = discoveryGroupConfiguration;
this.initialConnectors = transportConfigs != null ? transportConfigs : null;
this.initialConnectors = transportConfigs;
this.nodeID = UUIDGenerator.getInstance().generateStringUUID();
@ -672,8 +671,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
if (topologyMember.getLive() == null && topologyMember.getBackup() != null) {
// This shouldn't happen, however I wanted this to consider all possible cases
ClientSessionFactoryInternal factory = (ClientSessionFactoryInternal) createSessionFactory(topologyMember.getBackup());
return factory;
return (ClientSessionFactoryInternal) createSessionFactory(topologyMember.getBackup());
}
// it shouldn't happen
return null;
@ -1854,8 +1852,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
private Object writeReplace() throws ObjectStreamException {
ServerLocatorImpl clone = new ServerLocatorImpl(this);
return clone;
return new ServerLocatorImpl(this);
}
public boolean isReceivedTopology() {

View File

@ -190,9 +190,7 @@ public final class DiscoveryGroup implements ActiveMQComponent {
}
public synchronized List<DiscoveryEntry> getDiscoveryEntries() {
List<DiscoveryEntry> list = new ArrayList<>(connectors.values());
return list;
return new ArrayList<>(connectors.values());
}
public boolean waitForBroadcast(final long timeout) {

View File

@ -571,11 +571,9 @@ public final class ChannelImpl implements Channel {
// And switch it
final CoreRemotingConnection rnewConnection = newConnection;
newConnection.putChannel(id, this);
rnewConnection.putChannel(id, this);
connection = rnewConnection;
connection = newConnection;
transferring = true;
}

View File

@ -288,7 +288,7 @@ public class SSLSupport {
return new URL(storePath);
} catch (MalformedURLException e) {
File file = new File(storePath);
if (file.exists() == true && file.isFile()) {
if (file.exists() && file.isFile()) {
return file.toURI().toURL();
} else {
URL url = findResource(storePath);

View File

@ -17,5 +17,5 @@
package org.apache.activemq.artemis.core.settings.impl;
public enum AddressFullMessagePolicy {
DROP, PAGE, BLOCK, FAIL;
DROP, PAGE, BLOCK, FAIL
}

View File

@ -71,7 +71,7 @@ public class DeflaterReader extends InputStream {
//buffer for reading input stream
byte[] readBuffer = new byte[2 * len];
int n = 0;
int n;
int read = 0;
while (len > 0) {

View File

@ -78,7 +78,7 @@ public class InflaterReader extends InputStream {
*/
private int doRead(byte[] buf, int offset, int len) throws DataFormatException, IOException {
int read = 0;
int n = 0;
int n;
byte[] inputBuffer = new byte[len];
while (len > 0) {

View File

@ -56,11 +56,11 @@ public class MemorySize {
MemorySize.newObject(factory);
int i = 0;
long heap1 = 0;
long heap2 = 0;
long totalMemory1 = 0;
long totalMemory2 = 0;
int i;
long heap1;
long heap2;
long totalMemory1;
long totalMemory2;
// First we do a dry run with twice as many then throw away the results

View File

@ -308,7 +308,7 @@ public class SoftValueHashMap<K, V extends SoftValueHashMap.ValueCache> implemen
@SuppressWarnings("unchecked")
private void processQueue() {
AggregatedSoftReference ref = null;
AggregatedSoftReference ref;
while ((ref = (AggregatedSoftReference) this.refQueue.poll()) != null) {
logger.tracef("Removing reference through processQueue:: %s", ref.get());
mapDelegate.remove(ref.key);
@ -316,8 +316,7 @@ public class SoftValueHashMap<K, V extends SoftValueHashMap.ValueCache> implemen
}
private AggregatedSoftReference createReference(final K key, final V value) {
AggregatedSoftReference ref = new AggregatedSoftReference(key, value);
return ref;
return new AggregatedSoftReference(key, value);
}
// Inner classes -------------------------------------------------

View File

@ -116,7 +116,7 @@ public final class XMLUtil {
}
}
String textContent = null;
String textContent;
NodeList children = n.getChildNodes();
if (children.getLength() == 0) {

View File

@ -43,8 +43,7 @@ public class XidCodecSupport {
in.readBytes(bq);
byte[] gtxid = new byte[in.readInt()];
in.readBytes(gtxid);
Xid xid = new XidImpl(bq, formatID, gtxid);
return xid;
return new XidImpl(bq, formatID, gtxid);
}
public static int getXidEncodeLength(final Xid xid) {