changeset 54:d830fb5aeece default tip

bugfix byte[0] = {0} and stringtokenizer
author shoshi
date Wed, 16 Feb 2011 19:25:14 +0900
parents 7a558c7d4f41
children
files src/treecms/proto/cassandra/v1/CassBrowser.java
diffstat 1 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/treecms/proto/cassandra/v1/CassBrowser.java	Wed Feb 16 18:43:58 2011 +0900
+++ b/src/treecms/proto/cassandra/v1/CassBrowser.java	Wed Feb 16 19:25:14 2011 +0900
@@ -409,21 +409,29 @@
 	
 	public String getClassName(NodeID _id)
 	{
-		return new String(getColumn(_id.toString(),CLASSNAME));
+		byte[] res = getColumn(_id.toString(),CLASSNAME);
+		if(res == null){
+			return "";
+		}
+		return new String(res);
 	}
 	
 	public String getChildrenRaw(NodeID _id)
 	{
-		String res = new String(getColumn(_id.toString(),CHILDREN));
+		byte[] res = getColumn(_id.toString(),CHILDREN);
 		if(res == null){
 			return "";
 		}
-		return res;
+		return new String(res);
 	}
 	
 	public String getTitle(NodeID _id)
 	{
-		return new String(getColumn(_id.toString(),TITLE));
+		byte[] res = getColumn(_id.toString(),TITLE);
+		if(res == null){
+			return "";
+		}
+		return new String(res);
 	}
 	
 	public void setTitle(NodeID _id,String _title)
@@ -495,7 +503,7 @@
 		path.column_family = m_colFamily;
 		path.column = _colName.getBytes();
 		
-		byte[] value = {0};
+		byte[] value = null;
 		try{
 			ColumnOrSuperColumn column;
 			column = m_cassandra.get(m_keySpace,_row,path,ConsistencyLevel.ALL);