checkstyle MutableException

checkstyle EmptyBlock

checkstyle fixRightCurly Script

checkstyle EmptyStatement

checkstyle RightCurly

checkstyle TailingWhite

checkstyle NeedBraces

Fix the line separator in the `fixRightCurly.gradle`
This commit is contained in:
Gary Russell
2016-04-05 09:44:19 -04:00
committed by Artem Bilan
parent c0b19e61b5
commit 842aded9a4
271 changed files with 1094 additions and 821 deletions

View File

@@ -68,6 +68,7 @@ subprojects { subproject ->
apply from: "${rootDir}/src/checkstyle/fixHeaders.gradle"
apply from: "${rootDir}/src/checkstyle/fixModifiers.gradle"
apply from: "${rootDir}/src/checkstyle/fixThis.gradle"
apply from: "${rootDir}/src/checkstyle/fixRightCurly.gradle"
if (project.hasProperty('platformVersion')) {
apply plugin: 'spring-io'

View File

@@ -23,7 +23,7 @@ import org.springframework.integration.mapping.RequestReplyHeaderMapper;
/**
* A convenience interface that extends {@link HeaderMapper}
* but parameterized with {@link MessageProperties}.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
* @since 2.1

View File

@@ -90,7 +90,7 @@ public class AmqpOutboundEndpointTests {
@Test
public void testGatewayPublisherConfirms() throws Exception {
while (this.amqpTemplateConfirms.receive(this.queue.getName()) != null) {
;
// drain
}
Message<?> message = MessageBuilder.withPayload("hello")
@@ -119,7 +119,7 @@ public class AmqpOutboundEndpointTests {
assertEquals(Boolean.TRUE, ack.getHeaders().get(AmqpHeaders.PUBLISH_CONFIRM));
while (this.amqpTemplateConfirms.receive(this.queue.getName()) != null) {
;
// drain
}
}
@@ -149,7 +149,7 @@ public class AmqpOutboundEndpointTests {
RabbitTemplate template = new RabbitTemplate(this.connectionFactory);
template.setQueue(this.queue.getName());
while (template.receive() != null) {
;
// drain
}
Message<?> message = MessageBuilder.withPayload("hello")
.setHeader(AmqpHeaders.CONTENT_TYPE, "application/json")
@@ -169,7 +169,7 @@ public class AmqpOutboundEndpointTests {
assertEquals("hello", new String(m.getBody(), "UTF-8"));
assertEquals("text/plain", m.getMessageProperties().getContentType());
while (template.receive() != null) {
;
// drain
}
}

View File

@@ -126,7 +126,8 @@ public class CorrelatingMessageBarrier extends AbstractMessageHandler implements
if (log.isDebugEnabled()) {
log.debug(String.format("Released message for key [%s]: %s.", key, nextMessage));
}
} else {
}
else {
remove(key);
}
@SuppressWarnings("unchecked")

View File

@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
/**
* This implementation of MessageGroupProcessor will take the messages from the
* MessageGroup and pass them on in a single message with a Collection as a payload.
*
*
* @author Iwein Fuld
* @author Alexander Peters
* @author Mark Fisher

View File

@@ -20,7 +20,7 @@ import org.springframework.integration.store.MessageGroup;
/**
* A {@link ReleaseStrategy} that evaluates an expression.
*
*
* @author Dave Syer
*/
public class ExpressionEvaluatingReleaseStrategy extends ExpressionEvaluatingMessageListProcessor implements

View File

@@ -1,56 +1,57 @@
/*
* Copyright 2002-2016 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.aggregator;
import org.springframework.integration.store.MessageGroup;
/**
* A {@link ReleaseStrategy} that releases only the first <code>n</code> messages, where <code>n</code> is a threshold.
*
* @author Dave Syer
* @author Oleg Zhurakousky
*
*/
public class MessageCountReleaseStrategy implements ReleaseStrategy {
private final int threshold;
/**
* @param threshold the number of messages to accept before releasing
*/
public MessageCountReleaseStrategy(int threshold) {
super();
this.threshold = threshold;
}
/**
* Convenient constructor is only one message is required (threshold=1).
*/
public MessageCountReleaseStrategy() {
this(1);
}
/**
* Release the group if it has more messages than the threshold and has not previously been released.
* It is possible that more messages than the threshold could be released, but only if multiple consumers
* receive messages from the same group concurrently.
*/
public boolean canRelease(MessageGroup group) {
return group.size() >= this.threshold;
}
}
/*
* Copyright 2002-2016 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.integration.aggregator;
import org.springframework.integration.store.MessageGroup;
/**
* A {@link ReleaseStrategy} that releases only the first <code>n</code> messages, where <code>n</code> is a threshold.
*
* @author Dave Syer
* @author Oleg Zhurakousky
*
*/
public class MessageCountReleaseStrategy implements ReleaseStrategy {
private final int threshold;
/**
* @param threshold the number of messages to accept before releasing
*/
public MessageCountReleaseStrategy(int threshold) {
super();
this.threshold = threshold;
}
/**
* Convenient constructor is only one message is required (threshold=1).
*/
public MessageCountReleaseStrategy() {
this(1);
}
/**
* Release the group if it has more messages than the threshold and has not previously been released.
* It is possible that more messages than the threshold could be released, but only if multiple consumers
* receive messages from the same group concurrently.
*/
@Override
public boolean canRelease(MessageGroup group) {
return group.size() >= this.threshold;
}
}

View File

@@ -23,7 +23,7 @@ import org.springframework.integration.store.MessageGroup;
/**
* Strategy for determining when a group of messages reaches a state of
* completion (i.e. can trip a barrier).
*
*
* @author Mark Fisher
* @author Dave Syer
*/

View File

@@ -81,8 +81,8 @@ public class SequenceSizeReleaseStrategy implements ReleaseStrategy {
int nextSequenceNumber = new IntegrationMessageHeaderAccessor(minMessage).getSequenceNumber();
int lastReleasedMessageSequence = messageGroup.getLastReleasedMessageSequenceNumber();
if (nextSequenceNumber - lastReleasedMessageSequence == 1){
canRelease = true;;
if (nextSequenceNumber - lastReleasedMessageSequence == 1) {
canRelease = true;
}
}
else {

View File

@@ -21,15 +21,15 @@ import org.springframework.integration.store.MessageGroup;
/**
* A {@link ReleaseStrategy} that releases all messages if any of the following is true:
*
*
* <ul>
* <li>The sequence is complete (if there is one).</li>
* <li>There are more messages than a threshold set by the user.</li>
* <li>The time elapsed since the earliest message, according to their timestamps, exceeds a timeout set by the user.</li>
* </ul>
*
*
* @author Dave Syer
*
*
* @since 2.0
*/
public class TimeoutCountSequenceSizeReleaseStrategy implements ReleaseStrategy {

View File

@@ -21,11 +21,11 @@ import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Indicates that a given method is capable of determining the correlation key
* of a message sent as parameter.
*
*
* @author Marius Bogoevici
*/
@Retention (RetentionPolicy.RUNTIME)

View File

@@ -28,7 +28,7 @@ import org.springframework.stereotype.Component;
/**
* Stereotype annotation indicating that a class is capable of serving as a
* Message Endpoint.
*
*
* @author Mark Fisher
*/
@Target(ElementType.TYPE)
@@ -41,7 +41,7 @@ public @interface MessageEndpoint {
/**
* The value may indicate a suggestion for a logical component name,
* to be turned into a Spring bean in case of an autodetected component.
*
*
* @return the suggested component name, if any
*/
String value() default "";

View File

@@ -25,7 +25,7 @@ import java.lang.annotation.Target;
/**
* Indicates that a method is capable of asserting if a list of messages or
* payload objects is complete.
*
*
* @author Marius Bogoevici
*/
@Retention(RetentionPolicy.RUNTIME)

View File

@@ -23,7 +23,7 @@ import java.util.Map;
* Simple implementation of {@link PublisherMetadataSource} that allows for
* configuration of a single channel name, payload expression, and
* array of header key=value expressions.
*
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -36,7 +36,7 @@ import org.springframework.util.Assert;
* operation and thus will <em>not</em> be removed. Likewise, messages to be
* purged may have been removed from the channel while the operation is taking
* place. Such messages will not be included in the returned list.
*
*
* @author Mark Fisher
*/
public class ChannelPurger {

View File

@@ -24,7 +24,7 @@ import org.springframework.messaging.Message;
* A zero-capacity version of {@link QueueChannel} that delegates to a
* {@link SynchronousQueue} internally. This accommodates "handoff" scenarios
* (i.e. blocking while waiting for another party to send or receive).
*
*
* @author Mark Fisher
*/
public class RendezvousChannel extends QueueChannel {

View File

@@ -181,7 +181,8 @@ public abstract class AbstractStandardMessageHandlerFactoryBean
}
try {
return extractTypeIfPossible(targetSource.getTarget(), expectedType);
} catch (Exception e) {
}
catch (Exception e) {
throw new IllegalStateException(e);
}
}

View File

@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
/**
* FactoryBean for creating Expression instances.
*
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -416,7 +416,8 @@ public abstract class AbstractMethodAnnotationPostProcessor<T extends Annotation
}
try {
return extractTypeIfPossible(targetSource.getTarget(), expectedType);
} catch (Exception e) {
}
catch (Exception e) {
throw new IllegalStateException(e);
}
}

View File

@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
/**
* Parser for the &lt;application-event-multicaster&gt; element of the
* integration namespace.
*
*
* @author Mark Fisher
*/
public class ApplicationEventMulticasterParser extends AbstractSingleBeanDefinitionParser {

View File

@@ -25,7 +25,7 @@ import org.springframework.beans.factory.xml.ParserContext;
* for parsing an element, creating a bean definition, and then
* registering the bean. The {@link #parse(Element, ParserContext)}
* method should return the name of the registered bean.
*
*
* @author Mark Fisher
*/
public interface BeanDefinitionRegisteringParser {

View File

@@ -33,7 +33,7 @@ import org.springframework.beans.factory.xml.ParserContext;
/**
* A helper class for parsing the sub-elements of a channel's
* <em>interceptors</em> element.
*
*
* @author Mark Fisher
* @author Oleg Zhurakousky
*/

View File

@@ -25,7 +25,7 @@ import org.springframework.integration.router.ErrorMessageExceptionTypeRouter;
/**
* Parser for the &lt;exception-type-router/&gt; element.
*
*
* @author Oleg Zhurakousky
* @since 2.0.4
*/

View File

@@ -25,7 +25,7 @@ import org.springframework.integration.router.HeaderValueRouter;
/**
* Parser for the &lt;header-value-router/&gt; element.
*
*
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 1.0.3

View File

@@ -24,7 +24,7 @@ import org.w3c.dom.Element;
/**
* Parser for the &lt;payload-type-router/&gt; element.
*
*
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 1.0.3

View File

@@ -26,14 +26,14 @@ import org.springframework.util.StringUtils;
import org.w3c.dom.Element;
/**
* Parser for 'resource-inbound-channel-adapter'
*
* Parser for 'resource-inbound-channel-adapter'
*
* @author Oleg Zhurakousky
* @since 2.1
*/
public class ResourceInboundChannelAdapterParser extends AbstractPollingInboundChannelAdapterParser {
@Override
protected BeanMetadataElement parseSource(Element element, ParserContext parserContext) {
BeanDefinitionBuilder sourceBuilder = BeanDefinitionBuilder.genericBeanDefinition(ResourceRetrievingMessageSource.class);

View File

@@ -277,7 +277,8 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
}
try {
return extractTypeIfPossible(targetSource.getTarget(), expectedType);
} catch (Exception e) {
}
catch (Exception e) {
throw new IllegalStateException(e);
}
}

View File

@@ -21,7 +21,7 @@ import org.springframework.messaging.MessageHandler;
/**
* Strategy interface for dispatching messages to handlers.
*
*
* @author Mark Fisher
*/
public interface MessageDispatcher {

View File

@@ -27,8 +27,8 @@ import org.springframework.util.Assert;
/**
* An implementation of {@link Expression} that delegates to an {@link ExpressionSource}
* for resolving the actual Expression instance per-invocation at runtime.
*
* for resolving the actual Expression instance per-invocation at runtime.
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -22,7 +22,7 @@ import org.springframework.expression.Expression;
/**
* Strategy interface for retrieving Expressions.
*
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -21,7 +21,7 @@ import org.springframework.messaging.Message;
/**
* Interface for a request/reply Message exchange. This will be used as a default
* by {@link GatewayProxyFactoryBean} if no 'service-interface' property has been provided.
*
*
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 2.0

View File

@@ -22,18 +22,18 @@ import org.springframework.util.StringUtils;
/**
* Base implementation of a {@link Candidate}.
*
*
* @author Janne Valkealahti
*
*/
public abstract class AbstractCandidate implements Candidate {
private static final String DEFAULT_ROLE = "leader";
private final String id;
private final String role;
/**
* Instantiate a abstract candidate.
*/
@@ -43,7 +43,7 @@ public abstract class AbstractCandidate implements Candidate {
/**
* Instantiate a abstract candidate.
*
*
* @param id the identifier
* @param role the role
*/

View File

@@ -24,13 +24,13 @@ package org.springframework.integration.leader;
*
* @author Patrick Peralta
* @author Janne Valkealahti
*
*
*/
public interface Candidate {
/**
* Gets the role.
*
*
* @return a string indicating the name of the leadership role
* this candidate is participating in; other candidates
* present in the system with the same name will contend
@@ -40,7 +40,7 @@ public interface Candidate {
/**
* Gets the identifier.
*
*
* @return a unique ID for this candidate; no other candidate for
* leader election should return the same id
*/

View File

@@ -23,14 +23,14 @@ package org.springframework.integration.leader;
*
* @author Patrick Peralta
* @author Janne Valkealahti
*
*
*/
public interface Context {
/**
* Checks if the {@link Candidate} this context was
* passed to is the leader.
*
*
* @return true if the {@link Candidate} this context was
* passed to is the leader
*/

View File

@@ -20,7 +20,7 @@ import org.springframework.messaging.Message;
/**
* Strategy interface for mapping from an Object to a{@link Message}.
*
*
* @author Mark Fisher
*/
public interface InboundMessageMapper<T> {

View File

@@ -21,7 +21,7 @@ import org.springframework.messaging.MessagingException;
/**
* Exception that indicates an error during message mapping.
*
*
* @author Mark Fisher
*/
@SuppressWarnings("serial")

View File

@@ -20,7 +20,7 @@ import org.springframework.messaging.Message;
/**
* Strategy interface for mapping from a {@link Message} to an Object.
*
*
* @author Mark Fisher
*/
public interface OutboundMessageMapper<T> {

View File

@@ -31,21 +31,21 @@ import org.springframework.messaging.MessageHeaders;
* @since 2.1
*/
public interface RequestReplyHeaderMapper<T> {
/**
* Map from the given {@link MessageHeaders} to the specified request target.
* @param headers the abstracted MessageHeaders
* @param target the native target request
*/
void fromHeadersToRequest(MessageHeaders headers, T target);
/**
* Map from the given {@link MessageHeaders} to the specified reply target.
* @param headers the abstracted MessageHeaders
* @param target the native target reply
*/
void fromHeadersToReply(MessageHeaders headers, T target);
/**
* Map from the given request object to abstracted {@link MessageHeaders}.
* @param source the native target request
@@ -59,5 +59,5 @@ public interface RequestReplyHeaderMapper<T> {
* @return the abstracted MessageHeaders
*/
Map<String, Object> toHeadersFromReply(T source);
}

View File

@@ -1,6 +1,6 @@
/**
* Base package for Spring Integration Core.
*
*
* Provides fundamental classes.
*/
package org.springframework.integration;

View File

@@ -1,5 +1,5 @@
/**
* Provides classes related to messaging
* Provides classes related to messaging
* using Spring {@link org.springframework.core.io.Resource}s
*/
package org.springframework.integration.resource;

View File

@@ -23,7 +23,7 @@ import org.springframework.integration.handler.ExpressionEvaluatingMessageProces
* A Message Router implementation that evaluates the specified SpEL
* expression. The result of evaluation will typically be a String to be
* resolved to a channel name or a Collection (or Array) of strings.
*
*
* @author Mark Fisher
* @since 2.0
*/
@@ -32,5 +32,5 @@ public class ExpressionEvaluatingRouter extends AbstractMessageProcessingRouter
public ExpressionEvaluatingRouter(Expression expression) {
super(new ExpressionEvaluatingMessageProcessor<Object>(expression));
}
}

View File

@@ -186,7 +186,8 @@ public abstract class AbstractMessageGroupStore extends AbstractBatchingMessageG
for (MessageGroupCallback callback : this.expiryCallbacks) {
try {
callback.execute(this, group);
} catch (RuntimeException e) {
}
catch (RuntimeException e) {
if (exception == null) {
exception = e;
}

View File

@@ -23,7 +23,7 @@ import org.springframework.messaging.Message;
* of a {@link Message}. If the return value is itself a Message, it will be
* used as the result. Otherwise, the return value will be used as the payload
* of the result Message.
*
*
* @author Mark Fisher
*/
public abstract class AbstractPayloadTransformer<T, U> extends AbstractTransformer {

View File

@@ -23,7 +23,7 @@ import org.springframework.integration.handler.ExpressionEvaluatingMessageProces
* A Message Transformer implementation that evaluates the specified SpEL
* expression. The result of evaluation will typically be considered as the
* payload of a new Message unless it is itself already a Message.
*
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -23,9 +23,9 @@ import org.springframework.core.serializer.support.DeserializingConverter;
* Transformer that deserializes the inbound byte array payload to an object by delegating to a
* Converter&lt;byte[], Object&gt;. Default delegate is a {@link DeserializingConverter} using
* Java serialization.
*
*
* <p>The byte array payload must be a result of equivalent serialization.
*
*
* @author Mark Fisher
* @author Gary Russell
* @since 1.0.1

View File

@@ -20,12 +20,12 @@ import org.springframework.core.serializer.Serializer;
import org.springframework.core.serializer.support.SerializingConverter;
/**
* Transformer that serializes the inbound payload into a byte array by delegating to a
* Transformer that serializes the inbound payload into a byte array by delegating to a
* Converter&lt;Object, byte[]&gt;. Default delegate is a {@link SerializingConverter} using
* Java serialization.
*
*
* <p>The payload instance must be Serializable if the default converter is used.
*
*
* @author Mark Fisher
* @author Gary Russell
* @since 1.0.1

View File

@@ -22,7 +22,7 @@ import org.springframework.util.Assert;
/**
* Transformer that converts the inbound payload to an object by delegating to a
* Converter&lt;Object, Object&gt;. A reference to the delegate must be provided.
*
*
* @author Gary Russell
* @since 2.0
*/
@@ -32,7 +32,7 @@ public class PayloadTypeConvertingTransformer<T, U> extends AbstractPayloadTrans
/**
* Specify the converter to use.
*
*
* @param converter The Converter.
*/
public void setConverter(Converter<T, U> converter) {

View File

@@ -24,7 +24,7 @@ import java.util.List;
/**
* An implementation of {@link CollectionFilter} that remembers the elements passed in
* the previous invocation in order to avoid returning those elements more than once.
*
*
* @author Mark Fisher
* @since 2.1
*/

View File

@@ -33,7 +33,7 @@ import org.springframework.util.StringUtils;
* <li>limiting to annotated methods if at least one is present</li>
* </ol>
* <p>
*
*
* @author Mark Fisher
* @since 2.0
*/

View File

@@ -20,7 +20,7 @@ import java.util.Collection;
/**
* Base strategy for filtering out a subset of a Collection of elements.
*
*
* @author Oleg Zhurakousky
* @author Mark Fisher
* @since 2.1

View File

@@ -27,7 +27,7 @@ import org.springframework.util.ClassUtils;
/**
* Utility to help generate UUID instances from generic objects.
*
*
* @author Dave Syer
*/
public class UUIDConverter implements Converter<Object, UUID> {
@@ -38,7 +38,7 @@ public class UUIDConverter implements Converter<Object, UUID> {
/**
* Convert the input to a UUID using the convenience method
* {@link #getUUID(Object)}.
*
*
* @see org.springframework.core.convert.converter.Converter#convert(java.lang.Object)
*/
public UUID convert(Object source) {
@@ -60,7 +60,7 @@ public class UUIDConverter implements Converter<Object, UUID> {
* the serialized bytes of the input</li>
* </ul>
* If none of the above applies there will be an exception trying to serialize.
*
*
* @param input an Object
* @return a UUID constructed from the input
*/

View File

@@ -1,4 +1,4 @@
/**
* Provides core utility classes.
* Provides core utility classes.
*/
package org.springframework.integration.util;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2016 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.
@@ -322,10 +322,12 @@ public class ConcurrentAggregatorTests {
public void run() {
try {
this.aggregator.handleMessage(message);
} catch (Exception e) {
}
catch (Exception e) {
e.printStackTrace();
this.exception = e;
} finally {
}
finally {
this.latch.countDown();
}
}

View File

@@ -96,7 +96,8 @@ public class CorrelatingMessageBarrierTests {
try {
sent.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
@@ -113,7 +114,8 @@ public class CorrelatingMessageBarrierTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
handler.handleMessage(message);

View File

@@ -122,7 +122,7 @@ public class ChannelPurgerTests {
channel1.send(new GenericMessage<String>("test3"));
channel2.send(new GenericMessage<String>("test1"));
channel2.send(new GenericMessage<String>("test2"));
channel2.send(new GenericMessage<String>("test3"));
channel2.send(new GenericMessage<String>("test3"));
ChannelPurger purger = new ChannelPurger(new MessageSelector() {
public boolean accept(Message<?> message) {
return (message.getPayload().equals("test2"));
@@ -137,7 +137,7 @@ public class ChannelPurgerTests {
Message<?> message2 = channel2.receive(0);
assertNotNull(message2);
assertEquals("test2", message2.getPayload());
assertNull(channel2.receive(0));
assertNull(channel2.receive(0));
}
@Test

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -108,11 +108,13 @@ public class MixedDispatcherConfigurationScenarioTests {
dispatcher.addHandler(handlerB);
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
verify(handlerA, times(2)).handleMessage(message);
verify(handlerB, times(0)).handleMessage(message);
@@ -131,13 +133,15 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
boolean sent = false;
try {
sent = channel.send(message);
} catch (Exception e) {
}
catch (Exception e) {
exceptionRegistry.add(e);
}
if (!sent) {
@@ -193,7 +197,8 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
channel.send(message);
@@ -226,17 +231,20 @@ public class MixedDispatcherConfigurationScenarioTests {
InOrder inOrder = inOrder(handlerA, handlerB, handlerC);
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
inOrder.verify(handlerA).handleMessage(message);
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
inOrder.verify(handlerB).handleMessage(message);
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
inOrder.verify(handlerC).handleMessage(message);
@@ -263,13 +271,15 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
boolean sent = false;
try {
sent = channel.send(message);
} catch (Exception e) {
}
catch (Exception e) {
exceptionRegistry.add(e);
}
if (!sent) {
@@ -336,7 +346,8 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
channel.send(message);
@@ -371,14 +382,16 @@ public class MixedDispatcherConfigurationScenarioTests {
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
inOrder.verify(handlerA).handleMessage(message);
inOrder.verify(handlerB).handleMessage(message);
try {
channel.send(message);
} catch (Exception e) {/* ignore */
}
catch (Exception e) {/* ignore */
}
inOrder.verify(handlerA).handleMessage(message);
inOrder.verify(handlerB).handleMessage(message);
@@ -407,13 +420,15 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
boolean sent = false;
try {
sent = channel.send(message);
} catch (Exception e) {
}
catch (Exception e) {
exceptionRegistry.add(e);
}
if (!sent) {
@@ -473,7 +488,8 @@ public class MixedDispatcherConfigurationScenarioTests {
public void run() {
try {
start.await();
} catch (InterruptedException e) {
}
catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
channel.send(message);

View File

@@ -44,7 +44,7 @@ import org.springframework.util.ReflectionUtils.FieldCallback;
*
*/
public class P2pChannelTests {
@Test
public void testDirectChannelLoggingWithMoreThenOneSubscriber() {
final DirectChannel channel = new DirectChannel();
@@ -110,7 +110,7 @@ public class P2pChannelTests {
assertEquals(String.format(log, 0), logs.remove(0));
verify(logger, times(4)).info(Mockito.anyString());
}
@Test
public void testExecutorChannelLoggingWithMoreThenOneSubscriber() {
final ExecutorChannel channel = new ExecutorChannel(mock(Executor.class));
@@ -132,7 +132,7 @@ public class P2pChannelTests {
channel.subscribe(mock(MessageHandler.class));
verify(logger, times(2)).info(Mockito.anyString());
}
@Test
public void testPubSubChannelLoggingWithMoreThenOneSubscriber() {
final PublishSubscribeChannel channel = new PublishSubscribeChannel();
@@ -141,7 +141,7 @@ public class P2pChannelTests {
final Log logger = mock(Log.class);
when(logger.isInfoEnabled()).thenReturn(true);
ReflectionUtils.doWithFields(AbstractMessageChannel.class, new FieldCallback() {
public void doWith(Field field) throws IllegalArgumentException,
IllegalAccessException {
if ("logger".equals(field.getName())){

View File

@@ -22,7 +22,7 @@ import java.util.List;
* @author Marius Bogoevici
*/
public class Adder {
public Long add(List<Long> results) {
long total = 0l;
for (long partialResult: results) {
@@ -30,5 +30,5 @@ public class Adder {
}
return total;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -279,7 +279,8 @@ public class ChannelAdapterParserTests {
@Test(expected = BeanDefinitionParsingException.class)
public void innerBeanAndExpressionFail() throws Exception {
new ClassPathXmlApplicationContext("InboundChannelAdapterInnerBeanWithExpression-fail-context.xml", this.getClass()).close();;
new ClassPathXmlApplicationContext("InboundChannelAdapterInnerBeanWithExpression-fail-context.xml",
this.getClass()).close();
}
@Test

View File

@@ -22,12 +22,12 @@ import java.util.List;
public class MaxValueReleaseStrategy {
private long maxValue;
public MaxValueReleaseStrategy(long maxValue){
this.maxValue = maxValue;
}
public boolean checkCompletenessAsList(List<Long> numbers) {
int sum = 0;
for (long number: numbers) {
@@ -35,7 +35,7 @@ public class MaxValueReleaseStrategy {
}
return sum >= maxValue;
}
public boolean checkCompletenessAsCollection(Collection<Long> numbers) {
int sum = 0;
for (long number: numbers) {
@@ -43,5 +43,5 @@ public class MaxValueReleaseStrategy {
}
return sum >= maxValue;
}
}

View File

@@ -42,7 +42,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class SelectorChainParserTests {
@Autowired
ApplicationContext context;
@@ -103,13 +103,13 @@ public class SelectorChainParserTests {
private VotingStrategy getStrategy(MessageSelectorChain chain) {
return (VotingStrategy) new DirectFieldAccessor(chain).getPropertyValue("votingStrategy");
}
public static class StubMessageSelector implements MessageSelector {
public boolean accept(Message<?> message) {
return true;
}
}
public static class StubPojoSelector {
public boolean accept(Message<?> message) {
return true;

View File

@@ -82,7 +82,7 @@ public class ServiceActivatorAnnotationPostProcessorTests {
}
@MessageEndpoint
@MessageEndpoint
public static class SimpleServiceActivatorAnnotationTestBean extends AbstractServiceActivatorAnnotationTestBean {
public SimpleServiceActivatorAnnotationTestBean(CountDownLatch latch) {

View File

@@ -34,7 +34,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class TopLevelSelectorParserTests {
@Autowired
ApplicationContext context;

View File

@@ -62,7 +62,7 @@ public class ControlBusChainTests {
return "cat";
}
}
public static class AdapterService {
public Message<String> receive() {
return new GenericMessage<String>(new Date().toString());

View File

@@ -29,7 +29,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Mark Fisher
* @author Gunnar Hillert
*
*
* @since 2.1
*/
@RunWith(SpringJUnit4ClassRunner.class)
@@ -41,9 +41,9 @@ public class EnricherParserTests2 {
@Test
public void configurationCheckRequiresReply() {
Object endpoint = context.getBean("enricher");
boolean requiresReply = TestUtils.getPropertyValue(endpoint, "handler.requiresReply", Boolean.class);
assertFalse("Was expecting requiresReply to be 'false'", requiresReply);

View File

@@ -34,14 +34,14 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class ErrorChannelAutoCreationTests {
@Autowired
private MessageChannel errorChannel;
// see INT-1899
@Test
public void testErrorChannelIsPubSub(){
assertEquals(PublishSubscribeChannel.class, errorChannel.getClass());
}
}

View File

@@ -81,10 +81,10 @@ public class HeaderEnricherParserTests {
Boolean shouldSkipNulls = TestUtils.getPropertyValue(endpoint, "handler.transformer.shouldSkipNulls", Boolean.class);
assertEquals(Boolean.TRUE, shouldSkipNulls);
}
@Test(expected=MessageTransformationException.class)
@Test(expected=MessageTransformationException.class)
public void testStringPriorityHeader() {
MessageHandler messageHandler =
MessageHandler messageHandler =
TestUtils.getPropertyValue(context.getBean("headerEnricherWithPriorityAsString"), "handler", MessageHandler.class);
Message<?> message = new GenericMessage<String>("hello");
messageHandler.handleMessage(message);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -294,8 +294,12 @@ public class HeaderEnricherTests {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TestBean testBean = (TestBean) o;

View File

@@ -41,7 +41,7 @@ public class InboundChannelAdapterWithDefaultPollerTests {
private SourcePollingChannelAdapter adapter;
@Test
@Test
public void verifyDefaultPollerInUse() {
Trigger trigger = TestUtils.getPropertyValue(adapter, "trigger", Trigger.class);
assertEquals(PeriodicTrigger.class, trigger.getClass());

View File

@@ -48,7 +48,7 @@ public class InnerBeanConfigTests {
public void checkInnerBean() {
Object innerBean = TestUtils.getPropertyValue(testEndpoint, "handler.processor.delegate.targetObject");
assertNotNull(innerBean);
context.getBean(TestBean.class);
context.getBean(TestBean.class);
}
@@ -57,5 +57,5 @@ public class InnerBeanConfigTests {
return value;
}
}
}

View File

@@ -32,7 +32,7 @@ import static org.junit.Assert.assertEquals;
/**
* Validates the "p:namespace" is working for inner "bean" definition within SI components.
*
*
* @author Oleg Zhurakousky
*/
@ContextConfiguration
@@ -45,7 +45,7 @@ public class PNamespaceTests {
@Autowired
@Qualifier("sp")
EventDrivenConsumer splitter;
EventDrivenConsumer splitter;
@Autowired
@Qualifier("rt")
@@ -54,21 +54,21 @@ public class PNamespaceTests {
@Autowired
@Qualifier("tr")
EventDrivenConsumer transformer;
@Autowired
@Qualifier("sampleChain")
EventDrivenConsumer sampleChain;
@Test
public void testPNamespaceServiceActivator() {
public void testPNamespaceServiceActivator() {
TestBean bean = prepare(serviceActivator);
assertEquals("paris", bean.getFname());
assertEquals("hilton", bean.getLname());
}
@Test
public void testPNamespaceSplitter() {
public void testPNamespaceSplitter() {
TestBean bean = prepare(splitter);
assertEquals("paris", bean.getFname());
assertEquals("hilton", bean.getLname());
@@ -82,17 +82,17 @@ public class PNamespaceTests {
}
@Test
public void testPNamespaceTransformer() {
public void testPNamespaceTransformer() {
TestBean bean = prepare(transformer);
assertEquals("paris", bean.getFname());
assertEquals("hilton", bean.getLname());
}
@Test
public void testPNamespaceChain() {
public void testPNamespaceChain() {
List<?> handlers = (List<?>) TestUtils.getPropertyValue(sampleChain, "handler.handlers");
AggregatingMessageHandler handler = (AggregatingMessageHandler) handlers.get(0);
SampleAggregator aggregator =
SampleAggregator aggregator =
(SampleAggregator) TestUtils.getPropertyValue(handler, "outputProcessor.processor.delegate.targetObject");
assertEquals("Bill", aggregator.getName());
}
@@ -130,7 +130,7 @@ public class PNamespaceTests {
public void setLname(String lname) {
this.lname = lname;
}
public String printWithPrefix(String prefix) {
return prefix + fname + " " + lname;
}

View File

@@ -22,7 +22,7 @@ import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
*
*
* @author Iwein Fuld
*
*/
@@ -34,7 +34,7 @@ public class PropertyPlaceholderTests {
public void context() throws Exception {
//parsing and instantiating is enough
}
public static class SanityCheck{
public SanityCheck(Integer i) {
//this will throw an exception if the placeholder isn't replaced

View File

@@ -56,7 +56,8 @@ class TimeBasedUUIDGenerator {
if (currentTimeMillis > lastTime) {
lastTime = currentTimeMillis;
clockSequence = 0;
} else {
}
else {
++clockSequence;
}
}
@@ -83,7 +84,8 @@ class TimeBasedUUIDGenerator {
if (canNotDetermineMac){
logger.warning("UUID generation process was not able to determine your MAC address. Returning random UUID (non version 1 UUID)");
return UUID.randomUUID();
} else {
}
else {
return new UUID(time, lsb);
}
}
@@ -104,7 +106,8 @@ class TimeBasedUUIDGenerator {
}
}
canNotDetermineMac = false;
} catch (Exception e) {
}
catch (Exception e) {
e.printStackTrace();
}
return macAddressAsLong;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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.
@@ -249,7 +249,8 @@ public class BroadcastingDispatcherTests {
try {
dispatcher.dispatch(messageMock);
fail("Expected Exception");
} catch (MessagingException e) {
}
catch (MessagingException e) {
assertEquals(messageMock, e.getFailedMessage());
}
}
@@ -269,7 +270,8 @@ public class BroadcastingDispatcherTests {
try {
dispatcher.dispatch(messageMock);
fail("Expected Exception");
} catch (MessagingException e) {
}
catch (MessagingException e) {
assertEquals(dontReplaceThisMessage, e.getFailedMessage());
}
}

View File

@@ -187,7 +187,8 @@ public class OrderedAwareCopyOnWriteArraySetTests {
t1.join();
t2.join();
t3.join();
} catch (Exception e) {
}
catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
@@ -268,7 +269,8 @@ public class OrderedAwareCopyOnWriteArraySetTests {
t1.join();
t2.join();
t3.join();
} catch (Exception e) {
}
catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}

View File

@@ -62,19 +62,19 @@ public class PollingTransactionTests {
input.send(new GenericMessage<String>("test"));
txManager.waitForCompletion(1000);
Message<?> message = output.receive(0);
assertNotNull(message);
assertNotNull(message);
assertEquals(1, txManager.getCommitCount());
assertEquals(0, txManager.getRollbackCount());
context.stop();
}
@Test
@SuppressWarnings("unchecked")
public void transactionWithCommitAndAdvices() throws InterruptedException {
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
"transactionTests.xml", this.getClass());
PollingConsumer advicedPoller = context.getBean("advicedSa", PollingConsumer.class);
List<Advice> adviceChain = TestUtils.getPropertyValue(advicedPoller, "adviceChain",List.class);
assertEquals(3, adviceChain.size());
Runnable poller = TestUtils.getPropertyValue(advicedPoller, "poller", Runnable.class);
@@ -204,6 +204,6 @@ public class PollingTransactionTests {
public static class SampleAdvice implements MethodInterceptor {
public Object invoke(MethodInvocation invocation) throws Throwable {
return invocation.proceed();
}
}
}
}

View File

@@ -115,7 +115,8 @@ public class RoundRobinDispatcherTests {
try {
dispatcher.dispatch(message);
fail("Expected Exception");
} catch (MessagingException e) {
}
catch (MessagingException e) {
assertEquals(message, e.getFailedMessage());
}
}
@@ -133,7 +134,8 @@ public class RoundRobinDispatcherTests {
try {
dispatcher.dispatch(message);
fail("Expected Exception");
} catch (MessagingException e) {
}
catch (MessagingException e) {
assertEquals(dontReplaceThisMessage, e.getFailedMessage());
}
}

View File

@@ -141,7 +141,7 @@ public class PollerAdviceTests {
return null;
}
};
}
CountDownLatch latch = new CountDownLatch(1);
adapter.setSource(new LocalSource(latch));
class OneAndDone10msTrigger implements Trigger {
@@ -154,7 +154,7 @@ public class PollerAdviceTests {
done = true;
return date;
}
};
}
adapter.setTrigger(new OneAndDone10msTrigger());
configure(adapter);
List<Advice> adviceChain = new ArrayList<Advice>();

View File

@@ -64,7 +64,7 @@ public class DynamicExpressionTests {
}
catch (Exception e) {
throw new IllegalStateException("failed to write expression string to file", e);
}
}
}
}

View File

@@ -181,7 +181,7 @@ public class MessageFilterTests {
assertEquals(message, reply);
assertNull(outputChannel.receive(0));
}
}
}

View File

@@ -32,15 +32,15 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
@ContextConfiguration
@RunWith(SpringJUnit4ClassRunner.class)
public class MultipleEndpointGatewayTests {
@Autowired
@Qualifier("gatewayA")
private SampleGateway gatewayA;
@Autowired
@Qualifier("gatewayB")
@Qualifier("gatewayB")
private SampleGateway gatewayB;
@Test
public void gatewayNoDefaultReplyChannel(){
gatewayA.echo("echoAsMessageChannel");
@@ -51,17 +51,17 @@ public class MultipleEndpointGatewayTests {
gatewayB.echo("echoAsMessageChannelIgnoreDefOutChannel");
// there is nothing to assert. Successful execution of the above is all we care in this test
}
@Test
public void gatewayWithReplySentBackToDefaultReplyChannel(){
gatewayB.echo("echoAsMessageChannelDefaultOutputChannel");
// there is nothing to assert. Successful execution of the above is all we care in this test
}
public interface SampleGateway{
Object echo(Object value);
}
public static class SampleEchoService {
public Object echo(Object value){
return "R:" + value;

View File

@@ -27,6 +27,6 @@ import java.lang.annotation.Target;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.PARAMETER)
public @interface BogusAnnotation {
public @interface BogusAnnotation {
}

View File

@@ -19,13 +19,13 @@ package org.springframework.integration.json;
import java.util.Date;
public class TestBean {
private String value = "foo";
private boolean test = false;
private long number = 42;
private Date now = new Date();
private TestChildBean child = new TestChildBean();
@@ -83,27 +83,38 @@ public class TestBean {
@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;
}
TestBean other = (TestBean) obj;
if (child == null) {
if (other.child != null)
if (other.child != null) {
return false;
} else if (!child.equals(other.child))
}
}
else if (!child.equals(other.child)) {
return false;
if (number != other.number)
}
if (number != other.number) {
return false;
if (test != other.test)
}
if (test != other.test) {
return false;
}
if (value == null) {
if (other.value != null)
if (other.value != null) {
return false;
} else if (!value.equals(other.value))
}
}
else if (!value.equals(other.value)) {
return false;
}
return true;
}
}

View File

@@ -60,28 +60,40 @@ public class TestChildBean {
@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;
}
TestChildBean other = (TestChildBean) obj;
if (baz == null) {
if (other.baz != null)
if (other.baz != null) {
return false;
} else if (!baz.equals(other.baz))
}
}
else if (!baz.equals(other.baz)) {
return false;
}
if (parent == null) {
if (other.parent != null)
if (other.parent != null) {
return false;
} else if (!parent.equals(other.parent))
}
}
else if (!parent.equals(other.parent)) {
return false;
}
if (value == null) {
if (other.value != null)
if (other.value != null) {
return false;
} else if (!value.equals(other.value))
}
}
else if (!value.equals(other.value)) {
return false;
}
return true;
}
}

View File

@@ -26,7 +26,7 @@ import org.springframework.messaging.MessageHeaders;
/**
* Matcher to make assertions about message equality easier. Usage:
*
*
* <pre>
* &#064;Test
* public void testSomething() {
@@ -34,7 +34,7 @@ import org.springframework.messaging.MessageHeaders;
* Message<String> result = ...;
* assertThat(result, sameExceptImmutableHeaders(expected));
* }
*
*
* &#064;Factory
* public static Matcher<Message<?>> sameExceptImmutableHeaders(Message<?> expected) {
* return new MessageMatcher(expected);
@@ -70,5 +70,5 @@ public class MessageMatcher extends BaseMatcher<Message<?>> {
public void describeTo(Description description) {
description.appendText("Headers match except ID and timestamp for payload: ").appendValue(payload).appendText(" and headers: ").appendValue(headers);
}
}

View File

@@ -26,7 +26,7 @@ import org.springframework.integration.router.AbstractMessageRouter;
* @author Oleg Zhurakousky
*/
public class RfbFixRouter extends AbstractMessageRouter {
@Override
protected Collection<MessageChannel> determineTargetChannels(Message<?> message) {
return null;

View File

@@ -51,7 +51,7 @@ public class SplitterAggregatorTests {
assertNotNull(result1);
assertEquals(Integer.class, result1.getPayload().getClass());
assertEquals(55, result1.getPayload());
inputChannel.send(new GenericMessage<Numbers>(this.nextTen()));
inputChannel.send(new GenericMessage<Numbers>(this.nextTen()));
Message<?> result2 = outputChannel.receive(1000);
assertNotNull(result2);
assertEquals(Integer.class, result2.getPayload().getClass());

View File

@@ -87,7 +87,7 @@ public class PayloadDeserializingTransformerTests {
private static class TestBean implements Serializable {
private String name;
TestBean(String name) {
this.name = name;
}

View File

@@ -69,7 +69,7 @@ public class PayloadSerializingTransformerTests {
PayloadSerializingTransformer transformer = new PayloadSerializingTransformer();
transformer.transform(new GenericMessage<Object>(new Object()));
}
@Test
public void customSerializer() {
PayloadSerializingTransformer transformer = new PayloadSerializingTransformer();
@@ -87,7 +87,7 @@ public class PayloadSerializingTransformerTests {
private static class TestBean implements Serializable {
private String name;
TestBean(String name) {
this.name = name;
}

View File

@@ -84,7 +84,8 @@ public class SimplePoolTests {
try {
pool.getItem();
fail("Expected exception");
} catch (MessagingException e) {}
}
catch (MessagingException e) {}
// resize up
pool.setPoolSize(4);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2016 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.
@@ -57,7 +57,8 @@ public class UUIDConverterTests {
try {
UUID.fromString(name);
fail();
} catch (IllegalArgumentException e) {
}
catch (IllegalArgumentException e) {
String message = e.getMessage();
assertTrue("Wrong message: "+message, message.contains("Invalid UUID string"));
}

View File

@@ -20,7 +20,7 @@ import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHa
/**
* Namespace handler for Spring Integration's 'event' namespace.
*
*
* @author Oleg Zhurakousky
* @since 2.0
*/

View File

@@ -21,7 +21,7 @@ import org.springframework.messaging.Message;
/**
* A subclass of {@link ApplicationEvent} that wraps a {@link Message}.
*
*
* @author Mark Fisher
*/
public class MessagingEvent extends ApplicationEvent {

View File

@@ -20,7 +20,7 @@ import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHa
/**
* NamespaceHandler for the feed module.
*
*
* @author Josh Long
* @author Mark Fisher
* @since 2.0

View File

@@ -20,7 +20,7 @@ import org.springframework.messaging.Message;
/**
* Strategy interface for generating a file name from a message.
*
*
* @author Mark Fisher
*/
public interface FileNameGenerator {

View File

@@ -905,7 +905,7 @@ public class FileWritingMessageHandler extends AbstractReplyProducingMessageHand
}
}
catch (IOException e) {
;
// ignore
}
}
}

View File

@@ -144,7 +144,8 @@ public class FileWritingMessageHandlerFactoryBean
}
else if (this.directoryExpression != null) {
handler = new FileWritingMessageHandler(this.directoryExpression);
} else {
}
else {
throw new IllegalStateException("Either directory or directoryExpression must not be null");
}

View File

@@ -84,7 +84,7 @@ public abstract class AbstractPersistentAcceptOnceFileListFilter<F> extends Abst
if (this.store.replace(key, oldValue, newValue)) {
flushIfNeeded();
return true;
};
}
}
return false;
}

View File

@@ -21,7 +21,7 @@ import java.util.regex.Pattern;
/**
* Implementation of AbstractRegexPatternMatchingFileListFilter for java.io.File instances.
*
*
* @author Mark Fisher
*/
public class RegexPatternFileListFilter extends AbstractRegexPatternFileListFilter<File> {

View File

@@ -50,7 +50,8 @@ public class NioFileLocker extends AbstractFileLockerFilter {
FileLock newLock = null;
try {
newLock = FileChannelCache.tryLockFor(fileToLock);
} catch (IOException e) {
}
catch (IOException e) {
throw new MessagingException("Failed to lock file: "
+ fileToLock, e);
}
@@ -73,7 +74,8 @@ public class NioFileLocker extends AbstractFileLockerFilter {
fileLock.release();
}
FileChannelCache.closeChannelFor(fileToUnlock);
} catch (IOException e) {
}
catch (IOException e) {
throw new MessagingException("Failed to unlock file: "
+ fileToUnlock, e);
}

Some files were not shown because too many files have changed in this diff Show More