db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1482984 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/store/access/conglomerate/ impl/store/ impl/store/access/ impl/store/access/sort/ impl/store/raw/ impl/store/raw/data/ impl/store/raw/log/ impl/store/raw/xact/ impl/store...
Date Wed, 15 May 2013 18:06:29 GMT
Author: rhillegas
Date: Wed May 15 18:06:28 2013
New Revision: 1482984

URL: http://svn.apache.org/r1482984
Log:
DERBY-6213: Generify impl/store packages.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMTransaction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeInserter.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/build.xml
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/MemByteHolder.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/ConcurrentTransactionMapFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionMapFactory.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/buffer/ReplicationLogBuffer.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageReceive.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/store/access/conglomerate/Sort.java Wed May 15 18:06:28 2013
@@ -28,6 +28,7 @@ import org.apache.derby.iapi.store.acces
 import org.apache.derby.iapi.store.access.ScanController;
 import org.apache.derby.iapi.store.access.SortController;
 import org.apache.derby.iapi.store.access.TransactionController;
+import org.apache.derby.iapi.store.access.conglomerate.ScanManager;
 
 /**
 
@@ -58,7 +59,7 @@ public interface Sort
     @exception StandardException Standard exception policy.
 	**/
 
-	ScanController openSortScan(
+	ScanManager openSortScan(
     TransactionManager  tran,
     boolean             hold)
 			throws StandardException;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java Wed May 15 18:06:28 2013
@@ -360,12 +360,14 @@ class PropertyConglomerate
 		}
 	}
 
+    @SuppressWarnings("unchecked")
 	void savePropertyDefault(TransactionController tc, String key, Serializable value)
 		 throws StandardException
 	{
 		if (saveServiceProperty(key,value)) return;
 
-		Dictionary defaults = (Dictionary)readProperty(tc,AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);
+		Dictionary<String,Object> defaults = (Dictionary<String,Object>)
+            readProperty(tc,AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);
 		if (defaults == null) defaults = new FormatableHashtable();
 		if (value==null)
 			defaults.remove(key);
@@ -655,7 +657,7 @@ class PropertyConglomerate
 		}
 	}
 									
