manual checkstyle changes

This commit is contained in:
Clebert Suconic 2015-08-10 09:30:55 -04:00
parent bac96047f5
commit 5ac2c2444b
35 changed files with 86 additions and 118 deletions

View File

@ -1567,8 +1567,7 @@ public class Base64 {
// Encode? // Encode?
if (encode) { if (encode) {
buffer[position++] = (byte) theByte; buffer[position++] = (byte) theByte;
if (position >= bufferLength) // Enough to encode. if (position >= bufferLength) { // Enough to encode.
{
out.write(Base64.encode3to4(b4, buffer, bufferLength, options)); out.write(Base64.encode3to4(b4, buffer, bufferLength, options));
lineLength += 4; lineLength += 4;
@ -1586,8 +1585,7 @@ public class Base64 {
// Meaningful Base64 character? // Meaningful Base64 character?
if (decodabet[theByte & 0x7f] > Base64.WHITE_SPACE_ENC) { if (decodabet[theByte & 0x7f] > Base64.WHITE_SPACE_ENC) {
buffer[position++] = (byte) theByte; buffer[position++] = (byte) theByte;
if (position >= bufferLength) // Enough to output. if (position >= bufferLength) { // Enough to output.
{
int len = Base64.decode4to3(buffer, 0, b4, 0, options); int len = Base64.decode4to3(buffer, 0, b4, 0, options);
out.write(b4, 0, len); out.write(b4, 0, len);
// out.write( Base64.decode4to3( buffer ) ); // out.write( Base64.decode4to3( buffer ) );

View File

@ -103,9 +103,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
final List<Interceptor> incomingInterceptors, final List<Interceptor> incomingInterceptors,
final List<Interceptor> outgoingInterceptors, final List<Interceptor> outgoingInterceptors,
final Executor executor, final Executor executor,
final SimpleString nodeID) final SimpleString nodeID) {
{
this(packetDecoder, transportConnection, -1, -1, incomingInterceptors, outgoingInterceptors, false, executor, nodeID); this(packetDecoder, transportConnection, -1, -1, incomingInterceptors, outgoingInterceptors, false, executor, nodeID);
} }
@ -117,9 +115,7 @@ public class RemotingConnectionImpl extends AbstractRemotingConnection implement
final List<Interceptor> outgoingInterceptors, final List<Interceptor> outgoingInterceptors,
final boolean client, final boolean client,
final Executor executor, final Executor executor,
final SimpleString nodeID) final SimpleString nodeID) {
{
super(transportConnection, executor); super(transportConnection, executor);
this.packetDecoder = packetDecoder; this.packetDecoder = packetDecoder;

View File

@ -19,4 +19,5 @@
*/ */
@javax.xml.bind.annotation.XmlSchema( @javax.xml.bind.annotation.XmlSchema(
namespace = "http://activemq.org/schema", namespace = "http://activemq.org/schema",
elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) package org.apache.activemq.artemis.dto; elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.apache.activemq.artemis.dto;

View File

@ -1015,8 +1015,7 @@ public final class JMSBridgeImpl implements JMSBridge {
sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, false, true); sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, false, true);
sourceSession = sourceConn.createSession(true, Session.SESSION_TRANSACTED); sourceSession = sourceConn.createSession(true, Session.SESSION_TRANSACTED);
} }
else // bridging across different servers else { // bridging across different servers
{
// QoS = ONCE_AND_ONLY_ONCE // QoS = ONCE_AND_ONLY_ONCE
if (forwardMode == JMSBridgeImpl.FORWARD_MODE_XA) { if (forwardMode == JMSBridgeImpl.FORWARD_MODE_XA) {
// Create an XASession for consuming from the source // Create an XASession for consuming from the source
@ -1027,8 +1026,7 @@ public final class JMSBridgeImpl implements JMSBridge {
sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, true, true); sourceConn = createConnection(sourceUsername, sourcePassword, sourceCff, clientID, true, true);
sourceSession = ((XAConnection) sourceConn).createXASession(); sourceSession = ((XAConnection) sourceConn).createXASession();
} }
else // QoS = DUPLICATES_OK || AT_MOST_ONCE else { // QoS = DUPLICATES_OK || AT_MOST_ONCE
{
if (JMSBridgeImpl.trace) { if (JMSBridgeImpl.trace) {
ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA source session"); ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA source session");
} }
@ -1068,8 +1066,7 @@ public final class JMSBridgeImpl implements JMSBridge {
targetConn = sourceConn; targetConn = sourceConn;
targetSession = sourceSession; targetSession = sourceSession;
} }
else // bridging across different servers else { // bridging across different servers
{
// QoS = ONCE_AND_ONLY_ONCE // QoS = ONCE_AND_ONLY_ONCE
if (forwardMode == JMSBridgeImpl.FORWARD_MODE_XA) { if (forwardMode == JMSBridgeImpl.FORWARD_MODE_XA) {
if (JMSBridgeImpl.trace) { if (JMSBridgeImpl.trace) {
@ -1082,8 +1079,7 @@ public final class JMSBridgeImpl implements JMSBridge {
targetSession = ((XAConnection) targetConn).createXASession(); targetSession = ((XAConnection) targetConn).createXASession();
} }
else // QoS = DUPLICATES_OK || AT_MOST_ONCE else { // QoS = DUPLICATES_OK || AT_MOST_ONCE
{
if (JMSBridgeImpl.trace) { if (JMSBridgeImpl.trace) {
ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA dest session"); ActiveMQJMSBridgeLogger.LOGGER.trace("Creating non XA dest session");
} }

View File

@ -340,9 +340,7 @@ public class JournalTransaction {
} }
private AtomicInteger internalgetCounter(final JournalFile file) { private AtomicInteger internalgetCounter(final JournalFile file) {
if (lastFile != file) if (lastFile != file) {
{
lastFile = file; lastFile = file;
counter.set(0); counter.set(0);
} }

View File

@ -46,9 +46,7 @@ import org.eclipse.aether.resolution.ArtifactResolutionException;
import org.eclipse.aether.resolution.ArtifactResult; import org.eclipse.aether.resolution.ArtifactResult;
@Mojo(name = "create", defaultPhase = LifecyclePhase.VERIFY) @Mojo(name = "create", defaultPhase = LifecyclePhase.VERIFY)
public class ArtemisCreatePlugin extends ArtemisAbstractPlugin public class ArtemisCreatePlugin extends ArtemisAbstractPlugin {
{
@Parameter @Parameter
String name; String name;

View File

@ -58,7 +58,6 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter {
private ChannelHandlerContext ctx; private ChannelHandlerContext ctx;
private final MQTTLogger log = MQTTLogger.LOGGER; private final MQTTLogger log = MQTTLogger.LOGGER;
;
private boolean stopped = false; private boolean stopped = false;

View File

@ -59,10 +59,8 @@ public class SimpleAMQPConnector implements Connector {
final AMQPClientConnectionContext connection = (AMQPClientConnectionContext) ProtonClientConnectionContextFactory.getFactory().createConnection(clientConnectionSPI); final AMQPClientConnectionContext connection = (AMQPClientConnectionContext) ProtonClientConnectionContextFactory.getFactory().createConnection(clientConnectionSPI);
future.channel().pipeline().addLast(new ChannelDuplexHandler() { future.channel().pipeline().addLast(new ChannelDuplexHandler() {
@Override @Override
public void channelRead(final ChannelHandlerContext ctx, public void channelRead(final ChannelHandlerContext ctx, final Object msg) throws Exception {
final Object msg) throws Exception {
ByteBuf buffer = (ByteBuf) msg; ByteBuf buffer = (ByteBuf) msg;
connection.inputBuffer(buffer); connection.inputBuffer(buffer);
} }

View File

@ -140,9 +140,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
final boolean enableWildCardRouting, final boolean enableWildCardRouting,
final int idCacheSize, final int idCacheSize,
final boolean persistIDCache, final boolean persistIDCache,
final HierarchicalRepository<AddressSettings> addressSettingsRepository) final HierarchicalRepository<AddressSettings> addressSettingsRepository) {
{
this.storageManager = storageManager; this.storageManager = storageManager;
queueFactory = bindableFactory; queueFactory = bindableFactory;

View File

@ -53,8 +53,7 @@ public class ActiveMQSecurityManagerImpl implements ActiveMQSecurityManager {
else if (username == null && password == null) { else if (username == null && password == null) {
return configuration.getDefaultUser() != null; return configuration.getDefaultUser() != null;
} }
else // the only possible case here is user == null, password != null else { // the only possible case here is user == null, password != null
{
logger.debug("Validating default user against a provided password. This happens when username=null, password!=null"); logger.debug("Validating default user against a provided password. This happens when username=null, password!=null");
String defaultUsername = configuration.getDefaultUser(); String defaultUsername = configuration.getDefaultUser();
User defaultUser = configuration.getUser(defaultUsername); User defaultUser = configuration.getUser(defaultUsername);

View File

@ -107,15 +107,14 @@ public class ClosingConnectionTest extends ActiveMQTestBase {
* Test for https://bugzilla.redhat.com/show_bug.cgi?id=1193085 * Test for https://bugzilla.redhat.com/show_bug.cgi?id=1193085
* */ * */
@Test @Test
@BMRules( @BMRules(rules = {
rules = {@BMRule( @BMRule(
name = "rule to kill connection", name = "rule to kill connection",
targetClass = "org.apache.activemq.artemis.core.io.nio.NIOSequentialFile", targetClass = "org.apache.activemq.artemis.core.io.nio.NIOSequentialFile",
targetMethod = "open(int, boolean)", targetMethod = "open(int, boolean)",
targetLocation = "AT INVOKE java.nio.channels.FileChannel.size()", targetLocation = "AT INVOKE java.nio.channels.FileChannel.size()",
action = "org.apache.activemq.artemis.tests.extras.byteman.ClosingConnectionTest.killConnection();" action = "org.apache.activemq.artemis.tests.extras.byteman.ClosingConnectionTest.killConnection();")
})
)})
public void testKillConnection() throws Exception { public void testKillConnection() throws Exception {
locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true); locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setBlockOnAcknowledge(true);

View File

@ -119,7 +119,6 @@ public class OrphanedConsumerTest extends ActiveMQTestBase {
targetLocation = "ENTRY", targetLocation = "ENTRY",
condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()") action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()")
}) })
public void testOrphanedConsumers() throws Exception { public void testOrphanedConsumers() throws Exception {
internalTestOrphanedConsumers(false); internalTestOrphanedConsumers(false);
@ -148,7 +147,6 @@ public class OrphanedConsumerTest extends ActiveMQTestBase {
targetLocation = "ENTRY", targetLocation = "ENTRY",
condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()", condition = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.isConditionActive()",
action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()") action = "org.apache.activemq.artemis.tests.extras.byteman.OrphanedConsumerTest.leavingCloseOnTestCountersWhileClosing()")
}) })
public void testOrphanedConsumersByManagement() throws Exception { public void testOrphanedConsumersByManagement() throws Exception {
internalTestOrphanedConsumers(true); internalTestOrphanedConsumers(true);

View File

@ -1061,9 +1061,8 @@ public class ConsumerWindowSizeTest extends ActiveMQTestBase {
if (count++ == 1) { if (count++ == 1) {
// it will hold here for a while // it will hold here for a while
if (!latchDone.await(TIMEOUT, TimeUnit.SECONDS)) // a timed wait, so if the test fails, one less if (!latchDone.await(TIMEOUT, TimeUnit.SECONDS)) {
// thread around // a timed wait, so if the test fails, one less thread around
{
new Exception("ClientConsuemrWindowSizeTest Handler couldn't receive signal in less than 5 seconds").printStackTrace(); new Exception("ClientConsuemrWindowSizeTest Handler couldn't receive signal in less than 5 seconds").printStackTrace();
failed = true; failed = true;
} }

View File

@ -252,9 +252,7 @@ public class NotificationTest extends ActiveMQTestBase {
} }
m = consumer.receiveImmediate(); m = consumer.receiveImmediate();
if (m != null) { if (m != null) {
for (SimpleString key : m.getPropertyNames()) for (SimpleString key : m.getPropertyNames()) {
{
System.out.println(key + "=" + m.getObjectProperty(key)); System.out.println(key + "=" + m.getObjectProperty(key));
} }
} }

View File

@ -16,6 +16,9 @@
*/ */
package org.apache.activemq.artemis.tests.integration.management; package org.apache.activemq.artemis.tests.integration.management;
import java.util.HashSet;
import java.util.Set;
import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration; import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQException;
import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.SimpleString;
@ -37,9 +40,6 @@ import org.junit.Assert;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import java.util.HashSet;
import java.util.Set;
import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_AUTHENTICATION_VIOLATION; import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_AUTHENTICATION_VIOLATION;
import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_PERMISSION_VIOLATION; import static org.apache.activemq.artemis.api.core.management.CoreNotificationType.SECURITY_PERMISSION_VIOLATION;
@ -183,9 +183,7 @@ public class SecurityNotificationTest extends ActiveMQTestBase {
} }
m = consumer.receiveImmediate(); m = consumer.receiveImmediate();
if (m != null) { if (m != null) {
for (SimpleString key : m.getPropertyNames()) for (SimpleString key : m.getPropertyNames()) {
{
System.out.println(key + "=" + m.getObjectProperty(key)); System.out.println(key + "=" + m.getObjectProperty(key));
} }
} }

View File

@ -16,23 +16,22 @@
*/ */
package org.apache.activemq.artemis.tests.integration.openwire.amq; package org.apache.activemq.artemis.tests.integration.openwire.amq;
import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import javax.jms.Message; import javax.jms.Message;
import javax.jms.MessageConsumer; import javax.jms.MessageConsumer;
import javax.jms.MessageListener; import javax.jms.MessageListener;
import javax.jms.MessageProducer; import javax.jms.MessageProducer;
import javax.jms.Session; import javax.jms.Session;
import javax.jms.TextMessage; import javax.jms.TextMessage;
import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.apache.activemq.ActiveMQMessageConsumer; import org.apache.activemq.ActiveMQMessageConsumer;
import org.apache.activemq.ActiveMQSession; import org.apache.activemq.ActiveMQSession;
import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.artemis.tests.integration.openwire.BasicOpenWireTest; import org.apache.activemq.artemis.tests.integration.openwire.BasicOpenWireTest;
import org.apache.activemq.command.ActiveMQDestination;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Parameterized; import org.junit.runners.Parameterized;

View File

@ -254,9 +254,7 @@ public class JMSTestBase extends ActiveMQTestBase {
ServiceUtils.setTransactionManager(new DummyTransactionManager()); ServiceUtils.setTransactionManager(new DummyTransactionManager());
} }
protected final void receiveMessages(JMSConsumer consumer, final int start, final int msgCount, final boolean ack) protected final void receiveMessages(JMSConsumer consumer, final int start, final int msgCount, final boolean ack) {
{
try { try {
for (int i = start; i < msgCount; i++) { for (int i = start; i < msgCount; i++) {
Message message = consumer.receive(100); Message message = consumer.receive(100);

View File

@ -66,9 +66,7 @@ public class ProxyAssertSupport {
} }
} }
public static void fail(final java.lang.String string) public static void fail(final java.lang.String string) {
{
try { try {
Assert.fail(string); Assert.fail(string);
} }