Remove trailing whitespace in source files

find . -type f -name "*.java" -or -name "*.aj" | \
    xargs perl -p -i -e "s/[ \t]*$//g" {} \;

Issue: SPR-10127
This commit is contained in:
Phillip Webb
2012-12-18 13:45:00 -08:00
committed by Chris Beams
parent 44a474a014
commit 1762157ad1
1400 changed files with 5920 additions and 5923 deletions

View File

@@ -103,7 +103,7 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
}
}
}
parserContext.popAndRegisterContainingComponent();
return null;
}
@@ -111,7 +111,7 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
private void parseListener(Element listenerEle, Element containerEle, ParserContext parserContext) {
RootBeanDefinition listenerDef = new RootBeanDefinition();
listenerDef.setSource(parserContext.extractSource(listenerEle));
String ref = listenerEle.getAttribute(REF_ATTRIBUTE);
if (!StringUtils.hasText(ref)) {
parserContext.getReaderContext().error(
@@ -164,11 +164,11 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
containerDef.getPropertyValues().add("messageListener", listenerDef);
String containerBeanName = listenerEle.getAttribute(ID_ATTRIBUTE);
// If no bean id is given auto generate one using the ReaderContext's BeanNameGenerator
// If no bean id is given auto generate one using the ReaderContext's BeanNameGenerator
if (!StringUtils.hasText(containerBeanName)) {
containerBeanName = parserContext.getReaderContext().generateBeanName(containerDef);
}
// Register the listener and fire event
parserContext.registerBeanComponent(new BeanComponentDefinition(containerDef, containerBeanName));
}

View File

@@ -41,7 +41,7 @@ class JcaListenerContainerParser extends AbstractListenerContainerParser {
RootBeanDefinition containerDef = new RootBeanDefinition();
containerDef.setSource(parserContext.extractSource(containerEle));
containerDef.setBeanClassName("org.springframework.jms.listener.endpoint.JmsMessageEndpointManager");
if (containerEle.hasAttribute(RESOURCE_ADAPTER_ATTRIBUTE)) {
String resourceAdapterBeanName = containerEle.getAttribute(RESOURCE_ADAPTER_ATTRIBUTE);
if (!StringUtils.hasText(resourceAdapterBeanName)) {
@@ -73,7 +73,7 @@ class JcaListenerContainerParser extends AbstractListenerContainerParser {
RootBeanDefinition configDef = new RootBeanDefinition();
configDef.setSource(parserContext.extractSource(configDef));
configDef.setBeanClassName("org.springframework.jms.listener.endpoint.JmsActivationSpecConfig");
parseListenerConfiguration(listenerEle, parserContext, configDef);
parseContainerConfiguration(containerEle, parserContext, configDef);

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2012 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.
@@ -28,7 +28,7 @@ import org.springframework.util.StringUtils;
/**
* Parser for the JMS <code>&lt;listener-container&gt;</code> element.
*
*
* @author Mark Fisher
* @author Juergen Hoeller
* @since 2.5
@@ -53,7 +53,7 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
protected BeanDefinition parseContainer(Element listenerEle, Element containerEle, ParserContext parserContext) {
RootBeanDefinition containerDef = new RootBeanDefinition();
containerDef.setSource(parserContext.extractSource(containerEle));
parseListenerConfiguration(listenerEle, parserContext, containerDef);
parseContainerConfiguration(containerEle, parserContext, containerDef);

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2007 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.

View File

@@ -24,7 +24,7 @@ import org.springframework.jms.JmsException;
/**
* Specifies a basic set of JMS operations.
*
*
* <p>Implemented by {@link JmsTemplate}. Not often used but a useful option
* to enhance testability, as it can easily be mocked or stubbed.
*

View File

@@ -22,7 +22,7 @@ import javax.jms.Session;
/**
* Creates a JMS message given a {@link Session}.
*
*
* <p>The <code>Session</code> typically is provided by an instance
* of the {@link JmsTemplate} class.
*
@@ -40,7 +40,7 @@ public interface MessageCreator {
/**
* Create a {@link Message} to be sent.
* @param session the JMS {@link Session} to be used to create the
* <code>Message</code> (never <code>null</code>)
* <code>Message</code> (never <code>null</code>)
* @return the <code>Message</code> to be sent
* @throws javax.jms.JMSException if thrown by JMS API methods
*/

View File

@@ -46,7 +46,7 @@ public interface ProducerCallback<T> {
* when specified in the JmsTemplate call.
* @param session the JMS <code>Session</code> object to use
* @param producer the JMS <code>MessageProducer</code> object to use
* @return a result object from working with the <code>Session</code>, if any (can be <code>null</code>)
* @return a result object from working with the <code>Session</code>, if any (can be <code>null</code>)
* @throws javax.jms.JMSException if thrown by JMS API methods
*/
T doInJms(Session session, MessageProducer producer) throws JMSException;

View File

@@ -22,7 +22,7 @@ import javax.jms.Session;
/**
* Callback for executing any number of operations on a provided
* {@link Session}.
*
*
* <p>To be used with the {@link JmsTemplate#execute(SessionCallback)}
* method, often implemented as an anonymous inner class.
*
@@ -36,7 +36,7 @@ public interface SessionCallback<T> {
* Execute any number of operations against the supplied JMS
* {@link Session}, possibly returning a result.
* @param session the JMS <code>Session</code>
* @return a result object from working with the <code>Session</code>, if any (so can be <code>null</code>)
* @return a result object from working with the <code>Session</code>, if any (so can be <code>null</code>)
* @throws javax.jms.JMSException if thrown by JMS API methods
*/
T doInJms(Session session) throws JMSException;

View File

@@ -27,7 +27,7 @@ import org.springframework.jms.core.JmsTemplate;
/**
* Convenient super class for application classes that need JMS access.
*
*
* <p>Requires a ConnectionFactory or a JmsTemplate instance to be set.
* It will create its own JmsTemplate if a ConnectionFactory is passed in.
* A custom JmsTemplate instance can be created for a given ConnectionFactory
@@ -44,7 +44,7 @@ public abstract class JmsGatewaySupport implements InitializingBean {
/** Logger available to subclasses */
protected final Log logger = LogFactory.getLog(getClass());
private JmsTemplate jmsTemplate;
@@ -58,7 +58,7 @@ public abstract class JmsGatewaySupport implements InitializingBean {
public final void setConnectionFactory(ConnectionFactory connectionFactory) {
this.jmsTemplate = createJmsTemplate(connectionFactory);
}
/**
* Create a JmsTemplate for the given ConnectionFactory.
* Only invoked if populating the gateway with a ConnectionFactory reference.
@@ -72,14 +72,14 @@ public abstract class JmsGatewaySupport implements InitializingBean {
protected JmsTemplate createJmsTemplate(ConnectionFactory connectionFactory) {
return new JmsTemplate(connectionFactory);
}
/**
* Return the JMS ConnectionFactory used by the gateway.
*/
public final ConnectionFactory getConnectionFactory() {
return (this.jmsTemplate != null ? this.jmsTemplate.getConnectionFactory() : null);
}
/**
* Set the JmsTemplate for the gateway.
* @param jmsTemplate
@@ -88,14 +88,14 @@ public abstract class JmsGatewaySupport implements InitializingBean {
public final void setJmsTemplate(JmsTemplate jmsTemplate) {
this.jmsTemplate = jmsTemplate;
}
/**
* Return the JmsTemplate for the gateway.
*/
public final JmsTemplate getJmsTemplate() {
return this.jmsTemplate;
}
public final void afterPropertiesSet() throws IllegalArgumentException, BeanInitializationException {
if (this.jmsTemplate == null) {
throw new IllegalArgumentException("'connectionFactory' or 'jmsTemplate' is required");
@@ -107,7 +107,7 @@ public abstract class JmsGatewaySupport implements InitializingBean {
throw new BeanInitializationException("Initialization of JMS gateway failed: " + ex.getMessage(), ex);
}
}
/**
* Subclasses can override this for custom initialization behavior.
* Gets called after population of this instance's bean properties.

View File

@@ -87,7 +87,7 @@ import org.springframework.util.ClassUtils;
* shrinking back to the standard number of consumers once the load decreases.
* Consider adapting the {@link #setIdleTaskExecutionLimit "idleTaskExecutionLimit"}
* setting to control the lifespan of each new task, to avoid frequent scaling up
* and down, in particular if the {@code ConnectionFactory} does not pool JMS
* and down, in particular if the {@code ConnectionFactory} does not pool JMS
* {@code Sessions} and/or the {@code TaskExecutor} does not pool threads (check
* your configuration!). Note that dynamic scaling only really makes sense for a
* queue in the first place; for a topic, you will typically stick with the default
@@ -421,7 +421,7 @@ public class DefaultMessageListenerContainer extends AbstractPollingMessageListe
}
/**
* Return the limit for the number of idle consumers.
* Return the limit for the number of idle consumers.
*/
public final int getIdleConsumerLimit() {
synchronized (this.lifecycleMonitor) {

View File

@@ -2,7 +2,7 @@
/**
*
* Remoting classes for transparent Java-to-Java remoting via a JMS provider.
*
*
* <p>Allows the target service to be load-balanced across a number of queue
* receivers, and provides a level of indirection between the client and the
* service: They only need to agree on a queue name and a service interface.

View File

@@ -22,7 +22,7 @@ import javax.jms.Session;
/**
* Strategy interface for resolving JMS destinations.
*
*
* <p>Used by {@link org.springframework.jms.core.JmsTemplate} for resolving
* destination names from simple {@link String Strings} to actual
* {@link Destination} implementation instances.

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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.

View File

@@ -1,13 +1,13 @@
/*
* Copyright 2002-2005 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.

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2005 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.

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2007 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.
@@ -22,7 +22,7 @@ import javax.jms.JMSException;
/**
* A stub implementation of the JMS ConnectionFactory for testing.
*
*
* @author Mark Fisher
*/
public class StubConnectionFactory implements ConnectionFactory {

View File

@@ -1,12 +1,12 @@
/*
* Copyright 2002-2010 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.
@@ -184,9 +184,9 @@ public class JmsNamespaceHandlerTests extends TestCase {
assertTrue("Parser should have registered a component named 'listener1'", context.containsComponentDefinition("listener1"));
assertTrue("Parser should have registered a component named 'listener2'", context.containsComponentDefinition("listener2"));
assertTrue("Parser should have registered a component named 'listener3'", context.containsComponentDefinition("listener3"));
assertTrue("Parser should have registered a component named '" + DefaultMessageListenerContainer.class.getName() + "#0'",
assertTrue("Parser should have registered a component named '" + DefaultMessageListenerContainer.class.getName() + "#0'",
context.containsComponentDefinition(DefaultMessageListenerContainer.class.getName() + "#0"));
assertTrue("Parser should have registered a component named '" + JmsMessageEndpointManager.class.getName() + "#0'",
assertTrue("Parser should have registered a component named '" + JmsMessageEndpointManager.class.getName() + "#0'",
context.containsComponentDefinition(JmsMessageEndpointManager.class.getName() + "#0"));
}
@@ -215,14 +215,14 @@ public class JmsNamespaceHandlerTests extends TestCase {
this.message = message;
}
}
/**
* Internal extension that registers a {@link ReaderEventListener} to store
* registered {@link ComponentDefinition}s.
*/
private static class ToolingTestApplicationContext extends ClassPathXmlApplicationContext {
private Set<ComponentDefinition> registeredComponents;
public ToolingTestApplicationContext(String path, Class clazz) {
@@ -234,7 +234,7 @@ public class JmsNamespaceHandlerTests extends TestCase {
beanDefinitionReader.setEventListener(new StoringReaderEventListener(this.registeredComponents));
beanDefinitionReader.setSourceExtractor(new PassThroughSourceExtractor());
}
public boolean containsComponentDefinition(String name) {
for (ComponentDefinition cd : this.registeredComponents) {
if (cd instanceof CompositeComponentDefinition) {
@@ -253,21 +253,21 @@ public class JmsNamespaceHandlerTests extends TestCase {
}
return false;
}
public Iterator<ComponentDefinition> getRegisteredComponents() {
return this.registeredComponents.iterator();
}
}
private static class StoringReaderEventListener extends EmptyReaderEventListener {
protected final Set<ComponentDefinition> registeredComponents;
public StoringReaderEventListener(Set<ComponentDefinition> registeredComponents) {
this.registeredComponents = registeredComponents;
}
public void componentRegistered(ComponentDefinition componentDefinition) {
this.registeredComponents.add(componentDefinition);
}

View File

@@ -47,7 +47,7 @@ public class JmsGatewaySupportTests extends TestCase {
assertEquals("Correct JmsTemplate", mockConnectionFactory, gateway.getJmsTemplate().getConnectionFactory());
assertEquals("initGatway called", test.size(), 1);
connectionFactoryControl.verify();
}
public void testJmsGatewaySupportWithJmsTemplate() throws Exception {
JmsTemplate template = new JmsTemplate();
@@ -60,7 +60,7 @@ public class JmsGatewaySupportTests extends TestCase {
gateway.setJmsTemplate(template);
gateway.afterPropertiesSet();
assertEquals("Correct JmsTemplate", template, gateway.getJmsTemplate());
assertEquals("initGateway called", test.size(), 1);
assertEquals("initGateway called", test.size(), 1);
}
}

View File

@@ -28,7 +28,7 @@ public abstract class AbstractMessageListenerContainerTests {
protected abstract AbstractMessageListenerContainer getContainer();
@Test(expected=IllegalArgumentException.class)
public void testSettingMessageListenerToANullType() throws Exception {
getContainer().setMessageListener(null);

View File

@@ -379,7 +379,7 @@ public final class MessageListenerAdapter102Tests {
QueueSender queueSender = (QueueSender) mockQueueSender.getMock();
queueSender.send(responseTextMessage);
mockQueueSender.setThrowable(new JMSException("Dow!"));
// ensure that regardless of a JMSException the producer is closed...
// ensure that regardless of a JMSException the producer is closed...
queueSender.close();
mockQueueSender.setVoidCallable();
mockQueueSender.replay();

View File

@@ -50,7 +50,7 @@ public class CallCountingTransactionManager extends AbstractPlatformTransactionM
++rollbacks;
--inflight;
}
public void clear() {
begun = commits = rollbacks = inflight = 0;
}