Author: manik.surtani(a)jboss.com
Date: 2008-06-26 19:09:12 -0400 (Thu, 26 Jun 2008)
New Revision: 6076
Modified:
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java
core/trunk/src/main/java/org/jboss/cache/config/CacheLoaderConfig.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigHelper.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
core/trunk/src/main/java/org/jboss/cache/eviction/ElementSizeConfiguration.java
core/trunk/src/main/java/org/jboss/cache/eviction/FIFOConfiguration.java
core/trunk/src/main/java/org/jboss/cache/eviction/LFUConfiguration.java
core/trunk/src/main/java/org/jboss/cache/eviction/MRUConfiguration.java
core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java
core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderOld.java
core/trunk/src/main/java/org/jboss/cache/loader/tcp/TcpCacheServer.java
core/trunk/src/main/java/org/jboss/cache/marshall/MethodCall.java
core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java
core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
core/trunk/src/test/java/org/jboss/cache/marshall/data/Debug.java
core/trunk/src/test/java/org/jboss/cache/marshall/data/Person.java
core/trunk/src/test/java/org/jboss/cache/mock/NodeSpiMock.java
core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java
Log:
Replaced StringBuffer with StringBuilder
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyGroup.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -89,7 +89,7 @@
@Override
public String toString()
{
- StringBuffer b = new StringBuffer("BuddyGroup: (");
+ StringBuilder b = new StringBuilder("BuddyGroup: (");
b.append("dataOwner: ").append(dataOwner).append(", ");
b.append("groupName: ").append(groupName).append(", ");
b.append("buddies: ").append(buddies).append(",");
Modified: core/trunk/src/main/java/org/jboss/cache/config/CacheLoaderConfig.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/CacheLoaderConfig.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/config/CacheLoaderConfig.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -89,7 +89,7 @@
@Override
public String toString()
{
- return new
StringBuffer().append("CacheLoaderConfig{").append("shared=").append(shared).append(",
passivation=").append(passivation).append(",
preload='").append(preload).append('\'').append(",
cacheLoaderConfigs.size()=").append(cacheLoaderConfigs.size()).append('}').toString();
+ return new
StringBuilder().append("CacheLoaderConfig{").append("shared=").append(shared).append(",
passivation=").append(passivation).append(",
preload='").append(preload).append('\'').append(",
cacheLoaderConfigs.size()=").append(cacheLoaderConfigs.size()).append('}').toString();
}
public void setShared(boolean shared)
@@ -319,7 +319,7 @@
@Override
public String toString()
{
- return new
StringBuffer().append("IndividualCacheLoaderConfig{").append("className='").append(className).append('\'')
+ return new
StringBuilder().append("IndividualCacheLoaderConfig{").append("className='").append(className).append('\'')
.append(", async=").append(async)
.append(", ignoreModifications=").append(ignoreModifications)
.append(", fetchPersistentState=").append(fetchPersistentState)
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java 2008-06-26
23:08:29 UTC (rev 6075)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/JGroupsStackParser.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -1,14 +1,14 @@
package org.jboss.cache.config.parsing;
+import org.w3c.dom.Attr;
import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.NodeList;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Attr;
/**
* The purpose of this class is to parse the jgroups configuration from the config file
into an compact string
* that can be passed as a config to the channel.
- *
+ *
* @author Mircea.Markus(a)jboss.com
* @since 3.0
*/
@@ -21,7 +21,7 @@
*/
public String parseClusterConfigXml(Element config)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
NodeList stack = config.getChildNodes();
int length = stack.getLength();
@@ -44,7 +44,7 @@
return buffer.toString();
}
- private void processAttributes(StringBuffer buffer, Element tag)
+ private void processAttributes(StringBuilder buffer, Element tag)
{
NamedNodeMap attrs = tag.getAttributes();
int attrLength = attrs.getLength();
@@ -67,7 +67,7 @@
}
}
- private void processSingleAttribute(StringBuffer buffer, Attr attr)
+ private void processSingleAttribute(StringBuilder buffer, Attr attr)
{
String name = attr.getName();
String value = attr.getValue();
Modified: core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigHelper.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigHelper.java 2008-06-26
23:08:29 UTC (rev 6075)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigHelper.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -8,9 +8,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jboss.cache.config.ConfigurationException;
+import org.jboss.cache.util.BeanUtils;
import org.jboss.util.StringPropertyReplacer;
-import org.jboss.cache.util.BeanUtils;
-import org.jboss.cache.config.ConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -22,15 +22,15 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import java.beans.PropertyEditor;
+import java.beans.PropertyEditorManager;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Properties;
-import java.util.Map;
-import java.util.HashMap;
-import java.lang.reflect.Method;
-import java.beans.PropertyEditor;
-import java.beans.PropertyEditorManager;
/**
* A simple XML utility class for reading configuration elements
@@ -257,7 +257,7 @@
*/
public static String escapeBackslashes(String value)
{
- StringBuffer buf = new StringBuffer(value);
+ StringBuilder buf = new StringBuilder(value);
for (int looper = 0; looper < buf.length(); looper++)
{
char curr = buf.charAt(looper);
@@ -318,10 +318,11 @@
properties = new Properties();
properties.load(is);
is.close();
- } catch (IOException e)
+ }
+ catch (IOException e)
{
- log.warn("Unexpected",e);
- throw new ConfigurationException("Exception occured while reading
properties from XML document",e);
+ log.warn("Unexpected", e);
+ throw new ConfigurationException("Exception occured while reading
properties from XML document", e);
}
return properties;
}
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java 2008-06-26
23:08:29 UTC (rev 6075)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/XmlConfigurationParser2x.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -19,10 +19,9 @@
import org.jboss.cache.config.EvictionPolicyConfig;
import org.jboss.cache.config.EvictionRegionConfig;
import org.jboss.cache.config.MissingPolicyException;
+import org.jboss.cache.config.parsing.element.EvictionElementParser;
import org.jboss.cache.eviction.EvictionPolicy;
import org.jboss.cache.util.Util;
-import org.jboss.cache.config.parsing.XmlConfigHelper;
-import org.jboss.cache.config.parsing.element.EvictionElementParser;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -440,8 +439,8 @@
}
private static EvictionRegionConfig parseEvictionRegionConfig(Element element,
- String
defaultEvictionClass,
- int
defaultQueueCapacity)
+ String
defaultEvictionClass,
+ int
defaultQueueCapacity)
{
EvictionRegionConfig erc = new EvictionRegionConfig();
@@ -512,7 +511,7 @@
*/
public static String parseClusterConfigXml(Element config)
{
- StringBuffer buffer = new StringBuffer();
+ StringBuilder buffer = new StringBuilder();
NodeList stack = config.getChildNodes();
int length = stack.getLength();
Modified:
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java 2008-06-26
23:08:29 UTC (rev 6075)
+++
core/trunk/src/main/java/org/jboss/cache/config/parsing/element/LoadersElementParser.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -2,10 +2,9 @@
import org.jboss.cache.config.CacheLoaderConfig;
import org.jboss.cache.config.ConfigurationException;
-import org.jboss.cache.config.parsing.XmlParserBase;
import org.jboss.cache.config.parsing.XmlConfigHelper;
+import org.jboss.cache.config.parsing.XmlParserBase;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.Properties;
@@ -71,7 +70,7 @@
{
if (preloadElement == null) return null; //might be no preload
NodeList nodesToPreload = preloadElement.getElementsByTagName("node");
- StringBuffer result = new StringBuffer();
+ StringBuilder result = new StringBuilder();
for (int i = 0; i < nodesToPreload.getLength(); i++)
{
Element node = (Element) nodesToPreload.item(i);
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/ElementSizeConfiguration.java
===================================================================
---
core/trunk/src/main/java/org/jboss/cache/eviction/ElementSizeConfiguration.java 2008-06-26
23:08:29 UTC (rev 6075)
+++
core/trunk/src/main/java/org/jboss/cache/eviction/ElementSizeConfiguration.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -78,7 +78,7 @@
@Override
public String toString()
{
- StringBuffer str = new StringBuffer();
+ StringBuilder str = new StringBuilder();
str.append("ElementSizeConfiguration: maxElementsPerNode =");
str.append(getMaxElementsPerNode()).append(" maxNodes
=").append(getMaxNodes());
return str.toString();
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/FIFOConfiguration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/FIFOConfiguration.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/FIFOConfiguration.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -55,7 +55,7 @@
@Override
public String toString()
{
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
ret.append("LFUConfiguration: maxNodes = ").append(getMaxNodes());
return ret.toString();
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/LFUConfiguration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/LFUConfiguration.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/LFUConfiguration.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -53,7 +53,7 @@
@Override
public String toString()
{
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
ret.append("LFUConfiguration: maxNodes =
").append(getMaxNodes()).append(" minNodes = ").append(getMinNodes());
return ret.toString();
}
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/MRUConfiguration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/MRUConfiguration.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/MRUConfiguration.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -59,7 +59,7 @@
@Override
public String toString()
{
- StringBuffer str = new StringBuffer();
+ StringBuilder str = new StringBuilder();
str.append("MRUConfiguration: ").
append(" maxNodes =").append(getMaxNodes());
return str.toString();
Modified: core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/eviction/NodeEntry.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -150,7 +150,7 @@
@Override
public String toString()
{
- StringBuffer output = new StringBuffer();
+ StringBuilder output = new StringBuilder();
output.append("Fqn: ");
if (fqn != null)
{
Modified: core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/loader/ChainingCacheLoader.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -439,7 +439,7 @@
@Override
public String toString()
{
- StringBuffer buf = new StringBuffer("ChainingCacheLoader{");
+ StringBuilder buf = new StringBuilder("ChainingCacheLoader{");
Iterator<CacheLoader> i = cacheLoaders.iterator();
Iterator<CacheLoaderConfig.IndividualCacheLoaderConfig> c =
cacheLoaderConfigs.iterator();
int count = 0;
Modified: core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/loader/FileCacheLoader.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -79,7 +79,7 @@
*/
public static final Pattern FQN_PATTERN =
Pattern.compile("[\\\\\\/:*<>|\"?]");
private static boolean isOldWindows;
-
+
static
{
float osVersion = -1;
@@ -407,7 +407,7 @@
String getFullPath(Fqn fqn)
{
- StringBuffer sb = new StringBuffer(rootPath);
+ StringBuilder sb = new StringBuilder(rootPath);
for (int i = 0; i < fqn.size(); i++)
{
Object tmp = fqn.get(i);
Modified: core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderOld.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderOld.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/loader/JDBCCacheLoaderOld.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -188,7 +188,7 @@
}
else
{
- StringBuffer sql = new StringBuffer(300);
+ StringBuilder sql = new StringBuilder(300);
sql.append("delete from ").append(config.getTable()).append("
where fqn in (");
//sql2.append("delete from " + table + " where fqn=? or parent
in (");
List fqns = new ArrayList();
@@ -244,7 +244,7 @@
// Private
- private void addChildrenToDeleteSql(String name, StringBuffer sql, List fqns)
+ private void addChildrenToDeleteSql(String name, StringBuilder sql, List fqns)
throws SQLException
{
// for now have to use connection per method, i.e. can't pass the same
connection to recursive
Modified: core/trunk/src/main/java/org/jboss/cache/loader/tcp/TcpCacheServer.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/loader/tcp/TcpCacheServer.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/loader/tcp/TcpCacheServer.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -208,7 +208,7 @@
{
synchronized (conns)
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append(conns.size()).append(" connections:\n");
for (Connection c : conns)
{
@@ -450,7 +450,7 @@
@Override
public String toString()
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
if (sock != null)
{
sb.append(sock.getRemoteSocketAddress());
Modified: core/trunk/src/main/java/org/jboss/cache/marshall/MethodCall.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/marshall/MethodCall.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/marshall/MethodCall.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -89,7 +89,7 @@
@Override
public String toString()
{
- StringBuffer ret = new StringBuffer();
+ StringBuilder ret = new StringBuilder();
ret.append("MethodName: ");
ret.append(method_name);
ret.append("; MethodIdInteger: ");
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/InternalNode.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -115,5 +115,5 @@
void addChild(Object nodeName, Node<K, V> nodeToAdd);
- void printDetails(StringBuffer sb, int indent);
+ void printDetails(StringBuilder sb, int indent);
}
Modified: core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/mvcc/NodeReference.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -277,7 +277,7 @@
delegate.addChild(nodeName, nodeToAdd);
}
- public void printDetails(StringBuffer sb, int indent)
+ public void printDetails(StringBuilder sb, int indent)
{
delegate.printDetails(sb, indent);
}
Modified: core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java 2008-06-26
23:08:29 UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/optimistic/WorkspaceNodeImpl.java 2008-06-26
23:09:12 UTC (rev 6076)
@@ -331,7 +331,7 @@
@Override
public String toString()
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
if (isDeleted()) sb.append("del ");
if (isModified()) sb.append("modified ");
if (isCreated()) sb.append("new ");
Modified: core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/main/java/org/jboss/cache/util/CachePrinter.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -59,7 +59,7 @@
public static String printInterceptorChain(CommandInterceptor i)
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
if (i != null)
{
if (i.getNext() != null)
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/data/Debug.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/data/Debug.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/data/Debug.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -19,13 +19,13 @@
* @param clazz the Class
* @param results the buffer to write the info to
*/
- public static void displayClassInfo(Class clazz, StringBuffer results)
+ public static void displayClassInfo(Class clazz, StringBuilder results)
{
displayClassInfo(clazz, results, true);
}
@SuppressWarnings("null")
- public static void displayClassInfo(Class clazz, StringBuffer results,
+ public static void displayClassInfo(Class clazz, StringBuilder results,
boolean showParentClassLoaders)
{
@@ -37,7 +37,7 @@
results.append("\n.." + parent);
URL[] urls = getClassLoaderURLs(parent);
int length = urls != null ? urls.length : 0;
- for (int u = 0; u < length; u ++)
+ for (int u = 0; u < length; u++)
{
results.append("\n...." + urls[u]);
}
@@ -59,7 +59,7 @@
results.append("\nImplemented Interfaces:");
Class[] ifaces = clazz.getInterfaces();
- for (int i = 0; i < ifaces.length; i ++)
+ for (int i = 0; i < ifaces.length; i++)
{
Class iface = ifaces[i];
results.append("\n++" + iface + "(" +
Integer.toHexString(iface.hashCode()) + ")");
Modified: core/trunk/src/test/java/org/jboss/cache/marshall/data/Person.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/marshall/data/Person.java 2008-06-26 23:08:29
UTC (rev 6075)
+++ core/trunk/src/test/java/org/jboss/cache/marshall/data/Person.java 2008-06-26 23:09:12
UTC (rev 6076)
@@ -43,7 +43,7 @@
public String toString()
{
- StringBuffer sb = new StringBuffer();
+ StringBuilder sb = new StringBuilder();
sb.append("name=").append(getName()).append(" Address=
").append(address);
return sb.toString();
}
Modified: core/trunk/src/test/java/org/jboss/cache/mock/NodeSpiMock.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/mock/NodeSpiMock.java 2008-06-26 23:08:29 UTC
(rev 6075)
+++ core/trunk/src/test/java/org/jboss/cache/mock/NodeSpiMock.java 2008-06-26 23:09:12 UTC
(rev 6076)
@@ -1,14 +1,17 @@
package org.jboss.cache.mock;
-import org.jboss.cache.NodeSPI;
+import org.jboss.cache.CacheSPI;
import org.jboss.cache.Fqn;
import org.jboss.cache.Node;
-import org.jboss.cache.CacheSPI;
+import org.jboss.cache.NodeSPI;
+import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.optimistic.DataVersion;
-import org.jboss.cache.lock.NodeLock;
import org.jboss.cache.transaction.GlobalTransaction;
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
/**
* @author Mircea.Markus(a)jboss.com
@@ -117,12 +120,12 @@
((NodeSpiMock) nodeToAdd).fqn = Fqn.fromRelativeElements(fqn, nodeName);
}
- public void printDetails(StringBuffer sb, int indent)
+ public void printDetails(StringBuilder sb, int indent)
{
//skip
}
- public void print(StringBuffer sb, int indent)
+ public void print(StringBuilder sb, int indent)
{
//skip
}
@@ -169,7 +172,7 @@
Object directChildName = childName.get(0);
NodeSpiMock directChild = children.get(directChildName);
Fqn subFqn = childName.getSubFqn(1, childName.size());
- if(directChild == null)
+ if (directChild == null)
{
directChild = newChild(directChildName);
}
@@ -356,7 +359,8 @@
{
data.put(key, newValue);
return true;
- } else
+ }
+ else
return false;
}
@@ -367,7 +371,7 @@
public void replaceAll(Map map)
{
- data = map;
+ data = map;
}
public Object get(Object key)
Modified: core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java 2008-06-26 23:08:29 UTC
(rev 6075)
+++ core/trunk/src/test/java/org/jboss/cache/util/TestingUtil.java 2008-06-26 23:09:12 UTC
(rev 6076)
@@ -11,7 +11,6 @@
import org.jboss.cache.CacheSPI;
import org.jboss.cache.CacheStatus;
import org.jboss.cache.Fqn;
-import org.jboss.cache.lock.LockManager;
import org.jboss.cache.commands.VisitableCommand;
import org.jboss.cache.factories.CommandsFactory;
import org.jboss.cache.factories.ComponentRegistry;
@@ -20,7 +19,7 @@
import org.jboss.cache.invocation.CacheInvocationDelegate;
import org.jboss.cache.loader.CacheLoader;
import org.jboss.cache.loader.CacheLoaderManager;
-import org.jboss.cache.util.CachePrinter;
+import org.jboss.cache.lock.LockManager;
import org.jgroups.JChannel;
import java.io.File;
@@ -293,7 +292,7 @@
else if (memberCount < members.size())
{
// This is an exceptional condition
- StringBuffer sb = new StringBuffer("Cache at address ");
+ StringBuilder sb = new StringBuilder("Cache at address ");
sb.append(cache.getRPCManager().getLocalAddress());
sb.append(" had ");
sb.append(members.size());
@@ -338,7 +337,7 @@
if (barfIfTooManyMembers)
{
// This is an exceptional condition
- StringBuffer sb = new StringBuffer("Cache at address ");
+ StringBuilder sb = new StringBuilder("Cache at address ");
sb.append(cache.getLocalAddress());
sb.append(" had ");
sb.append(members.size());