Java 5 code style
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2008 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.
|
||||
@@ -220,8 +220,8 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
|
||||
parserContext.getReaderContext().error("Invalid listener container 'destination-type': " +
|
||||
"only \"queue\", \"topic\" and \"durableTopic\" supported.", ele);
|
||||
}
|
||||
configDef.getPropertyValues().addPropertyValue("pubSubDomain", Boolean.valueOf(pubSubDomain));
|
||||
configDef.getPropertyValues().addPropertyValue("subscriptionDurable", Boolean.valueOf(subscriptionDurable));
|
||||
configDef.getPropertyValues().addPropertyValue("pubSubDomain", pubSubDomain);
|
||||
configDef.getPropertyValues().addPropertyValue("subscriptionDurable", subscriptionDurable);
|
||||
|
||||
if (ele.hasAttribute(CLIENT_ID_ATTRIBUTE)) {
|
||||
String clientId = ele.getAttribute(CLIENT_ID_ATTRIBUTE);
|
||||
@@ -250,7 +250,7 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
|
||||
parserContext.getReaderContext().error("Invalid listener container 'acknowledge' setting [" +
|
||||
acknowledge + "]: only \"auto\", \"client\", \"dups-ok\" and \"transacted\" supported.", ele);
|
||||
}
|
||||
return new Integer(acknowledgeMode);
|
||||
return acknowledgeMode;
|
||||
}
|
||||
else {
|
||||
return null;
|
||||
@@ -258,7 +258,7 @@ abstract class AbstractListenerContainerParser implements BeanDefinitionParser {
|
||||
}
|
||||
|
||||
protected boolean indicatesPubSubConfig(BeanDefinition configDef) {
|
||||
return ((Boolean) configDef.getPropertyValues().getPropertyValue("pubSubDomain").getValue()).booleanValue();
|
||||
return (Boolean) configDef.getPropertyValues().getPropertyValue("pubSubDomain").getValue();
|
||||
}
|
||||
|
||||
protected int[] parseConcurrency(Element ele, ParserContext parserContext) {
|
||||
|
||||
@@ -89,7 +89,7 @@ class JcaListenerContainerParser extends AbstractListenerContainerParser {
|
||||
|
||||
int[] concurrency = parseConcurrency(containerEle, parserContext);
|
||||
if (concurrency != null) {
|
||||
configDef.getPropertyValues().addPropertyValue("maxConcurrency", new Integer(concurrency[1]));
|
||||
configDef.getPropertyValues().addPropertyValue("maxConcurrency", concurrency[1]);
|
||||
}
|
||||
|
||||
String prefetch = containerEle.getAttribute(PREFETCH_ATTRIBUTE);
|
||||
|
||||
@@ -114,7 +114,7 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
|
||||
|
||||
Integer acknowledgeMode = parseAcknowledgeMode(containerEle, parserContext);
|
||||
if (acknowledgeMode != null) {
|
||||
if (acknowledgeMode.intValue() == Session.SESSION_TRANSACTED) {
|
||||
if (acknowledgeMode == Session.SESSION_TRANSACTED) {
|
||||
containerDef.getPropertyValues().addPropertyValue("sessionTransacted", Boolean.TRUE);
|
||||
}
|
||||
else {
|
||||
@@ -137,11 +137,11 @@ class JmsListenerContainerParser extends AbstractListenerContainerParser {
|
||||
int[] concurrency = parseConcurrency(containerEle, parserContext);
|
||||
if (concurrency != null) {
|
||||
if (containerType.startsWith("default")) {
|
||||
containerDef.getPropertyValues().addPropertyValue("concurrentConsumers", new Integer(concurrency[0]));
|
||||
containerDef.getPropertyValues().addPropertyValue("maxConcurrentConsumers", new Integer(concurrency[1]));
|
||||
containerDef.getPropertyValues().addPropertyValue("concurrentConsumers", concurrency[0]);
|
||||
containerDef.getPropertyValues().addPropertyValue("maxConcurrentConsumers", concurrency[1]);
|
||||
}
|
||||
else {
|
||||
containerDef.getPropertyValues().addPropertyValue("concurrentConsumers", new Integer(concurrency[1]));
|
||||
containerDef.getPropertyValues().addPropertyValue("concurrentConsumers", concurrency[1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ public class CachingConnectionFactory extends SingleConnectionFactory {
|
||||
String methodName = method.getName();
|
||||
if (methodName.equals("equals")) {
|
||||
// Only consider equal when proxies are identical.
|
||||
return (proxy == args[0] ? Boolean.TRUE : Boolean.FALSE);
|
||||
return (proxy == args[0]);
|
||||
}
|
||||
else if (methodName.equals("hashCode")) {
|
||||
// Use hashCode of Session proxy.
|
||||
|
||||
@@ -473,7 +473,7 @@ public class SingleConnectionFactory
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
if (method.getName().equals("equals")) {
|
||||
// Only consider equal when proxies are identical.
|
||||
return (proxy == args[0] ? Boolean.TRUE : Boolean.FALSE);
|
||||
return (proxy == args[0]);
|
||||
}
|
||||
else if (method.getName().equals("hashCode")) {
|
||||
// Use hashCode of Connection proxy.
|
||||
|
||||
@@ -223,11 +223,11 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
|
||||
if (method.getName().equals("equals")) {
|
||||
// Only consider equal when proxies are identical.
|
||||
return (proxy == args[0] ? Boolean.TRUE : Boolean.FALSE);
|
||||
return (proxy == args[0]);
|
||||
}
|
||||
else if (method.getName().equals("hashCode")) {
|
||||
// Use hashCode of Connection proxy.
|
||||
return new Integer(System.identityHashCode(proxy));
|
||||
return System.identityHashCode(proxy);
|
||||
}
|
||||
else if (Session.class.equals(method.getReturnType())) {
|
||||
Session session = ConnectionFactoryUtils.getTransactionalSession(
|
||||
@@ -295,11 +295,11 @@ public class TransactionAwareConnectionFactoryProxy
|
||||
|
||||
if (method.getName().equals("equals")) {
|
||||
// Only consider equal when proxies are identical.
|
||||
return (proxy == args[0] ? Boolean.TRUE : Boolean.FALSE);
|
||||
return (proxy == args[0]);
|
||||
}
|
||||
else if (method.getName().equals("hashCode")) {
|
||||
// Use hashCode of Connection proxy.
|
||||
return new Integer(System.identityHashCode(proxy));
|
||||
return System.identityHashCode(proxy);
|
||||
}
|
||||
else if (method.getName().equals("commit")) {
|
||||
throw new TransactionInProgressException("Commit call not allowed within a managed transaction");
|
||||
|
||||
Reference in New Issue
Block a user