Author: manik.surtani(a)jboss.com
Date: 2008-01-04 10:56:39 -0500 (Fri, 04 Jan 2008)
New Revision: 4983
Modified:
core/branches/1.4.X/src/org/jboss/cache/Node.java
core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
core/branches/1.4.X/src/org/jboss/cache/marshall/JBCMethodCall.java
Log:
JBCACHE-1230 - reduced noisy toString() implementations
Modified: core/branches/1.4.X/src/org/jboss/cache/Node.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/Node.java 2008-01-04 14:38:52 UTC (rev 4982)
+++ core/branches/1.4.X/src/org/jboss/cache/Node.java 2008-01-04 15:56:39 UTC (rev 4983)
@@ -445,7 +445,31 @@
synchronized (this)
{
if (data != null)
- sb.append("\ndata=" + data);
+ sb.append("\ndata=[");
+ Set keys = data.keySet();
+ int i=0;
+ for (Iterator it = keys.iterator(); it.hasNext();)
+ {
+ i++;
+ sb.append(it.next());
+
+ if (i == 5)
+ {
+ int more = keys.size() - 5;
+ if (more > 1)
+ {
+ sb.append(", and ");
+ sb.append(more);
+ sb.append(" more");
+ break;
+ }
+ }
+ else
+ {
+ sb.append(", ");
+ }
+ }
+ sb.append("]");
}
if (lock_ != null)
{
Modified: core/branches/1.4.X/src/org/jboss/cache/TreeCache.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-01-04 14:38:52 UTC (rev
4982)
+++ core/branches/1.4.X/src/org/jboss/cache/TreeCache.java 2008-01-04 15:56:39 UTC (rev
4983)
@@ -4422,7 +4422,7 @@
if (rsps == null)
{
// return null;
- throw new NotSerializableException("RpcDispatcher returned a null. This is
most often caused by args for " + method_call + " not being
serializable.");
+ throw new NotSerializableException("RpcDispatcher returned a null. This is
most often caused by args for " + method_call.getName() + " not being
serializable.");
}
if (mode == GroupRequest.GET_NONE)
Modified: core/branches/1.4.X/src/org/jboss/cache/marshall/JBCMethodCall.java
===================================================================
--- core/branches/1.4.X/src/org/jboss/cache/marshall/JBCMethodCall.java 2008-01-04
14:38:52 UTC (rev 4982)
+++ core/branches/1.4.X/src/org/jboss/cache/marshall/JBCMethodCall.java 2008-01-04
15:56:39 UTC (rev 4983)
@@ -65,17 +65,12 @@
ret.append(method_name);
ret.append("; id:");
ret.append(methodId);
- ret.append('(');
- if (args != null)
+ ret.append("; Args: (");
+ if (args != null && args.length > 0)
{
- for (int i = 0; i < args.length; i++)
- {
- if (first)
- first = false;
- else
- ret.append(", ");
- ret.append(args[i]);
- }
+ ret.append(" arg[0] = ");
+ ret.append(args[0]);
+ if (args.length > 1) ret.append(" ...");
}
ret.append(')');
return ret.toString();
Show replies by date