-	private Dictionary copyValues(Dictionary to, Dictionary from, boolean stringsOnly)
+	private Dictionary<String,Object> copyValues(Dictionary<String,Object> to, Dictionary<String,Object> from, boolean stringsOnly)
 	{
 		if (from == null) return to; 
 		for (Enumeration keys = from.keys(); keys.hasMoreElements(); ) {
@@ -677,6 +679,7 @@ class PropertyConglomerate
 		return p;
 	}
 
+    @SuppressWarnings("unchecked")
 	public void getProperties(TransactionController tc,
 							   Dictionary d,
 							   boolean stringsOnly,
@@ -703,10 +706,10 @@ class PropertyConglomerate
 	void resetCache() {cachedSet = null;}
 
 	/** Read the database properties and add in the service set. */
-	private Dictionary readDbProperties(TransactionController tc)
+	private Dictionary<String,Object> readDbProperties(TransactionController tc)
 		 throws StandardException
 	{
-		Dictionary set = new Hashtable();
+		Dictionary<String,Object> set = new Hashtable<String,Object>();
 
         // scan the table for a row with no matching "key"
 		ScanController scan = openScan(tc, (String) null, 0);
@@ -722,7 +725,7 @@ class PropertyConglomerate
                     SanityManager.THROWASSERT(
                         "Key is not a string " + key.getClass().getName());
 			}
-			set.put(key, value);
+			set.put((String)key, value);
 		}
 		scan.close();
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java Wed May 15 18:06:28 2013
@@ -90,12 +90,12 @@ public abstract class RAMAccessManager
     /**
     Hash table on primary implementation type.
     **/
-    private Hashtable implhash;
+    private Hashtable<String,MethodFactory> implhash;
 
     /**
     Hash table on primary format.
     **/
-    private Hashtable formathash;
+    private Hashtable<UUID,MethodFactory> formathash;
 
 	/**
 	Service properties.  These are supplied from ModuleControl.boot(),
@@ -159,8 +159,8 @@ public abstract class RAMAccessManager
     {
         // Intialize the hash tables that hold the access methods that
         // this access manager knows about.
-        implhash   = new Hashtable();
-        formathash = new Hashtable();
+        implhash   = new Hashtable<String,MethodFactory>();
+        formathash = new Hashtable<UUID,MethodFactory>();
     }
 
     /**************************************************************************
@@ -585,16 +585,16 @@ public abstract class RAMAccessManager
         
         // See if there's an access method that supports the desired
         // format type as its primary format type.
-        factory = (MethodFactory) formathash.get(format);
+        factory = formathash.get(format);
         if (factory != null)
             return factory;
 
         // No primary format.  See if one of the access methods
         // supports it as a secondary format.
-        Enumeration e = formathash.elements();
+        Enumeration<MethodFactory> e = formathash.elements();
         while (e.hasMoreElements())
         {
-            factory = (MethodFactory) e.nextElement();
+            factory = e.nextElement();
             if (factory.supportsFormat(format))
                 return factory;
         }
@@ -612,16 +612,16 @@ public abstract class RAMAccessManager
     {
         // See if there's an access method that supports the desired
         // implementation type as its primary implementation type.
-        MethodFactory factory = (MethodFactory) implhash.get(impltype);
+        MethodFactory factory = implhash.get(impltype);
         if (factory != null)
 				return factory;
 
         // No primary implementation.  See if one of the access methods
         // supports the implementation type as a secondary.
-        Enumeration e = implhash.elements();
+        Enumeration<MethodFactory> e = implhash.elements();
         while (e.hasMoreElements())
         {
-            factory = (MethodFactory) e.nextElement();
+            factory = e.nextElement();
             if (factory.supportsImplementation(impltype))
                 return factory;
         }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMTransaction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMTransaction.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMTransaction.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/RAMTransaction.java Wed May 15 18:06:28 2013
@@ -111,20 +111,20 @@ public class RAMTransaction 
 
 	// XXX (nat) management of the controllers is still embryonic.
 	// XXX (nat) would be nice if sort controllers were like conglom controllers
-	private ArrayList scanControllers;
-	private ArrayList conglomerateControllers;
-	private ArrayList sorts;
-	private ArrayList sortControllers;
+	private ArrayList<ScanManager> scanControllers;
+	private ArrayList<ConglomerateController> conglomerateControllers;
+	private ArrayList<Sort> sorts;
+	private ArrayList<SortController> sortControllers;
 
     /** List of sort identifiers (represented as <code>Integer</code> objects)
      * which can be reused. Since sort identifiers are used as array indexes,
      * we need to reuse them to avoid leaking memory (DERBY-912). */
-    private ArrayList freeSortIds;
+    private ArrayList<Integer> freeSortIds;
 
 	/**
 	Where to look for temporary conglomerates.
 	**/
-	protected HashMap tempCongloms;
+	protected HashMap<Long,Conglomerate> tempCongloms;
 
 	/**
 	Next id to use for a temporary conglomerate.
@@ -160,8 +160,8 @@ public class RAMTransaction 
 		this.rawtran            = theRawTran;
         this.parent_tran        = parent_tran;
 		accessmanager           = myaccessmanager;
-		scanControllers         = new ArrayList();
-		conglomerateControllers = new ArrayList();
+		scanControllers         = new ArrayList<ScanManager>();
+		conglomerateControllers = new ArrayList<ConglomerateController>();
 
 		sorts                   = null; // allocated on demand.
 		freeSortIds             = null; // allocated on demand.
@@ -240,7 +240,7 @@ public class RAMTransaction 
             // loop from end to beginning, removing scans which are not held.
             for (int i = scanControllers.size() - 1; i >= 0; i--)
             {
-                ScanManager sc = (ScanManager) scanControllers.get(i);
+                ScanManager sc = scanControllers.get(i);
 
                 if (sc.closeForEndTransaction(closeHeldControllers))
                 {
@@ -266,9 +266,7 @@ public class RAMTransaction 
             // loop from end to beginning, removing scans which are not held.
             for (int i = conglomerateControllers.size() - 1; i >= 0; i--)
             {
-                ConglomerateController cc = 
-                    (ConglomerateController) 
-                        conglomerateControllers.get(i);
+                ConglomerateController cc = conglomerateControllers.get(i);
 
                 if (cc.closeForEndTransaction(closeHeldControllers))
                 {
@@ -297,7 +295,7 @@ public class RAMTransaction 
                 // element from the list.
                 for (int i = sortControllers.size() - 1; i >= 0; i--)
                 {
-                    SortController sc = (SortController) sortControllers.get(i);
+                    SortController sc = sortControllers.get(i);
                     sc.completedInserts();
                 }
                 sortControllers.clear();
@@ -312,7 +310,7 @@ public class RAMTransaction 
                 // element from the list.
                 for (int i = sorts.size() - 1; i >= 0; i--)
                 {
-                    Sort sort = (Sort) sorts.get(i);
+                    Sort sort = sorts.get(i);
                     if (sort != null)
                         sort.drop(this);
                 }
@@ -813,7 +811,7 @@ public class RAMTransaction 
 		{
 			conglomId = nextTempConglomId--;
 			if (tempCongloms == null)
-				tempCongloms = new HashMap();
+				tempCongloms = new HashMap<Long,Conglomerate>();
 			tempCongloms.put(new Long(conglomId), conglom);
 		}
 		else
@@ -925,25 +923,24 @@ public class RAMTransaction 
 
             str = "";
 
-            for (Iterator it = scanControllers.iterator(); it.hasNext(); )
+            for (Iterator<ScanManager> it = scanControllers.iterator(); it.hasNext(); )
             {
-                ScanController sc = (ScanController) it.next();
+                ScanController sc = it.next();
                 str += "open scan controller: " + sc + "\n";
             }
 
-            for (Iterator it = conglomerateControllers.iterator();
+            for (Iterator<ConglomerateController> it = conglomerateControllers.iterator();
                  it.hasNext(); )
             {
-                ConglomerateController cc = 
-                    (ConglomerateController) it.next();
+                ConglomerateController cc = (ConglomerateController) it.next();
                 str += "open conglomerate controller: " + cc + "\n";
             }
 
             if (sortControllers != null)
             {
-                for (Iterator it = sortControllers.iterator(); it.hasNext(); )
+                for (Iterator<SortController> it = sortControllers.iterator(); it.hasNext(); )
                 {
-                    SortController sc = (SortController) it.next();
+                    SortController sc = it.next();
                     str += "open sort controller: " + sc + "\n";
                 }
             }
@@ -952,7 +949,7 @@ public class RAMTransaction 
             {
                 for (int i = 0; i < sorts.size(); i++)
                 {
-                    Sort sort = (Sort) sorts.get(i);
+                    Sort sort = sorts.get(i);
 
                     if (sort != null)
                     {
@@ -965,11 +962,11 @@ public class RAMTransaction 
 
 			if (tempCongloms != null)
 			{
-                for (Iterator it = tempCongloms.keySet().iterator();
+                for (Iterator<Long> it = tempCongloms.keySet().iterator();
                      it.hasNext(); )
                 {
-					Long conglomId = (Long) it.next();
-					Conglomerate c = (Conglomerate) tempCongloms.get(conglomId);
+					Long conglomId = it.next();
+					Conglomerate c = tempCongloms.get(conglomId);
 					str += "temp conglomerate id = " + conglomId + ": " + c;
 				}
 			}
@@ -1694,8 +1691,8 @@ public class RAMTransaction 
 
 		// Add the sort to the sorts vector
 		if (sorts == null) {
-			sorts = new ArrayList();
-            freeSortIds = new ArrayList();
+			sorts = new ArrayList<Sort>();
+            freeSortIds = new ArrayList<Integer>();
         }
 
         int sortid;
@@ -1705,7 +1702,7 @@ public class RAMTransaction 
             sorts.add(sort);
         } else {
             // reuse a sort identifier
-            sortid = ((Integer) freeSortIds.remove(freeSortIds.size() - 1))
+            sortid = (freeSortIds.remove(freeSortIds.size() - 1))
                 .intValue();
             sorts.set(sortid, sort);
         }
@@ -1730,7 +1727,7 @@ public class RAMTransaction 
         throws StandardException
     {
         // should call close on the sort.
-        Sort sort = (Sort) sorts.get((int) sortid);
+        Sort sort = sorts.get((int) sortid);
 
         if (sort != null)
         {
@@ -1822,7 +1819,7 @@ public class RAMTransaction 
 		// Find the sort in the sorts list, throw an error
 		// if it doesn't exist.
 		if (sorts == null || id >= sorts.size()
-			|| (sort = ((Sort) sorts.get((int) id))) == null)
+			|| (sort = (sorts.get((int) id))) == null)
 		{
 			throw StandardException.newException(
                     SQLState.AM_NO_SUCH_SORT, new Long(id));
@@ -1833,7 +1830,7 @@ public class RAMTransaction 
 
 		// Keep track of it so we can release on close.
 		if (sortControllers == null)
-			sortControllers = new ArrayList();
+			sortControllers = new ArrayList<SortController>();
 		sortControllers.add(sc);
 
 		return sc;
@@ -1898,7 +1895,7 @@ public class RAMTransaction 
 		}
 
 		// Open a scan on it.
-		ScanController sc = sort.openSortScan(this, hold);
+		ScanManager sc = sort.openSortScan(this, hold);
 
 		// Keep track of it so we can release on close.
 		scanControllers.add(sc);
@@ -1918,7 +1915,7 @@ public class RAMTransaction 
 		// Find the sort in the sorts list, throw an error
 		// if it doesn't exist.
 		if (sorts == null || id >= sorts.size()
-			|| (sort = ((Sort) sorts.get((int) id))) == null)
+			|| (sort = (sorts.get((int) id))) == null)
 		{
 			throw StandardException.newException(
                     SQLState.AM_NO_SUCH_SORT, new Long(id));
@@ -1928,7 +1925,7 @@ public class RAMTransaction 
 		ScanControllerRowSource sc = sort.openSortRowSource(this);
 
 		// Keep track of it so we can release on close.
-		scanControllers.add(sc);
+		scanControllers.add( (ScanManager) sc );
 
 		return sc;
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeInserter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeInserter.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeInserter.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeInserter.java Wed May 15 18:06:28 2013
@@ -50,7 +50,7 @@ final class MergeInserter implements Sor
 	/**
 	A vector of the conglomerate ids of the merge runs.
 	**/
-	private Vector mergeRuns;
+	private Vector<Long> mergeRuns;
 
 	/**
 	An in-memory ordered set that is used to sort rows
@@ -73,7 +73,7 @@ final class MergeInserter implements Sor
     int     stat_numRowsInput;
     int     stat_numRowsOutput;
     int     stat_numMergeRuns;
-    Vector  stat_mergeRunsSize;
+    Vector<Integer>  stat_mergeRunsSize;
 
 
 	/*
@@ -177,7 +177,7 @@ final class MergeInserter implements Sor
             stat_sortType = "external";
 			long conglomid = sort.createMergeRun(tran, sortBuffer);
 			if (mergeRuns == null)
-				mergeRuns = new Vector();
+				mergeRuns = new Vector<Long>();
 			mergeRuns.addElement(new Long(conglomid));
 
             stat_numMergeRuns++;
@@ -275,7 +275,7 @@ final class MergeInserter implements Sor
         stat_numMergeRuns = 0;
         stat_numRowsInput = 0;
         stat_numRowsOutput = 0;
-        stat_mergeRunsSize = new Vector();
+        stat_mergeRunsSize = new Vector<Integer>();
         runSize = 0;
         totalRunSize = 0;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScan.java Wed May 15 18:06:28 2013
@@ -51,7 +51,7 @@ public class MergeScan extends SortScan
 	/**
 	The merge runs.
 	**/
-	protected Vector mergeRuns;
+	protected Vector<Long> mergeRuns;
 
 	/**
 	Array of scan controllers for the merge runs.
@@ -70,7 +70,7 @@ public class MergeScan extends SortScan
     MergeSort           sort, 
     TransactionManager  tran,
     SortBuffer          sortBuffer, 
-    Vector              mergeRuns,
+    Vector<Long>              mergeRuns,
 	SortObserver		sortObserver,
     boolean             hold)
 	{
@@ -182,11 +182,11 @@ public class MergeScan extends SortScan
 
 		// Open a scan on each merge run.
 		int scanindex = 0;
-		Enumeration e = mergeRuns.elements();
+		Enumeration<Long> e = mergeRuns.elements();
 		while (e.hasMoreElements())
 		{
 			// get the container id
-			long id = ((Long) e.nextElement()).longValue();
+			long id = (e.nextElement()).longValue();
 
 			Transaction rawTran = tran.getRawStoreXact();  // get raw transaction
 			int segmentId = StreamContainerHandle.TEMPORARY_SEGMENT;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeScanRowSource.java Wed May 15 18:06:28 2013
@@ -58,7 +58,7 @@ public class MergeScanRowSource extends 
     MergeSort           sort, 
     TransactionManager  tran,
     SortBuffer          sortBuffer, 
-    Vector              mergeRuns,
+    Vector<Long>              mergeRuns,
 	SortObserver		sortObserver,
     boolean             hold)
     {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/sort/MergeSort.java Wed May 15 18:06:28 2013
@@ -28,6 +28,7 @@ import org.apache.derby.iapi.services.io
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.store.access.conglomerate.ScanControllerRowSource;
+import org.apache.derby.iapi.store.access.conglomerate.ScanManager;
 import org.apache.derby.iapi.store.access.conglomerate.Sort;
 import org.apache.derby.iapi.store.access.conglomerate.TransactionManager;
 import org.apache.derby.iapi.store.access.ColumnOrdering;
@@ -153,7 +154,7 @@ class MergeSort implements Sort
 	Might be null if no merge runs were produced.
 	It is a vector of container ids.
 	**/
-	private Vector mergeRuns = null;
+	private Vector<Long> mergeRuns = null;
 
 	/**
 	An ordered set of the leftover rows that didn't go
@@ -223,7 +224,7 @@ class MergeSort implements Sort
 	@see Sort#openSortScan
 	**/
 
-	public ScanController openSortScan(
+	public ScanManager openSortScan(
     TransactionManager tran,
     boolean            hold)
 			throws StandardException
@@ -571,7 +572,7 @@ class MergeSort implements Sort
 	An inserter is closing.
 	**/
 	void doneInserting(MergeInserter inserter,
-		SortBuffer sortBuffer, Vector mergeRuns)
+		SortBuffer sortBuffer, Vector<Long> mergeRuns)
 	{
         if (SanityManager.DEBUG)
         {
@@ -603,7 +604,7 @@ class MergeSort implements Sort
 	}
 
 	void doneScanning(Scan scan, SortBuffer sortBuffer,
-		Vector mergeRuns)
+		Vector<Long> mergeRuns)
 	{
 		this.mergeRuns = mergeRuns;
 
@@ -620,7 +621,7 @@ class MergeSort implements Sort
 	{
 		if (mergeRuns != null)
 		{
-			Enumeration e = mergeRuns.elements();
+			Enumeration<Long> e = mergeRuns.elements();
 
 			try 
 			{
@@ -629,7 +630,7 @@ class MergeSort implements Sort
 
 				while (e.hasMoreElements())
 				{
-					long containerId = ((Long) e.nextElement()).longValue();
+					long containerId = (e.nextElement()).longValue();
 					rawTran.dropStreamContainer(segmentId, containerId);
 				}
 			}
@@ -667,26 +668,26 @@ class MergeSort implements Sort
 	private void multiStageMerge(TransactionManager tran)
 		throws StandardException
 	{
-		Enumeration e;
+		Enumeration<Long> e;
 		//int iterations = 0; // DEBUG (nat)
 		int maxMergeRuns = sortBuffer.capacity();
 
 		if (maxMergeRuns > ExternalSortFactory.DEFAULT_MAX_MERGE_RUN)
 			maxMergeRuns = ExternalSortFactory.DEFAULT_MAX_MERGE_RUN;
 
-		Vector subset;
-		Vector leftovers;
+		Vector<Long> subset;
+		Vector<Long> leftovers;
 
 		while (mergeRuns.size() > maxMergeRuns)
 		{
 			// Move maxMergeRuns elements from the merge runs
 			// vector into a subset, leaving the rest.
-			subset = new Vector(maxMergeRuns);
-			leftovers = new Vector(mergeRuns.size() - maxMergeRuns);
+			subset = new Vector<Long>(maxMergeRuns);
+			leftovers = new Vector<Long>(mergeRuns.size() - maxMergeRuns);
 			e = mergeRuns.elements();
 			while (e.hasMoreElements())
 			{
-				Long containerId = (Long) e.nextElement();
+				Long containerId = e.nextElement();
 				if (subset.size() < maxMergeRuns)
 					subset.addElement(containerId);
 				else

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/build.xml?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/build.xml Wed May 15 18:06:28 2013
@@ -52,7 +52,7 @@
         <pathelement path="${java16compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/store/**"/>
-      <!-- <compilerarg value="-Xlint:unchecked"/> -->
+      <compilerarg value="-Xlint:unchecked"/>
     </javac>
   </target>
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/RawStore.java Wed May 15 18:06:28 2013
@@ -98,7 +98,7 @@ import org.apache.derby.iapi.store.repli
 	and implements PrivilegedExceptionAction.
 */
 
-public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction
+public final class RawStore implements RawStoreFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction<Object>
 {
 	private static final String BACKUP_HISTORY = "BACKUP.HISTORY";
 	protected TransactionFactory	xactFactory;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java Wed May 15 18:06:28 2013
@@ -112,7 +112,7 @@ that file was made to inherit from this 
 **/
 
 public class BaseDataFileFactory
-    implements DataFactory, CacheableFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction
+    implements DataFactory, CacheableFactory, ModuleControl, ModuleSupportable, PrivilegedExceptionAction<Object>
 {
 
     StorageFactory storageFactory;
@@ -194,9 +194,9 @@ public class BaseDataFileFactory
 
 
 	//hash table to keep track of information about dropped containers stubs
-	private Hashtable droppedTableStubInfo;
+	private Hashtable<LogInstant,Object[]> droppedTableStubInfo;
 
-	private Hashtable postRecoveryRemovedFiles;
+	private Hashtable<String,StorageFile> postRecoveryRemovedFiles;
 
     // PrivilegedAction actions
     private int actionCode;
@@ -435,7 +435,7 @@ public class BaseDataFileFactory
                 (noLog != null && Boolean.valueOf(noLog).booleanValue());
 		}
 
-		droppedTableStubInfo = new Hashtable();
+		droppedTableStubInfo = new Hashtable<LogInstant,Object[]>();
 
         // If derby.system.durability=test then set flags to disable sync of
         // data pages at allocation when file is grown, disable sync of data
@@ -1642,15 +1642,15 @@ public class BaseDataFileFactory
 		{
 			synchronized(droppedTableStubInfo)
 			{
-				for (Enumeration e = droppedTableStubInfo.keys(); 
+				for (Enumeration<LogInstant> e = droppedTableStubInfo.keys(); 
                      e.hasMoreElements(); ) 
 				{
-					LogInstant logInstant  = (LogInstant) e.nextElement();
+					LogInstant logInstant  = e.nextElement();
 					if(logInstant.lessThan(redoLWM))
 					{
 						
 						Object[] removeInfo = 
-                            (Object[]) droppedTableStubInfo.get(logInstant);
+                            droppedTableStubInfo.get(logInstant);
 						Object identity = removeInfo[1];
 						//delete the entry in the container cache.
 						Cacheable ccentry =	containerCache.findCached(identity);
@@ -2131,9 +2131,9 @@ public class BaseDataFileFactory
      **/
     private static String jarClassPath(final Class cls)
     {
-        return (String)AccessController.doPrivileged( new PrivilegedAction()
+        return AccessController.doPrivileged( new PrivilegedAction<String>()
         {
-          public Object run()
+          public String run()
           {
               CodeSource cs = null;
               try {
@@ -2160,8 +2160,8 @@ public class BaseDataFileFactory
      * security exception.
      */
     private static String buildOSinfo () {
-    	return (String)AccessController.doPrivileged(new PrivilegedAction(){
-    		public Object run() {
+    	return AccessController.doPrivileged(new PrivilegedAction<String>(){
+    		public String run() {
     			String osInfo = "";
     			try {
     				String currentProp = PropertyUtil.getSystemProperty("os.name");
@@ -2187,9 +2187,9 @@ public class BaseDataFileFactory
      * security exception.
      */
     private static String buildJvmVersion () {
-        return (String)AccessController.doPrivileged( new PrivilegedAction()
+        return AccessController.doPrivileged( new PrivilegedAction<String>()
         {
-           public Object run()
+           public String run()
            {      
              String jvmversion = "";
              try {
@@ -2260,7 +2260,7 @@ public class BaseDataFileFactory
 	void fileToRemove( StorageFile file, boolean remove) 
     {
 		if (postRecoveryRemovedFiles == null)
-			postRecoveryRemovedFiles = new Hashtable();
+			postRecoveryRemovedFiles = new Hashtable<String,StorageFile>();
         String path = null;
         synchronized( this)
         {
@@ -2544,9 +2544,9 @@ public class BaseDataFileFactory
          * This will fail with a security exception unless the database engine 
          * and all its callers have permission to read the backup directory.
          */
-        String[] bfilelist = (String[])AccessController.doPrivileged(
-                                            new PrivilegedAction() {
-                                                public Object run() {
+        String[] bfilelist = AccessController.doPrivileged(
+                                            new PrivilegedAction<String[]>() {
+                                                public String[] run() {
                                                     return backupRoot.list();
                                                 }
                                             });
@@ -2560,19 +2560,19 @@ public class BaseDataFileFactory
                 {
                     // Segment directory in the backup
                     final File bsegdir = new File(backupRoot , bfilelist[i]);
-                    boolean bsegdirExists = ((Boolean)
+                    boolean bsegdirExists = (
                             AccessController.doPrivileged(
-                                new PrivilegedAction() {
-                                    public Object run() {
+                                new PrivilegedAction<Boolean>() {
+                                    public Boolean run() {
                                         return Boolean.valueOf(bsegdir.exists());
                                     }
                             })).booleanValue();
                     if (bsegdirExists) {
                         // Make sure the file object points at a directory.
-                        boolean isDirectory = ((Boolean)
+                        boolean isDirectory = (
                             AccessController.doPrivileged(
-                            new PrivilegedAction() {
-                                public Object run() {
+                            new PrivilegedAction<Boolean>() {
+                                public Boolean run() {
                                     return Boolean.valueOf(bsegdir.isDirectory());
                                 }
                             })).booleanValue();
@@ -2841,10 +2841,10 @@ public class BaseDataFileFactory
 
         case POST_RECOVERY_REMOVE_ACTION:
         {
-			for (Enumeration e = postRecoveryRemovedFiles.elements(); 
+			for (Enumeration<StorageFile> e = postRecoveryRemovedFiles.elements(); 
                     e.hasMoreElements(); )
             {
-				StorageFile f = (StorageFile) e.nextElement();
+				StorageFile f = e.nextElement();
 				if (f.exists())
                 {
 					boolean delete_status = f.delete();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/EncryptOrDecryptData.java Wed May 15 18:06:28 2013
@@ -59,7 +59,7 @@ import java.security.PrivilegedAction;
  *      after a successful checkpoint with a new key or on a rollback.
  */
 
-public class EncryptOrDecryptData implements PrivilegedAction {
+public class EncryptOrDecryptData implements PrivilegedAction<Boolean> {
 
     private BaseDataFileFactory dataFactory;
     private StorageFactory storageFactory;
@@ -368,9 +368,9 @@ public class EncryptOrDecryptData implem
     {
         actionCode = STORAGE_FILE_EXISTS_ACTION;
         actionStorageFile = file;
-        Object ret = AccessController.doPrivileged(this);
+        Boolean ret = AccessController.doPrivileged(this);
         actionStorageFile = null;
-        return ((Boolean) ret).booleanValue();
+        return ret.booleanValue();
 
     }
 
@@ -379,9 +379,9 @@ public class EncryptOrDecryptData implem
     {
         actionCode = STORAGE_FILE_DELETE_ACTION;
         actionStorageFile = file;
-        Object ret = AccessController.doPrivileged(this);
+        Boolean ret = AccessController.doPrivileged(this);
         actionStorageFile = null;
-        return ((Boolean) ret).booleanValue();
+        return ret.booleanValue();
 
     }
 
@@ -391,17 +391,17 @@ public class EncryptOrDecryptData implem
         actionCode = STORAGE_FILE_RENAME_ACTION;
         actionStorageFile = fromFile;
         actionDestStorageFile = destFile;
-        Object ret = AccessController.doPrivileged(this);
+        Boolean ret = AccessController.doPrivileged(this);
         actionStorageFile = null;
         actionDestStorageFile = null;
-        return ((Boolean) ret).booleanValue();
+        return ret.booleanValue();
 
     }
 
 
 
     // PrivilegedAction method
-    public Object run()
+    public Boolean run()
     {
         switch(actionCode)
         {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/MemByteHolder.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/MemByteHolder.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/MemByteHolder.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/MemByteHolder.java Wed May 15 18:06:28 2013
@@ -38,7 +38,7 @@ implements ByteHolder
 
 	boolean writing = true;
 	
-	Vector bufV;
+	Vector<byte[]> bufV;
 	int curBufVEleAt;
 
 	byte[] curBuf;
@@ -69,7 +69,7 @@ implements ByteHolder
 		this.curBuf = new byte[bufSize];
 		this.curBufPos = 0;
 
-		this.bufV = new Vector(128);
+		this.bufV = new Vector<byte[]>(128);
 		bufV.addElement(curBuf);
 		this.curBufVEleAt = 0;
 	}
@@ -170,7 +170,7 @@ implements ByteHolder
 	{
 		writing = true;
 		
-		curBuf = (byte[])bufV.elementAt(0);
+		curBuf = bufV.elementAt(0);
 		this.curBufVEleAt = 0;
 		this.curBufPos = 0;
 		
@@ -194,7 +194,7 @@ implements ByteHolder
 		//
 		//Reposition so reads start from the first
 		//byte.
-		curBuf = (byte[])bufV.elementAt(0);
+		curBuf = bufV.elementAt(0);
 		this.curBufVEleAt = 0;
 		this.curBufPos = 0;
 		if (curBufVEleAt == lastBufVEleAt)
@@ -444,7 +444,7 @@ implements ByteHolder
 		}
 		else
 		{
-			curBuf = (byte[])bufV.elementAt(curBufVEleAt);
+			curBuf = bufV.elementAt(curBufVEleAt);
 		}
 		
 		initBuffer_w();
@@ -489,7 +489,7 @@ implements ByteHolder
 			SanityManager.ASSERT(writing == false,
 								 "Reading should be true 5");
 		if (curBufVEleAt >= lastBufVEleAt) return true;
-		curBuf = (byte[])bufV.elementAt(++curBufVEleAt);
+		curBuf = bufV.elementAt(++curBufVEleAt);
 		curBufPos = 0;
 		if (curBufVEleAt == lastBufVEleAt)
 			curBufDataBytes = lastBufDataBytes;
@@ -506,7 +506,7 @@ implements ByteHolder
 	{
 		StringBuffer sb = new StringBuffer(100);
 
-		byte[] buf = (byte[])bufV.elementAt(bufVEleAt);
+		byte[] buf = bufV.elementAt(bufVEleAt);
 		sb.append("(");
 		for (int ix = 0;ix<buf.length;ix++)
 			sb.append(buf[ix]+".");

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java Wed May 15 18:06:28 2013
@@ -54,7 +54,7 @@ import java.security.PrivilegedActionExc
 	for FileContainers which are implemented on java.io.RandomAccessFile.
 */
 
-class RAFContainer extends FileContainer implements PrivilegedExceptionAction
+class RAFContainer extends FileContainer implements PrivilegedExceptionAction<Object>
 {
 
 	/*
@@ -823,9 +823,9 @@ class RAFContainer extends FileContainer
      */
     private void copyFile(final StorageFile from, final File to)
             throws StandardException {
-        Boolean success = (Boolean) AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public Object run() {
+        Boolean success = AccessController.doPrivileged(
+                new PrivilegedAction<Boolean>() {
+                    public Boolean run() {
                         return ReuseFactory.getBoolean(FileUtil.copyFile(
                                 dataFactory.getStorageFactory(), from, to));
                     }
@@ -844,9 +844,9 @@ class RAFContainer extends FileContainer
      * @throws StandardException if the file could not be removed
      */
     private void removeFile(final File file) throws StandardException {
-        Boolean success = (Boolean) AccessController.doPrivileged(
-            new PrivilegedAction() {
-                public Object run() {
+        Boolean success = AccessController.doPrivileged(
+            new PrivilegedAction<Boolean>() {
+                public Boolean run() {
                     return ReuseFactory.getBoolean(
                             !file.exists() || file.delete());
                 }
@@ -1315,9 +1315,9 @@ class RAFContainer extends FileContainer
     private RandomAccessFile getRandomAccessFile(final File file)
             throws FileNotFoundException {
         try {
-            return (RandomAccessFile) AccessController.doPrivileged(
-                new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
+            return AccessController.doPrivileged(
+                new PrivilegedExceptionAction<RandomAccessFile>() {
+                    public RandomAccessFile run() throws FileNotFoundException {
                         boolean preExisting = file.exists();
                         RandomAccessFile raf = new RandomAccessFile(file, "rw");
                         if (!preExisting) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/RFResource.java Wed May 15 18:06:28 2013
@@ -246,7 +246,7 @@ class RFResource implements FileResource
 } // end of class RFResource
 
 
-final class RemoveFile implements Serviceable, PrivilegedExceptionAction
+final class RemoveFile implements Serviceable, PrivilegedExceptionAction<Object>
 {
 	private final StorageFile fileToGo;
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/StreamFileContainer.java Wed May 15 18:06:28 2013
@@ -90,7 +90,7 @@ import java.io.FileNotFoundException;
 **/
 
 
-public class StreamFileContainer implements TypedFormat, PrivilegedExceptionAction
+public class StreamFileContainer implements TypedFormat, PrivilegedExceptionAction<Object>
 {
 
     /**************************************************************************

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogAccessFile.java Wed May 15 18:06:28 2013
@@ -94,8 +94,8 @@ public class LogAccessFile 
     private static final int            LOG_NUMBER_LOG_BUFFERS = 3;
 
 
-	private LinkedList    freeBuffers;  //list of free buffers
-	private LinkedList    dirtyBuffers; //list of dirty buffers to flush
+	private LinkedList<LogAccessFileBuffer>    freeBuffers;  //list of free buffers
+	private LinkedList<LogAccessFileBuffer>    dirtyBuffers; //list of dirty buffers to flush
 	private  LogAccessFileBuffer currentBuffer; //current active buffer
 	private boolean flushInProgress = false;
 	
@@ -147,8 +147,8 @@ public class LogAccessFile 
             SanityManager.ASSERT(LOG_NUMBER_LOG_BUFFERS >= 1);
 				
 		//initialize buffers lists
-		freeBuffers = new LinkedList();
-		dirtyBuffers = new LinkedList();
+		freeBuffers = new LinkedList<LogAccessFileBuffer>();
+		dirtyBuffers = new LinkedList<LogAccessFileBuffer>();
 
 
 		//add all buffers to free list
@@ -519,7 +519,7 @@ public class LogAccessFile 
 		
 				noOfBuffers = dirtyBuffers.size();
 				if(noOfBuffers > 0)
-					buf = (LogAccessFileBuffer) dirtyBuffers.removeFirst();
+					buf = dirtyBuffers.removeFirst();
 				
 				flushInProgress = true;
 			}
@@ -536,7 +536,7 @@ public class LogAccessFile 
 					//add the buffer that was written previosly to the free list
 					freeBuffers.addLast(buf);
 					if(nFlushed < noOfBuffers)
-						buf = (LogAccessFileBuffer) dirtyBuffers.removeFirst();
+						buf = dirtyBuffers.removeFirst();
 					else
 					{
 						//see if we can flush more, that came when we are at it.
@@ -546,7 +546,7 @@ public class LogAccessFile 
 						if(size > 0 && nFlushed <= LOG_NUMBER_LOG_BUFFERS)
 						{
 							noOfBuffers += size;
-							buf = (LogAccessFileBuffer) dirtyBuffers.removeFirst();
+							buf = dirtyBuffers.removeFirst();
 						}
 					}
 				}
@@ -616,7 +616,7 @@ public class LogAccessFile 
 				SanityManager.ASSERT(freeBuffers.size() > 0);
 
 			//switch over to the next log buffer, let someone else write it.
-			currentBuffer = (LogAccessFileBuffer) freeBuffers.removeFirst();
+			currentBuffer = freeBuffers.removeFirst();
 			currentBuffer.init(checksumLogRecordSize);
 
 			if (SanityManager.DEBUG)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/log/LogToFile.java Wed May 15 18:06:28 2013
@@ -223,7 +223,7 @@ import java.util.zip.CRC32;
 	*/
 
 public final class LogToFile implements LogFactory, ModuleControl, ModuleSupportable,
-								  Serviceable, java.security.PrivilegedExceptionAction
+								  Serviceable, java.security.PrivilegedExceptionAction<Object>
 {
 
 	private static final    long INT_LENGTH = 4L;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/ConcurrentTransactionMapFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/ConcurrentTransactionMapFactory.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/ConcurrentTransactionMapFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/ConcurrentTransactionMapFactory.java Wed May 15 18:06:28 2013
@@ -34,16 +34,10 @@ import org.apache.derby.iapi.store.raw.x
  */
 class ConcurrentTransactionMapFactory extends TransactionMapFactory {
     @Override
-    Map newMap() {
+    Map<TransactionId,TransactionTableEntry> newMap() {
         Map<TransactionId, TransactionTableEntry> map =
                 new ConcurrentHashMap<TransactionId, TransactionTableEntry>();
 
-        if (SanityManager.DEBUG) {
-            // Add some extra type checks to detect bugs earlier
-            map = Collections.checkedMap(
-                    map, TransactionId.class, TransactionTableEntry.class);
-        }
-
         return map;
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionMapFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionMapFactory.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionMapFactory.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionMapFactory.java Wed May 15 18:06:28 2013
@@ -25,6 +25,8 @@ import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.Map;
 
+import org.apache.derby.iapi.store.raw.xact.TransactionId;
+
 /**
  * Helper class for {@code TransactionTable} which allows it to plug in a
  * different {@code java.util.Map} implementation for the map that contains
@@ -53,8 +55,8 @@ class TransactionMapFactory {
      *
      * @return a thread-safe map instance
      */
-    Map newMap() {
-        return new Hashtable();
+    Map<TransactionId,TransactionTableEntry> newMap() {
+        return new Hashtable<TransactionId,TransactionTableEntry>();
     }
 
     /**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/TransactionTable.java Wed May 15 18:06:28 2013
@@ -35,6 +35,7 @@ import org.apache.derby.iapi.store.raw.l
 
 import org.apache.derby.iapi.store.raw.xact.RawTransaction;
 import org.apache.derby.iapi.store.raw.xact.TransactionId;
+import org.apache.derby.impl.store.raw.xact.TransactionTableEntry;
 
 import org.apache.derby.iapi.services.io.CompressedNumber;
 
@@ -98,7 +99,7 @@ public class TransactionTable implements
 	 */
 
     private final TransactionMapFactory mapFactory;
-	private final Map trans;
+	private final Map<TransactionId,TransactionTableEntry> trans;
 
 	private TransactionId largestUpdateXactId;
 
@@ -123,7 +124,7 @@ public class TransactionTable implements
                 id != null, "findTransacionEntry with null id");
 
 		// Hashtable is synchronized
-		return (TransactionTableEntry)trans.get(id);
+		return trans.get(id);
 	}
 
     /**
@@ -239,7 +240,7 @@ public class TransactionTable implements
         }
 
 		// Hashtable is synchronized
-		 TransactionTableEntry ent = (TransactionTableEntry)trans.remove(id);
+		 TransactionTableEntry ent = trans.remove(id);
 		 return (ent == null || ent.needExclusion());
 	}
 
@@ -596,9 +597,9 @@ public class TransactionTable implements
 	*/
 	public boolean hasRollbackFirstTransaction()
 	{
-		for (Iterator it = trans.values().iterator(); it.hasNext(); )
+		for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext(); )
 		{
-			TransactionTableEntry ent = (TransactionTableEntry) it.next();
+			TransactionTableEntry ent = it.next();
 
 			if (ent != null && ent.isRecovery() && 
 				(ent.getTransactionStatus() & 
@@ -648,9 +649,9 @@ public class TransactionTable implements
 
     private boolean hasPreparedXact(boolean recovered)
     {
-        for (Iterator it = trans.values().iterator(); it.hasNext(); )
+        for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext(); )
         {
-            TransactionTableEntry ent = (TransactionTableEntry) it.next();
+            TransactionTableEntry ent = it.next();
 
             if (ent != null && 
                 (ent.getTransactionStatus() & Xact.END_PREPARED) != 0)
@@ -690,9 +691,9 @@ public class TransactionTable implements
 		}
 
 		TransactionId id = null;
-		for (Iterator it = trans.values().iterator(); it.hasNext(); )
+		for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext(); )
 		{
-			TransactionTableEntry ent = (TransactionTableEntry) it.next();
+			TransactionTableEntry ent = it.next();
 
 			if (ent != null && ent.isUpdate() && ent.isRecovery() &&
 				(ent.getTransactionStatus() & Xact.RECOVERY_ROLLBACK_FIRST) != 0)
@@ -744,9 +745,9 @@ public class TransactionTable implements
 
         if (!trans.isEmpty())
 		{
-			for (Iterator it = trans.values().iterator(); it.hasNext() ; )
+			for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext() ; )
 			{
-				TransactionTableEntry ent = (TransactionTableEntry) it.next();
+				TransactionTableEntry ent = it.next();
 
 				if (ent != null         && 
                     ent.isUpdate()      && 
@@ -783,10 +784,10 @@ public class TransactionTable implements
                 else
                 {
                     // all transactions in the table must be prepared.
-                    for (Iterator it = trans.values().iterator(); it.hasNext();)
+                    for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext();)
                     {
                         TransactionTableEntry ent =
-                            (TransactionTableEntry) it.next();
+                            it.next();
                         SanityManager.ASSERT(ent.isPrepared());
                     }
                 }
@@ -841,9 +842,9 @@ public class TransactionTable implements
             GlobalTransactionId     gid         = null;
             TransactionTableEntry   ent;
 
-			for (Iterator it = trans.values().iterator(); it.hasNext(); )
+			for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext(); )
 			{
-				ent = (TransactionTableEntry) it.next();
+				ent = it.next();
 
 				if (ent != null         && 
                     ent.isRecovery()    && 
@@ -866,9 +867,9 @@ public class TransactionTable implements
                     // if no entry's were found then the transaction table
                     // should have the passed in idle tran, and the rest should
                     // be non-recover, prepared global transactions.
-                    for (Iterator it = trans.values().iterator(); it.hasNext();)
+                    for (Iterator<TransactionTableEntry> it = trans.values().iterator(); it.hasNext();)
                     {
-                        ent = (TransactionTableEntry) it.next();
+                        ent = it.next();
 
                         if (XactId.compare(ent.getXid(), tran.getId()) != 0)
                         {
@@ -891,7 +892,7 @@ public class TransactionTable implements
                 //             - the entry of the transaction that we are going
                 //               to take over.
                 TransactionTableEntry new_ent =
-                    (TransactionTableEntry) trans.remove(tran.getId());
+                    trans.remove(tran.getId());
 
                 // At this point only the found_ent should be in the table.
                 if (SanityManager.DEBUG)
@@ -998,12 +999,12 @@ public class TransactionTable implements
             SanityManager.DEBUG("TranTrace", toString());
         }
 
-        final ArrayList tinfo = new ArrayList();
+        final ArrayList<TransactionTableEntry> tinfo = new ArrayList<TransactionTableEntry>();
 
         // Get clones of all the entries in the transaction table.
         visitEntries(new EntryVisitor() {
             public boolean visit(TransactionTableEntry entry) {
-                tinfo.add(entry.clone());
+                tinfo.add( (TransactionTableEntry) entry.clone());
                 return true; // scan entire transaction table
             }
         });

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/Xact.java Wed May 15 18:06:28 2013
@@ -216,10 +216,10 @@ public class Xact extends RawTransaction
 	private LogInstant		logLast;  // the last log record written by this
 									  // transaction 
 
-	private Stack			savePoints;	// stack of SavePoint objects.
+	private Stack<SavePoint>			savePoints;	// stack of SavePoint objects.
 
-	protected List   		postCommitWorks; // a list of post commit work
-	protected List		    postTerminationWorks; // work to be done after
+	protected List<Serviceable>   		postCommitWorks; // a list of post commit work
+	protected List<Serviceable>		    postTerminationWorks; // work to be done after
 												  // transaction terminates,
 												  // commit or abort
 	private boolean			recoveryTransaction;  // this transaction is being
@@ -1246,7 +1246,7 @@ public class Xact extends RawTransaction
 					    // set the top savepoint to rollback to this record if
                         // it doesn't yet have a point saved
 
-						SavePoint sp = (SavePoint) savePoints.elementAt(i);
+						SavePoint sp = savePoints.elementAt(i);
 						if (sp.getSavePoint() == null) {
 							sp.setSavePoint(instant);
 						} else
@@ -1270,7 +1270,7 @@ public class Xact extends RawTransaction
 			return;
 
 		if (postCommitWorks == null)
-			postCommitWorks = new ArrayList(1);
+			postCommitWorks = new ArrayList<Serviceable>(1);
 		postCommitWorks.add(work);
 	}
 
@@ -1280,7 +1280,7 @@ public class Xact extends RawTransaction
 			return;
 
 		if (postTerminationWorks == null)
-			postTerminationWorks = new ArrayList(2);
+			postTerminationWorks = new ArrayList<Serviceable>(2);
 		postTerminationWorks.add(work);
 	}
 
@@ -1476,7 +1476,7 @@ public class Xact extends RawTransaction
         }
 
 		if (savePoints == null)
-			savePoints = new Stack();
+			savePoints = new Stack<SavePoint>();
 
 		savePoints.push(new SavePoint(name, kindOfSavepoint));
 
@@ -1507,7 +1507,7 @@ public class Xact extends RawTransaction
 
 		if ((savePoints != null) && !savePoints.empty()) {
 			for (int i = savePoints.size() - 1; i >= 0; i--) {
-				SavePoint sp = (SavePoint) savePoints.elementAt(i);
+				SavePoint sp = savePoints.elementAt(i);
 				if (sp.isThisUserDefinedsavepoint()) 
 				{
                     //found a user defined savepoint
@@ -2048,7 +2048,7 @@ public class Xact extends RawTransaction
 			0 : postTerminationWorks.size(); 
 
 		for (int i = 0; i < count; i++)
-			addPostCommitWork((Serviceable)postTerminationWorks.get(i));
+			addPostCommitWork(postTerminationWorks.get(i));
 
 		if (count > 0)
 			postTerminationWorks.clear();
@@ -2173,7 +2173,7 @@ public class Xact extends RawTransaction
 
         for (int i = savePoints.size() - 1; i >= 0; i--)
         {
-            SavePoint savepoint = (SavePoint)savePoints.elementAt(i);
+            SavePoint savepoint = savePoints.elementAt(i);
 
             if (savepoint.getName().equals(name))
             {
@@ -2214,7 +2214,7 @@ public class Xact extends RawTransaction
 
 		int size = savePoints.size();
 		for (int i = position; i < size; i++) {
-			SavePoint rollbackSavePoint = (SavePoint) savePoints.elementAt(i);
+			SavePoint rollbackSavePoint = savePoints.elementAt(i);
 
 			LogInstant li = rollbackSavePoint.getSavePoint();
 			if (li != null) {
@@ -2437,7 +2437,7 @@ public class Xact extends RawTransaction
 		throws StandardException {
 
 		// Count row locks by table
-		Dictionary containers = new java.util.Hashtable();
+		Dictionary<ContainerKey,LockCount> containers = new java.util.Hashtable<ContainerKey,LockCount>();
 
 		for (; lockList.hasMoreElements(); ) {
 
@@ -2467,10 +2467,10 @@ public class Xact extends RawTransaction
 		// this threshold
 
 		boolean didEscalate = false;
-		for (Enumeration e = containers.keys(); e.hasMoreElements(); ) {
-			ContainerKey ckey = (ContainerKey) e.nextElement();
+		for (Enumeration<ContainerKey> e = containers.keys(); e.hasMoreElements(); ) {
+			ContainerKey ckey = e.nextElement();
 
-			LockCount lc = (LockCount) containers.get(ckey);
+			LockCount lc = containers.get(ckey);
 
 			if (lc.count < threshold) {
 				continue;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/xact/XactXAResourceManager.java Wed May 15 18:06:28 2013
@@ -242,7 +242,7 @@ public class XactXAResourceManager imple
 
         if ((flags & XAResource.TMSTARTRSCAN) != 0)
         {
-            final ArrayList xid_list = new ArrayList();
+            final ArrayList<XAXactId> xid_list = new ArrayList<XAXactId>();
 
             // Create a visitor that adds each of the prepared transactions
             // to xid_list.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/buffer/ReplicationLogBuffer.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/buffer/ReplicationLogBuffer.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/buffer/ReplicationLogBuffer.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/buffer/ReplicationLogBuffer.java Wed May 15 18:06:28 2013
@@ -64,8 +64,8 @@ public class ReplicationLogBuffer {
 
     public static final int DEFAULT_NUMBER_LOG_BUFFERS = 10;
 
-    private final LinkedList dirtyBuffers;// LogBufferElements with unsent log
-    private final LinkedList freeBuffers; // currently unused LogBufferElements
+    private final LinkedList<LogBufferElement> dirtyBuffers;// LogBufferElements with unsent log
+    private final LinkedList<LogBufferElement> freeBuffers; // currently unused LogBufferElements
 
     // the buffer we currently APPEND chunks of log records to
     private LogBufferElement currentDirtyBuffer;
@@ -113,14 +113,14 @@ public class ReplicationLogBuffer {
         outBufferLastInstant = 0;
         validOutBuffer = false; // no valid data in outBuffer yet
 
-        dirtyBuffers = new LinkedList();
-        freeBuffers = new LinkedList();
+        dirtyBuffers = new LinkedList<LogBufferElement>();
+        freeBuffers = new LinkedList<LogBufferElement>();
 
         for (int i = 0; i < DEFAULT_NUMBER_LOG_BUFFERS; i++){
             LogBufferElement b = new LogBufferElement(bufferSize);
             freeBuffers.addLast(b);
         }
-        currentDirtyBuffer = (LogBufferElement)freeBuffers.removeFirst();
+        currentDirtyBuffer = freeBuffers.removeFirst();
     }
 
     /**
@@ -219,7 +219,7 @@ public class ReplicationLogBuffer {
             synchronized (outputLatch) {
                 if (dirtyBuffers.size() > 0 ) {
                     LogBufferElement current =
-                        (LogBufferElement)dirtyBuffers.removeFirst();
+                        dirtyBuffers.removeFirst();
 
                     // The outBufferData byte[] should have the
                     // default size or the size of the current
@@ -351,7 +351,7 @@ public class ReplicationLogBuffer {
         if (currentDirtyBuffer == null) {
             try {
                 currentDirtyBuffer =
-                    (LogBufferElement)freeBuffers.removeFirst();
+                    freeBuffers.removeFirst();
                 currentDirtyBuffer.init();
             } catch (NoSuchElementException nsee) {
                 throw new LogBufferFullException();

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageReceive.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageReceive.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageReceive.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageReceive.java Wed May 15 18:06:28 2013
@@ -158,9 +158,8 @@ public class ReplicationMessageReceive {
         try {
             //Start listening on the socket and accepting the connection
             client =
-                (Socket)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws IOException {
+                AccessController.doPrivileged(new PrivilegedExceptionAction<Socket>() {
+                    public Socket run() throws IOException {
                         return serverSocket.accept();
                     }
                 });
@@ -198,9 +197,9 @@ public class ReplicationMessageReceive {
         //port number.
         ServerSocket ss = null;
         try { 
-            ss =   (ServerSocket) AccessController.doPrivileged
-            (new PrivilegedExceptionAction() {
-                public Object run() throws IOException  {
+            ss = AccessController.doPrivileged
+            (new PrivilegedExceptionAction<ServerSocket>() {
+                public ServerSocket run() throws IOException  {
                     ServerSocketFactory sf = ServerSocketFactory.getDefault();
                     return sf.createServerSocket(slaveAddress.getPortNumber(),
                             0, slaveAddress.getHostAddress());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java?rev=1482984&r1=1482983&r2=1482984&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/replication/net/ReplicationMessageTransmit.java Wed May 15 18:06:28 2013
@@ -120,9 +120,8 @@ public class ReplicationMessageTransmit 
         final int timeout_ = timeout;
         try {
             //create a connection to the slave.
-            s = (Socket)
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws IOException {
+            s = AccessController.doPrivileged(new PrivilegedExceptionAction<Socket>() {
+                public Socket run() throws IOException {
                     SocketFactory sf = SocketFactory.getDefault();
                     InetSocketAddress sockAddr = new InetSocketAddress(
                             slaveAddress.getHostAddress(), 



Mime
View raw message