[jboss-cvs] JBossCache/src/org/jboss/cache ...
Manik Surtani
manik at jboss.org
Mon Jun 11 08:58:16 EDT 2007
User: msurtani
Date: 07/06/11 08:58:16
Modified: src/org/jboss/cache Version.java CacheImpl.java
Log:
Reduce Java5 related ide generated warnings
Revision Changes Path
1.32 +5 -6 JBossCache/src/org/jboss/cache/Version.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Version.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/Version.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- Version.java 16 May 2007 16:10:10 -0000 1.31
+++ Version.java 11 Jun 2007 12:58:16 -0000 1.32
@@ -6,14 +6,14 @@
* Contains version information about this release of JBoss Cache.
*
* @author Bela Ban
- * @version $Id: Version.java,v 1.31 2007/05/16 16:10:10 msurtani Exp $
+ * @version $Id: Version.java,v 1.32 2007/06/11 12:58:16 msurtani Exp $
*/
public class Version
{
public static final String version = "2.0.0.CR2";
public static final String codename = "Habanero";
public static byte[] version_id = {'0', '2', '0', '0', 'c'};
- public static final String cvs = "$Id: Version.java,v 1.31 2007/05/16 16:10:10 msurtani Exp $";
+ public static final String cvs = "$Id: Version.java,v 1.32 2007/06/11 12:58:16 msurtani Exp $";
private static final int MAJOR_SHIFT = 11;
private static final int MINOR_SHIFT = 6;
@@ -61,8 +61,7 @@
StringBuffer sb = new StringBuffer();
if (v != null)
{
- for (int i = 0; i < v.length; i++)
- sb.append((char) v[i]);
+ for (byte aV : v) sb.append((char) aV);
}
return sb.toString();
}
1.86 +58 -65 JBossCache/src/org/jboss/cache/CacheImpl.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: CacheImpl.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/CacheImpl.java,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -b -r1.85 -r1.86
--- CacheImpl.java 8 Jun 2007 16:26:41 -0000 1.85
+++ CacheImpl.java 11 Jun 2007 12:58:16 -0000 1.86
@@ -1196,11 +1196,8 @@
Set children = getChildrenNames(subtree);
if (children != null)
{
- Object[] kids = children.toArray();
-
- for (int i = 0; i < kids.length; i++)
+ for (Object s : children)
{
- Object s = kids[i];
Fqn tmp = new Fqn(subtree, s);
_remove(null, // no tx
tmp,
@@ -1217,28 +1214,25 @@
private void removeLocksForDeadMembers(NodeSPI<K, V> node, List deadMembers)
{
- Set<Object> deadOwners = new HashSet<Object>();
+ Set<GlobalTransaction> deadOwners = new HashSet<GlobalTransaction>();
NodeLock lock = node.getLock();
Object owner = lock.getWriterOwner();
if (isLockOwnerDead(owner, deadMembers))
{
- deadOwners.add(owner);
+ deadOwners.add((GlobalTransaction) owner);
}
- Iterator iter = lock.getReaderOwners().iterator();
- while (iter.hasNext())
+ for (Object readOwner : lock.getReaderOwners())
{
- owner = iter.next();
- if (isLockOwnerDead(owner, deadMembers))
+ if (isLockOwnerDead(readOwner, deadMembers))
{
- deadOwners.add(owner);
+ deadOwners.add((GlobalTransaction) readOwner);
}
}
- for (iter = deadOwners.iterator(); iter.hasNext();)
+ for (GlobalTransaction deadOwner : deadOwners)
{
- GlobalTransaction deadOwner = (GlobalTransaction) iter.next();
boolean localTx = deadOwner.getAddress().equals(getLocalAddress());
boolean broken = LockUtil.breakTransactionLock(lock, deadOwner, localTx, this);
@@ -2816,10 +2810,9 @@
/**
* Replicates a list of method calls.
*/
- public void _replicate(List method_calls) throws Throwable
+ public void _replicate(List<MethodCall> methodCalls) throws Throwable
{
- Iterator it = method_calls.iterator();
- while (it.hasNext()) _replicate((MethodCall) it.next());
+ for (MethodCall methodCall : methodCalls) _replicate(methodCall);
}
/**
More information about the jboss-cvs-commits
mailing list