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

@ -61,7 +61,7 @@ public class ReusableLatch {
} }
public void add() { public void add() {
for (; ; ) { for (;;) {
int actualState = getState(); int actualState = getState();
int newState = actualState + 1; int newState = actualState + 1;
if (compareAndSetState(actualState, newState)) { if (compareAndSetState(actualState, newState)) {
@ -72,7 +72,7 @@ public class ReusableLatch {
@Override @Override
public boolean tryReleaseShared(final int numberOfReleases) { public boolean tryReleaseShared(final int numberOfReleases) {
for (; ; ) { for (;;) {
int actualState = getState(); int actualState = getState();
if (actualState == 0) { if (actualState == 0) {
return true; return true;

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

@ -73,7 +73,7 @@ public final class OrderedExecutorFactory implements ExecutorFactory {
this.parent = parent; this.parent = parent;
runner = new Runnable() { runner = new Runnable() {
public void run() { public void run() {
for (; ; ) { for (;;) {
// Optimization, first try without any locks // Optimization, first try without any locks
Runnable task = tasks.poll(); Runnable task = tasks.poll();
if (task == null) { if (task == null) {

View File

@ -113,7 +113,7 @@ public class JSONArray {
return; return;
} }
x.back(); x.back();
for (; ; ) { for (;;) {
if (x.nextClean() == ',') { if (x.nextClean() == ',') {
x.back(); x.back();
myArrayList.add(null); myArrayList.add(null);

View File

@ -181,7 +181,7 @@ public class JSONObject {
if (x.nextClean() != '{') { if (x.nextClean() != '{') {
throw x.syntaxError("A JSONObject text must begin with '{'"); throw x.syntaxError("A JSONObject text must begin with '{'");
} }
for (; ; ) { for (;;) {
c = x.nextClean(); c = x.nextClean();
switch (c) { switch (c) {
case 0: case 0:

View File

@ -205,7 +205,7 @@ public class JSONTokener {
* @throws JSONException * @throws JSONException
*/ */
public char nextClean() throws JSONException { public char nextClean() throws JSONException {
for (; ; ) { for (;;) {
char c = next(); char c = next();
if (c == 0 || c > ' ') { if (c == 0 || c > ' ') {
return c; return c;
@ -228,7 +228,7 @@ public class JSONTokener {
public String nextString(final char quote) throws JSONException { public String nextString(final char quote) throws JSONException {
char c; char c;
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (; ; ) { for (;;) {
c = next(); c = next();
switch (c) { switch (c) {
case 0: case 0:
@ -281,7 +281,7 @@ public class JSONTokener {
*/ */
public String nextTo(final char d) throws JSONException { public String nextTo(final char d) throws JSONException {
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (; ; ) { for (;;) {
char c = next(); char c = next();
if (c == d || c == 0 || c == '\n' || c == '\r') { if (c == d || c == 0 || c == '\n' || c == '\r') {
if (c != 0) { if (c != 0) {
@ -303,7 +303,7 @@ public class JSONTokener {
public String nextTo(final String delimiters) throws JSONException { public String nextTo(final String delimiters) throws JSONException {
char c; char c;
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
for (; ; ) { for (;;) {
c = next(); c = next();
if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r') { if (delimiters.indexOf(c) >= 0 || c == 0 || c == '\n' || c == '\r') {
if (c != 0) { if (c != 0) {

View File

@ -18,5 +18,6 @@
* The JAXB POJOs for the XML configuration of ActiveMQ Artemis broker * The JAXB POJOs for the XML configuration of ActiveMQ Artemis broker
*/ */
@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

@ -109,7 +109,7 @@ public abstract class AbstractSequentialFile implements SequentialFile {
ByteBuffer buffer = ByteBuffer.allocate(10 * 1024); ByteBuffer buffer = ByteBuffer.allocate(10 * 1024);
for (; ; ) { for (;;) {
buffer.rewind(); buffer.rewind();
int size = this.read(buffer); int size = this.read(buffer);
newFileName.writeDirect(buffer, false); newFileName.writeDirect(buffer, false);

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

@ -72,8 +72,8 @@ public interface ActiveMQJournalLogger extends BasicLogger {
@LogMessage(level = Logger.Level.INFO) @LogMessage(level = Logger.Level.INFO)
@Message(id = 141007, value = "Current File on the journal is <= the sequence file.getFileID={0} on the dataFiles" + @Message(id = 141007, value = "Current File on the journal is <= the sequence file.getFileID={0} on the dataFiles" +
"\nCurrentfile.getFileId={1} while the file.getFileID()={2}" + "\nCurrentfile.getFileId={1} while the file.getFileID()={2}" +
"\nIs same = ({3})", "\nIs same = ({3})",
format = Message.Format.MESSAGE_FORMAT) format = Message.Format.MESSAGE_FORMAT)
void currentFile(Long fileID, Long id, Long fileFileID, Boolean b); void currentFile(Long fileID, Long id, Long fileFileID, Boolean b);

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

@ -33,7 +33,7 @@ public class CreditsSemaphore {
@Override @Override
public int tryAcquireShared(final int numberOfAqcquires) { public int tryAcquireShared(final int numberOfAqcquires) {
for (; ; ) { for (;;) {
int actualSize = getState(); int actualSize = getState();
int newValue = actualSize - numberOfAqcquires; int newValue = actualSize - numberOfAqcquires;
@ -50,7 +50,7 @@ public class CreditsSemaphore {
@Override @Override
public boolean tryReleaseShared(final int numberOfReleases) { public boolean tryReleaseShared(final int numberOfReleases) {
for (; ; ) { for (;;) {
int actualSize = getState(); int actualSize = getState();
int newValue = actualSize + numberOfReleases; int newValue = actualSize + numberOfReleases;
@ -62,7 +62,7 @@ public class CreditsSemaphore {
} }
public void setCredits(final int credits) { public void setCredits(final int credits) {
for (; ; ) { for (;;) {
int actualState = getState(); int actualState = getState();
if (compareAndSetState(actualState, credits)) { if (compareAndSetState(actualState, credits)) {
// This is to wake up any pending threads that could be waiting on queued // This is to wake up any pending threads that could be waiting on queued

View File

@ -56,7 +56,7 @@ public class ReusableLatch {
} }
public void add() { public void add() {
for (; ; ) { for (;;) {
int actualState = getState(); int actualState = getState();
int newState = actualState + 1; int newState = actualState + 1;
if (compareAndSetState(actualState, newState)) { if (compareAndSetState(actualState, newState)) {
@ -67,7 +67,7 @@ public class ReusableLatch {
@Override @Override
public boolean tryReleaseShared(final int numberOfReleases) { public boolean tryReleaseShared(final int numberOfReleases) {
for (; ; ) { for (;;) {
int actualState = getState(); int actualState = getState();
if (actualState == 0) { if (actualState == 0) {
return true; return true;

View File

@ -42,9 +42,9 @@ public class SimpleAMQPConnector implements Connector {
bootstrap.group(new NioEventLoopGroup(10)); bootstrap.group(new NioEventLoopGroup(10));
bootstrap.handler(new ChannelInitializer<Channel>() { bootstrap.handler(new ChannelInitializer<Channel>() {
public void initChannel(Channel channel) throws Exception { public void initChannel(Channel channel) throws Exception {
} }
}); });
} }
public AMQPClientConnectionContext connect(String host, int port) throws Exception { public AMQPClientConnectionContext connect(String host, int port) throws Exception {
@ -59,14 +59,12 @@ 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, final Object msg) throws Exception {
public void channelRead(final ChannelHandlerContext ctx, ByteBuf buffer = (ByteBuf) msg;
final Object msg) throws Exception { connection.inputBuffer(buffer);
ByteBuf buffer = (ByteBuf) msg; }
connection.inputBuffer(buffer); });
}
});
return connection; return connection;
} }

View File

@ -53,7 +53,7 @@ public final class LargeServerMessageInSync implements ReplicatedLargeMessage {
if (appendFile != null) { if (appendFile != null) {
appendFile.close(); appendFile.close();
appendFile.open(); appendFile.open();
for (; ; ) { for (;;) {
buffer.rewind(); buffer.rewind();
int bytesRead = appendFile.read(buffer); int bytesRead = appendFile.read(buffer);
if (bytesRead > 0) if (bytesRead > 0)

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

@ -89,7 +89,7 @@ public class TopicSelectorExample1 {
System.out.println("*************************************************************"); System.out.println("*************************************************************");
System.out.println("MessageConsumer1 will only receive messages where someID=1:"); System.out.println("MessageConsumer1 will only receive messages where someID=1:");
for (; ; ) { for (;;) {
TextMessage messageReceivedA = (TextMessage) messageConsumer1.receive(1000); TextMessage messageReceivedA = (TextMessage) messageConsumer1.receive(1000);
if (messageReceivedA == null) { if (messageReceivedA == null) {
break; break;
@ -103,7 +103,7 @@ public class TopicSelectorExample1 {
// Step 13. Consume the messages from MessageConsumer2, filtering out someID=2 // Step 13. Consume the messages from MessageConsumer2, filtering out someID=2
System.out.println("*************************************************************"); System.out.println("*************************************************************");
System.out.println("MessageConsumer2 will only receive messages where someID=2:"); System.out.println("MessageConsumer2 will only receive messages where someID=2:");
for (; ; ) { for (;;) {
TextMessage messageReceivedB = (TextMessage) messageConsumer2.receive(1000); TextMessage messageReceivedB = (TextMessage) messageConsumer2.receive(1000);
if (messageReceivedB == null) { if (messageReceivedB == null) {
break; break;
@ -117,7 +117,7 @@ public class TopicSelectorExample1 {
// Step 14. Consume the messages from MessageConsumer3, receiving the complete set of messages // Step 14. Consume the messages from MessageConsumer3, receiving the complete set of messages
System.out.println("*************************************************************"); System.out.println("*************************************************************");
System.out.println("MessageConsumer3 will receive every message:"); System.out.println("MessageConsumer3 will receive every message:");
for (; ; ) { for (;;) {
TextMessage messageReceivedC = (TextMessage) messageConsumer3.receive(1000); TextMessage messageReceivedC = (TextMessage) messageConsumer3.receive(1000);
if (messageReceivedC == null) { if (messageReceivedC == null) {
break; break;

View File

@ -140,7 +140,7 @@ public class SlowConsumerTest extends TestCase {
stompSocket.setSoTimeout((int) timeOut); stompSocket.setSoTimeout((int) timeOut);
InputStream is = stompSocket.getInputStream(); InputStream is = stompSocket.getInputStream();
int c = 0; int c = 0;
for (; ; ) { for (;;) {
c = is.read(); c = is.read();
if (c < 0) { if (c < 0) {
throw new IOException("socket closed."); throw new IOException("socket closed.");

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

@ -33,9 +33,9 @@ import org.junit.runner.RunWith;
@RunWith(BMUnitRunner.class) @RunWith(BMUnitRunner.class)
@BMRules(rules = {@BMRule(name = "modify map during iteration", @BMRules(rules = {@BMRule(name = "modify map during iteration",
targetClass = "org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository", targetClass = "org.apache.activemq.artemis.core.settings.impl.HierarchicalObjectRepository",
targetMethod = "getPossibleMatches(String)", targetLocation = "AT INVOKE java.util.HashMap.put", targetMethod = "getPossibleMatches(String)", targetLocation = "AT INVOKE java.util.HashMap.put",
action = "org.apache.activemq.artemis.tests.extras.byteman.HierarchicalObjectRepositoryTest.bum()"),}) action = "org.apache.activemq.artemis.tests.extras.byteman.HierarchicalObjectRepositoryTest.bum()"),})
public class HierarchicalObjectRepositoryTest { public class HierarchicalObjectRepositoryTest {
private static final String A = "a."; private static final String A = "a.";

View File

@ -119,8 +119,7 @@ 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,8 +147,7 @@ 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

@ -195,7 +195,7 @@ public class ManagementWithStompTest extends ManagementTestBase {
stompSocket.setSoTimeout((int) timeOut); stompSocket.setSoTimeout((int) timeOut);
InputStream is = stompSocket.getInputStream(); InputStream is = stompSocket.getInputStream();
int c = 0; int c = 0;
for (; ; ) { for (;;) {
c = is.read(); c = is.read();
if (c < 0) { if (c < 0) {
throw new IOException("socket closed."); throw new IOException("socket closed.");

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;
@ -65,14 +64,14 @@ public class JMSConsumer6Test extends BasicOpenWireTest {
ActiveMQSession session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE); ActiveMQSession session = (ActiveMQSession) connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ActiveMQDestination destination = createDestination(session, destinationType); ActiveMQDestination destination = createDestination(session, destinationType);
MessageConsumer consumer = session.createConsumer(destination, new MessageListener() { MessageConsumer consumer = session.createConsumer(destination, new MessageListener() {
@Override @Override
public void onMessage(Message m) { public void onMessage(Message m) {
counter.incrementAndGet(); counter.incrementAndGet();
if (counter.get() == 4) { if (counter.get() == 4) {
done.countDown(); done.countDown();
} }
} }
}); });
assertNotNull(consumer); assertNotNull(consumer);
// Send the messages // Send the messages

View File

@ -115,7 +115,7 @@ public class ConcurrentStompTest extends StompTestBase {
socket.setSoTimeout((int) timeOut); socket.setSoTimeout((int) timeOut);
InputStream is = socket.getInputStream(); InputStream is = socket.getInputStream();
int c = 0; int c = 0;
for (; ; ) { for (;;) {
c = is.read(); c = is.read();
if (c < 0) { if (c < 0) {
throw new IOException("socket closed."); throw new IOException("socket closed.");

View File

@ -59,7 +59,7 @@ public class ActiveMQFrameDecoder2Test extends ActiveMQTestBase {
int cnt = 0; int cnt = 0;
for (ByteBuf p : packets) { for (ByteBuf p : packets) {
decoder.writeInbound(p); decoder.writeInbound(p);
for (; ; ) { for (;;) {
ByteBuf frame = (ByteBuf) decoder.readInbound(); ByteBuf frame = (ByteBuf) decoder.readInbound();
if (frame == null) { if (frame == null) {
break; break;

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);
} }

View File

@ -147,7 +147,7 @@ public class StompStressTest extends ActiveMQTestBase {
stompSocket.setSoTimeout((int) timeOut); stompSocket.setSoTimeout((int) timeOut);
InputStream is = stompSocket.getInputStream(); InputStream is = stompSocket.getInputStream();
int c = 0; int c = 0;
for (; ; ) { for (;;) {
c = is.read(); c = is.read();
if (c < 0) { if (c < 0) {
throw new IOException("socket closed."); throw new IOException("socket closed.");