From d9f53a27a13214ada661655ef3459cae2e59d883 Mon Sep 17 00:00:00 2001 From: Gunnar Hillert Date: Tue, 26 Mar 2013 17:56:55 -0400 Subject: [PATCH] AMQP-303 - Improve Rules Compliance (Sonar) --- .../amqp/core/BindingBuilder.java | 4 +- .../springframework/amqp/core/Message.java | 5 +- .../amqp/core/MessageProperties.java | 5 +- .../converter/AbstractMessageConverter.java | 6 +- .../erlang/core/ConnectionCallback.java | 6 +- .../springframework/util/exec/Background.java | 22 +++--- .../springframework/util/exec/Execute.java | 23 ++++--- .../util/exec/PumpStreamHandler.java | 7 +- .../util/exec/StreamPumper.java | 68 +++++++++---------- .../config/FederatedExchangeParser.java | 4 +- .../amqp/rabbit/config/QueueParser.java | 5 +- .../connection/AbstractConnectionFactory.java | 4 +- .../connection/CachingConnectionFactory.java | 15 ++-- .../amqp/rabbit/connection/RabbitUtils.java | 4 +- .../amqp/rabbit/core/ChannelCallback.java | 6 +- .../amqp/rabbit/core/RabbitTemplate.java | 11 ++- .../listener/BlockingQueueConsumer.java | 4 +- .../SimpleMessageListenerContainer.java | 2 +- .../rabbit/retry/MissingMessageIdAdvice.java | 4 +- .../support/PublisherCallbackChannel.java | 6 +- 20 files changed, 118 insertions(+), 93 deletions(-) diff --git a/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java b/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java index 0cf44341..e4a80d61 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/core/BindingBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -151,7 +151,7 @@ public final class BindingBuilder { } } - private static abstract class AbstractRoutingKeyConfigurer { + private abstract static class AbstractRoutingKeyConfigurer { protected final DestinationConfigurer destination; diff --git a/spring-amqp/src/main/java/org/springframework/amqp/core/Message.java b/spring-amqp/src/main/java/org/springframework/amqp/core/Message.java index 60fb8d6e..9e58eb11 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/core/Message.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/core/Message.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -86,7 +86,8 @@ public class Message { } catch (Exception e) { // ignore } - return body.toString()+"(byte["+body.length+"])"; // Comes out as '[B@....b' (so harmless) + // Comes out as '[B@....b' (so harmless) + return body.toString()+"(byte["+body.length+"])"; } } diff --git a/spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java b/spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java index fd483afb..5912813e 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/core/MessageProperties.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -40,7 +40,7 @@ public class MessageProperties { private static final MessageDeliveryMode DEFAULT_DELIVERY_MODE = MessageDeliveryMode.PERSISTENT; - private static final Integer DEFAULT_PRIORITY = new Integer(0); + private static final Integer DEFAULT_PRIORITY = Integer.valueOf(0); private final Map headers = new HashMap(); @@ -135,7 +135,6 @@ public class MessageProperties { // qpid 1.0 .NET: is not present public void setClusterId(String clusterId) { this.clusterId = clusterId; - ; } public String getClusterId() { diff --git a/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractMessageConverter.java b/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractMessageConverter.java index ce3ef6e7..fc74efbf 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractMessageConverter.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/support/converter/AbstractMessageConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -64,8 +64,8 @@ public abstract class AbstractMessageConverter implements MessageConverter { * @param messageProperties the message properties (headers) * @return a message */ - abstract protected Message createMessage(Object object, MessageProperties messageProperties); + protected abstract Message createMessage(Object object, MessageProperties messageProperties); - abstract public Object fromMessage(Message message) throws MessageConversionException; + public abstract Object fromMessage(Message message) throws MessageConversionException; } \ No newline at end of file diff --git a/spring-erlang/src/main/java/org/springframework/erlang/core/ConnectionCallback.java b/spring-erlang/src/main/java/org/springframework/erlang/core/ConnectionCallback.java index 11760a4f..85c22973 100644 --- a/spring-erlang/src/main/java/org/springframework/erlang/core/ConnectionCallback.java +++ b/spring-erlang/src/main/java/org/springframework/erlang/core/ConnectionCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ public interface ConnectionCallback { /** * Execute any number of operations against the supplied OTP connection, * possibly returning a result. + * + * @throws Exception We are not sure everything it throws */ - T doInConnection(Connection connection) throws Exception; //Not sure everything it throws + T doInConnection(Connection connection) throws Exception; } diff --git a/spring-erlang/src/main/java/org/springframework/util/exec/Background.java b/spring-erlang/src/main/java/org/springframework/util/exec/Background.java index 32d062c4..a0f91948 100644 --- a/spring-erlang/src/main/java/org/springframework/util/exec/Background.java +++ b/spring-erlang/src/main/java/org/springframework/util/exec/Background.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,12 +33,15 @@ public class Background { throws IOException { File devNull; - if(Os.isFamily("unix")) + if(Os.isFamily("unix")) { devNull = new File("/dev/null"); - else if (Os.isFamily("windows")) + } + else if (Os.isFamily("windows")) { devNull = new File("NUL"); - else + } + else { throw new IllegalStateException("Unhandled Java environment"); + } exec(cmd, devNull, false, devNull, false); } @@ -57,12 +60,15 @@ public class Background { File errFile, boolean appendErr) throws IOException { - if(Os.isFamily("unix")) + if(Os.isFamily("unix")) { execUnix(cmd, outFile, appendOut, errFile, appendErr); - else if (Os.isFamily("windows")) + } + else if (Os.isFamily("windows")) { execWin(cmd, outFile, appendOut, errFile, appendErr); - else + } + else { throw new IllegalStateException("Unhandled Java environment"); + } } private static void execUnix(String[] cmd, @@ -95,7 +101,7 @@ public class Background { p.waitFor(); } catch(Exception exc){ throw new IOException("Unable to properly background process: " + - exc.getMessage()); + exc.getMessage(), exc); } } diff --git a/spring-erlang/src/main/java/org/springframework/util/exec/Execute.java b/spring-erlang/src/main/java/org/springframework/util/exec/Execute.java index 4b7fec31..f5868cc8 100644 --- a/spring-erlang/src/main/java/org/springframework/util/exec/Execute.java +++ b/spring-erlang/src/main/java/org/springframework/util/exec/Execute.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -38,7 +38,7 @@ public class Execute { private static Log log = LogFactory.getLog(Execute.class); /** Invalid exit code. **/ - public final static int INVALID = Integer.MAX_VALUE; + public static final int INVALID = Integer.MAX_VALUE; private String[] cmdl = null; private String[] env = null; @@ -55,8 +55,10 @@ public class Execute { * Find the list of environment variables for this process. */ public static synchronized Vector getProcEnvironment() { - if (procEnvironment != null) + + if (procEnvironment != null) { return procEnvironment; + } procEnvironment = new Vector(); try { @@ -188,8 +190,9 @@ public class Execute { * @return the environment used to create a subprocess */ public String[] getEnvironment() { - if (env == null || newEnvironment) + if (env == null || newEnvironment) { return env; + } return patchEnvironment(); } @@ -258,8 +261,9 @@ public class Execute { } if (watchdog != null) { Exception ex = watchdog.getException(); - if (ex != null) + if (ex != null) { throw ex; + } } int exit = getExitValue(); @@ -276,11 +280,13 @@ public class Execute { } private String array2string(String sa[]) { - if (sa == null) + if (sa == null) { return "null"; + } StringBuffer sb = new StringBuffer(); - for (int i = 0; i < sa.length; i++) + for (int i = 0; i < sa.length; i++) { sb.append(sa[i]).append(" "); + } return sb.toString(); } @@ -381,8 +387,9 @@ public class Execute { } exec.setNewenvironment(false); - if (baseDir != null) + if (baseDir != null) { exec.setWorkingDirectory(baseDir); + } exec.execute(); int status = exec.getExitValue(); diff --git a/spring-erlang/src/main/java/org/springframework/util/exec/PumpStreamHandler.java b/spring-erlang/src/main/java/org/springframework/util/exec/PumpStreamHandler.java index 0fcf9f5f..0cadbd8e 100644 --- a/spring-erlang/src/main/java/org/springframework/util/exec/PumpStreamHandler.java +++ b/spring-erlang/src/main/java/org/springframework/util/exec/PumpStreamHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.springframework.util.exec; import java.io.InputStream; @@ -71,7 +70,9 @@ public class PumpStreamHandler implements ExecuteStreamHandler { public void stop() { - if( ! running ) return; + if( !running ) { + return; + } try { inputThread.join(1000); } catch(InterruptedException e) {} diff --git a/spring-erlang/src/main/java/org/springframework/util/exec/StreamPumper.java b/spring-erlang/src/main/java/org/springframework/util/exec/StreamPumper.java index b0c32654..e84b44cc 100644 --- a/spring-erlang/src/main/java/org/springframework/util/exec/StreamPumper.java +++ b/spring-erlang/src/main/java/org/springframework/util/exec/StreamPumper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,43 +27,43 @@ import java.io.OutputStream; */ public class StreamPumper implements Runnable { - // TODO: make SIZE and SLEEP instance variables. - // TODO: add a status flag to note if an error occured in run. + // TODO: make SIZE and SLEEP instance variables. + // TODO: add a status flag to note if an error occured in run. - private final static int SLEEP = 5; - private final static int SIZE = 128; - private InputStream is; - private OutputStream os; + private static final int SLEEP = 5; + private static final int SIZE = 128; + private InputStream is; + private OutputStream os; - /** - * Create a new stream pumper. - * - * @param is input stream to read data from - * @param os output stream to write data to. - */ - public StreamPumper(InputStream is, OutputStream os) { - this.is = is; - this.os = os; - } + /** + * Create a new stream pumper. + * + * @param is input stream to read data from + * @param os output stream to write data to. + */ + public StreamPumper(InputStream is, OutputStream os) { + this.is = is; + this.os = os; + } - /** - * Copies data from the input stream to the output stream. - * - * Terminates as soon as the input stream is closed or an error occurs. - */ - public void run() { - final byte[] buf = new byte[SIZE]; + /** + * Copies data from the input stream to the output stream. + * + * Terminates as soon as the input stream is closed or an error occurs. + */ + public void run() { + final byte[] buf = new byte[SIZE]; - int length; - try { - while ((length = is.read(buf)) > 0) { - os.write(buf, 0, length); - try { - Thread.sleep(SLEEP); - } catch (InterruptedException e) {} - } - } catch(IOException e) {} - } + int length; + try { + while ((length = is.read(buf)) > 0) { + os.write(buf, 0, length); + try { + Thread.sleep(SLEEP); + } catch (InterruptedException e) {} + } + } catch(IOException e) {} + } } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/FederatedExchangeParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/FederatedExchangeParser.java index a4cdc06c..6ce36945 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/FederatedExchangeParser.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/FederatedExchangeParser.java @@ -28,9 +28,9 @@ import org.w3c.dom.Element; @SuppressWarnings("deprecation") public class FederatedExchangeParser extends AbstractExchangeParser { - private final static String BACKING_TYPE_ATTRIBUTE = "backing-type"; + private static final String BACKING_TYPE_ATTRIBUTE = "backing-type"; - private final static String UPSTREAM_SET_ATTRIBUTE = "upstream-set"; + private static final String UPSTREAM_SET_ATTRIBUTE = "upstream-set"; private static final String DIRECT_BINDINGS_ELE = "direct-bindings"; diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java index 19481cbe..9ca6ef76 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/config/QueueParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -30,7 +30,8 @@ import org.w3c.dom.Element; */ public class QueueParser extends AbstractSingleBeanDefinitionParser { - private static final String ARGUMENTS = "queue-arguments"; // element OR attribute + /** Element OR attribute */ + private static final String ARGUMENTS = "queue-arguments"; private static final String DURABLE_ATTRIBUTE = "durable"; private static final String EXCLUSIVE_ATTRIBUTE = "exclusive"; private static final String AUTO_DELETE_ATTRIBUTE = "auto-delete"; diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java index e4b3a8c2..9fa2ce0d 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/AbstractConnectionFactory.java @@ -152,7 +152,7 @@ public abstract class AbstractConnectionFactory implements ConnectionFactory, Di } } - final protected Connection createBareConnection() { + protected final Connection createBareConnection() { try { if (this.addresses != null) { return new SimpleConnection(this.rabbitConnectionFactory.newConnection(this.executorService, this.addresses)); @@ -165,7 +165,7 @@ public abstract class AbstractConnectionFactory implements ConnectionFactory, Di } } - final protected String getDefaultHostName() { + protected final String getDefaultHostName() { String temp; try { InetAddress localMachine = InetAddress.getLocalHost(); diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java index c0eca635..19e5299b 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/CachingConnectionFactory.java @@ -448,18 +448,23 @@ public class CachingConnectionFactory extends AbstractConnectionFactory { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } ChannelCachingConnectionProxy other = (ChannelCachingConnectionProxy) obj; if (target == null) { - if (other.target != null) + if (other.target != null) { return false; - } else if (!target.equals(other.target)) + } + } else if (!target.equals(other.target)) { return false; + } return true; } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java index 031748c8..48b318bd 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/connection/RabbitUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -47,7 +47,7 @@ public abstract class RabbitUtils { try { connection.close(); } catch (Exception ex) { - logger.debug("Ignoring Connection exception - assuming already closed: " + ex); + logger.debug("Ignoring Connection exception - assuming already closed: " + ex.getMessage(), ex); } } } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/ChannelCallback.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/ChannelCallback.java index 9402b876..99a812f9 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/ChannelCallback.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/ChannelCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2010 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,7 +27,9 @@ public interface ChannelCallback { /** * Execute any number of operations against the supplied RabbitMQ * {@link Channel}, possibly returning a result. + * + * @throws Exception Not sure what else Rabbit Throws */ - T doInRabbit(Channel channel) throws Exception; //Not sure what else Rabbit Throws.. + T doInRabbit(Channel channel) throws Exception; } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java index 3b0cfdad..ef4ae233 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/core/RabbitTemplate.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at @@ -95,7 +95,8 @@ import com.rabbitmq.client.GetResponse; public class RabbitTemplate extends RabbitAccessor implements RabbitOperations, MessageListener, PublisherCallbackChannel.Listener { - private static final String DEFAULT_EXCHANGE = ""; // alias for amq.direct default exchange + /** Alias for amq.direct default exchange */ + private static final String DEFAULT_EXCHANGE = ""; private static final String DEFAULT_ROUTING_KEY = ""; @@ -840,13 +841,11 @@ public class RabbitTemplate extends RabbitAccessor implements RabbitOperations, } } - public static interface ConfirmCallback { - + interface ConfirmCallback { void confirm(CorrelationData correlationData, boolean ack); } - public static interface ReturnCallback { - + interface ReturnCallback { void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey); } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/BlockingQueueConsumer.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/BlockingQueueConsumer.java index 85e26d11..fc1330a4 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/BlockingQueueConsumer.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/BlockingQueueConsumer.java @@ -202,7 +202,9 @@ public class BlockingQueueConsumer { this.consumer = new InternalConsumer(channel); this.deliveryTags.clear(); this.activeObjectCounter.add(this); - int passiveDeclareTries = 3; // mirrored queue might be being moved + + // mirrored queue might be being moved + int passiveDeclareTries = 3; do { try { if (!acknowledgeMode.isAutoAck()) { diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java index 03d4362d..7a583c73 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/listener/SimpleMessageListenerContainer.java @@ -99,7 +99,7 @@ public class SimpleMessageListenerContainer extends AbstractMessageListenerConta private volatile boolean defaultRequeueRejected = true; - public static interface ContainerDelegate { + interface ContainerDelegate { void invokeListener(Channel channel, Message message) throws Exception; } diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/MissingMessageIdAdvice.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/MissingMessageIdAdvice.java index 0668cf1e..ade74d6f 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/MissingMessageIdAdvice.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/retry/MissingMessageIdAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,7 +42,7 @@ import org.springframework.util.Assert; */ public class MissingMessageIdAdvice implements MethodInterceptor { - private final static Log logger = LogFactory.getLog(MissingMessageIdAdvice.class); + private static final Log logger = LogFactory.getLog(MissingMessageIdAdvice.class); private final RetryContextCache retryContextCache; diff --git a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/PublisherCallbackChannel.java b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/PublisherCallbackChannel.java index ef47302a..8ba5224f 100644 --- a/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/PublisherCallbackChannel.java +++ b/spring-rabbit/src/main/java/org/springframework/amqp/rabbit/support/PublisherCallbackChannel.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2013 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import com.rabbitmq.client.Channel; */ public interface PublisherCallbackChannel extends Channel { - static String RETURN_CORRELATION = "spring_return_correlation"; + String RETURN_CORRELATION = "spring_return_correlation"; /** * Adds a {@link Listener} and returns a reference to @@ -66,7 +66,7 @@ public interface PublisherCallbackChannel extends Channel { * AMQP channels do not support a listener being * registered on multiple channels. */ - public static interface Listener { + interface Listener { /** * Invoked by the channel when a confirm is received.