[jboss-cvs] JBossCache/src/org/jboss/cache/optimistic ...
Manik Surtani
msurtani at jboss.com
Sat Dec 30 14:48:46 EST 2006
User: msurtani
Date: 06/12/30 14:48:46
Modified: src/org/jboss/cache/optimistic WorkspaceNode.java
FqnComparator.java TransactionWorkspace.java
WorkspaceNodeImpl.java
Log:
Genericised, autoboxed
Revision Changes Path
1.19 +4 -4 JBossCache/src/org/jboss/cache/optimistic/WorkspaceNode.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WorkspaceNode.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/optimistic/WorkspaceNode.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- WorkspaceNode.java 30 Dec 2006 17:50:04 -0000 1.18
+++ WorkspaceNode.java 30 Dec 2006 19:48:46 -0000 1.19
@@ -23,21 +23,21 @@
*/
public interface WorkspaceNode extends Node
{
- public Map getMergedChildren();
+ public Map<Object, NodeSPI> getMergedChildren();
public DataVersion getVersion();
public void setVersion(DataVersion version);
- public Set getKeys();
+ public Set<Object> getKeys();
public boolean isDirty();
- public Map getMergedData();
+ public Map<Object, Object> getMergedData();
public NodeSPI getNode();
- public Set getChildrenNames();
+ public Set<Object> getChildrenNames();
public TransactionWorkspace getTransactionWorkspace();
1.7 +1 -1 JBossCache/src/org/jboss/cache/optimistic/FqnComparator.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: FqnComparator.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/optimistic/FqnComparator.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- FqnComparator.java 29 Dec 2006 14:46:59 -0000 1.6
+++ FqnComparator.java 30 Dec 2006 19:48:46 -0000 1.7
@@ -81,7 +81,7 @@
* returns e1.compareTo(e2).
* Otherwise, returns e1.toString().compareTo(e2.toString()).
*/
- protected int compareElements(Object e1, Object e2)
+ private int compareElements(Object e1, Object e2)
{
if (e1.getClass() == e2.getClass() && e1 instanceof Comparable)
{
1.13 +1 -1 JBossCache/src/org/jboss/cache/optimistic/TransactionWorkspace.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: TransactionWorkspace.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/optimistic/TransactionWorkspace.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- TransactionWorkspace.java 12 Dec 2006 14:51:44 -0000 1.12
+++ TransactionWorkspace.java 30 Dec 2006 19:48:46 -0000 1.13
@@ -49,7 +49,7 @@
/**
* Returns all nodes equal to or after the given node.
*/
- public SortedMap getNodesAfter(Fqn fqn);
+ public SortedMap<Fqn, WorkspaceNode> getNodesAfter(Fqn fqn);
/**
* Tests if versioning is implicit for a given tx.
1.34 +16 -21 JBossCache/src/org/jboss/cache/optimistic/WorkspaceNodeImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WorkspaceNodeImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/optimistic/WorkspaceNodeImpl.java,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -b -r1.33 -r1.34
--- WorkspaceNodeImpl.java 30 Dec 2006 17:50:04 -0000 1.33
+++ WorkspaceNodeImpl.java 30 Dec 2006 19:48:46 -0000 1.34
@@ -42,7 +42,7 @@
private boolean dirty;
private boolean created;
private Map<Object, NodeSPI> optimisticChildNodeMap;
- private Map optimisticDataMap;
+ private Map<Object, Object> optimisticDataMap;
private boolean versioningImplicit;
/**
@@ -56,12 +56,12 @@
}
this.node = node;
this.workspace = workspace;
- optimisticDataMap = new HashMap(node.getRawData());
- Map childrenMap = node.getChildrenMap();
+ optimisticDataMap = new HashMap<Object, Object>(node.getRawData());
+ Map<Object, Node> childrenMap = node.getChildrenMap();
if (childrenMap == null)
- optimisticChildNodeMap = new ConcurrentHashMap();
+ optimisticChildNodeMap = new ConcurrentHashMap<Object, NodeSPI>();
else
- optimisticChildNodeMap = new ConcurrentHashMap(node.getChildrenMap());
+ optimisticChildNodeMap = new ConcurrentHashMap(childrenMap);
this.version = node.getVersion();
if (version == null)
{
@@ -82,13 +82,13 @@
return node.getFqn();
}
- public void put(Map data, boolean eraseData)
+ public void put(Map<Object, Object> data, boolean eraseData)
{
realPut(data, eraseData);
dirty = true;
}
- public void put(Map data)
+ public void put(Map<Object, Object> data)
{
realPut(data, false);
dirty = true;
@@ -119,23 +119,23 @@
return optimisticDataMap.get(key);
}
- public Set getKeys()
+ public Set<Object> getKeys()
{
return optimisticDataMap.keySet();
}
//not able to delete from this
- public Set getChildrenNames()
+ public Set<Object> getChildrenNames()
{
- return new HashSet(optimisticChildNodeMap.keySet());
+ return new HashSet<Object>(optimisticChildNodeMap.keySet());
}
- private void realPut(Map data, boolean eraseData)
+ private void realPut(Map<Object, Object> data, boolean eraseData)
{
realPut(data, eraseData, true);
}
- private void realPut(Map data, boolean eraseData, boolean forceDirtyFlag)
+ private void realPut(Map<Object, Object> data, boolean eraseData, boolean forceDirtyFlag)
{
if (forceDirtyFlag) dirty = true;
if (eraseData)
@@ -256,7 +256,7 @@
this.version = version;
}
- public Map getMergedChildren()
+ public Map<Object, NodeSPI> getMergedChildren()
{
//return mergeMaps((OptimisticMap) optimisticChildNodeMap);
return optimisticChildNodeMap;
@@ -282,7 +282,7 @@
// return opMap.getLocalMap();
// }
- public Map getMergedData()
+ public Map<Object, Object> getMergedData()
{
return optimisticDataMap;
}
@@ -308,16 +308,11 @@
dirty = true;
}
- public Map getData()
+ public Map<Object, Object> getData()
{
return Collections.unmodifiableMap(optimisticDataMap);
}
- public Map getChildrenMap()
- {
- return Collections.unmodifiableMap(optimisticChildNodeMap);
- }
-
public boolean containsKey(Object key)
{
return optimisticDataMap.containsKey(key);
@@ -426,7 +421,7 @@
}
- public void putIfNull(Map m)
+ public void putIfNull(Map<Object, Object> m)
{
throw new UnsupportedOperationException();
// TODO Auto-generated method stub
More information about the jboss-cvs-commits
mailing list