db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1361925 - in /db/derby/code/trunk/java: build/org/apache/derbyBuild/ drda/org/apache/derby/drda/ drda/org/apache/derby/impl/drda/
Date Mon, 16 Jul 2012 07:22:46 GMT
Author: kahatlen
Date: Mon Jul 16 07:22:45 2012
New Revision: 1361925

URL: http://svn.apache.org/viewvc?rev=1361925&view=rev
Log:
DERBY-5840: Compile network server code with source and target level 1.5

Modified:
    db/derby/code/trunk/java/build/org/apache/derbyBuild/classlister.java
    db/derby/code/trunk/java/drda/org/apache/derby/drda/NetworkServerControl.java
    db/derby/code/trunk/java/drda/org/apache/derby/drda/build.xml
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CharacterEncodings.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/ClientThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DssTrace.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/build.xml

Modified: db/derby/code/trunk/java/build/org/apache/derbyBuild/classlister.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/build/org/apache/derbyBuild/classlister.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/build/org/apache/derbyBuild/classlister.java (original)
+++ db/derby/code/trunk/java/build/org/apache/derbyBuild/classlister.java Mon Jul 16 07:22:45
2012
@@ -491,7 +491,7 @@ public class classlister {
 		}
 
 		// drda explicitly brings in some database engine classes.
-		// they must be picke dup from cs.jar and not put in
+		// they must be picked up from derby.jar and not put in
 		// the network server jar.
 		if (db2jdrda) {
 
@@ -501,6 +501,8 @@ public class classlister {
 				|| className.startsWith("org.apache.derby.impl.services")
 				|| className.startsWith("org.apache.derby.iapi.")
 				|| className.startsWith("org.apache.derby.security.")
+                || (className.startsWith("org.apache.derby.mbeans.") &&
+                    !className.startsWith("org.apache.derby.mbeans.drda."))
 				)
 			{
 				return;

Modified: db/derby/code/trunk/java/drda/org/apache/derby/drda/NetworkServerControl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/drda/NetworkServerControl.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/drda/NetworkServerControl.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/drda/NetworkServerControl.java Mon Jul
16 07:22:45 2012
@@ -320,8 +320,9 @@ public class NetworkServerControl{
             if (command == NetworkServerControlImpl.COMMAND_START &&
                     JVMInfo.JDK_ID >= JVMInfo.J2SE_17) {
                 try {
-                    AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                            public Object run() throws Exception {
+                    AccessController.doPrivileged(
+                        new PrivilegedExceptionAction<Void>() {
+                            public Void run() throws Exception {
                                 System.setProperty(
                                     Property.SERVER_STARTED_FROM_CMD_LINE,
                                     "true");

Modified: db/derby/code/trunk/java/drda/org/apache/derby/drda/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/drda/build.xml?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/drda/build.xml (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/drda/build.xml Mon Jul 16 07:22:45 2012
@@ -44,8 +44,8 @@
 
   <target name="compile">
     <javac
-      source="1.4"
-      target="1.4"
+      source="1.5"
+      target="1.5"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CharacterEncodings.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CharacterEncodings.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CharacterEncodings.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CharacterEncodings.java Mon Jul
16 07:22:45 2012
@@ -21,6 +21,8 @@
 
 package org.apache.derby.impl.drda;
 
+import java.util.HashMap;
+
 final class CharacterEncodings
 {
 
@@ -28,7 +30,8 @@ final class CharacterEncodings
   private CharacterEncodings () {}
 
   //private static java.util.Hashtable javaEncodingToCCSIDTable__ = new java.util.Hashtable();
-  private static java.util.Hashtable ccsidToJavaEncodingTable__ = new java.util.Hashtable();
+  private static final HashMap<Integer, String> ccsidToJavaEncodingTable__ =
+          new HashMap<Integer, String>();
 
   static {
     populate_ccsidToJavaEncodingTable();
@@ -377,7 +380,7 @@ final class CharacterEncodings
 
   public static String getJavaEncoding (int ccsid) throws java.io.UnsupportedEncodingException
   {
-    String javaEncoding = (String) ccsidToJavaEncodingTable__.get (new Integer (ccsid));
+    String javaEncoding = ccsidToJavaEncodingTable__.get(ccsid);
     if (javaEncoding == null)
       throw new java.io.UnsupportedEncodingException ("unsupported ccsid");
     else

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/ClientThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/ClientThread.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/ClientThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/ClientThread.java Mon Jul 16
07:22:45 2012
@@ -149,9 +149,9 @@ final class ClientThread extends Thread 
      * 
      */
     private Socket acceptClientWithRetry() {
-        return (Socket) AccessController.doPrivileged(
-                new PrivilegedAction() {
-                    public Object run() {
+        return AccessController.doPrivileged(
+                new PrivilegedAction<Socket>() {
+                    public Socket run() {
                         for (int trycount = 1; trycount <= 3; trycount++) {
                             try {
                                 // DERBY-5347 Need to exit if

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/CodePointNameTable.java Mon Jul
16 07:22:45 2012
@@ -26,7 +26,7 @@ package org.apache.derby.impl.drda;
   It is arranged in alphabetical order.
 */
 
-class CodePointNameTable extends java.util.Hashtable
+class CodePointNameTable extends java.util.Hashtable<Integer, String>
 {
   CodePointNameTable ()
   {
@@ -165,7 +165,7 @@ class CodePointNameTable extends java.ut
 
   String lookup (int codePoint)
   {
-    return (String) get (new Integer (codePoint));
+    return get(codePoint);
   }
 
 }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Mon Jul 16
07:22:45 2012
@@ -141,8 +141,8 @@ class DRDAConnThread extends Thread {
 	private byte diagnosticLevel = (byte)0xF0; 
 
 	// manager processing
-    private List unknownManagers;
-    private List knownManagers;
+    private List<Integer> unknownManagers;
+    private List<Integer> knownManagers;
 
 	// database accessed failed
 	private SQLException databaseAccessException;
@@ -1689,10 +1689,10 @@ class DRDAConnThread extends Thread {
 		int manager, managerLevel;
 		int currentLevel;
 		// set up vectors to keep track of manager information
-		unknownManagers = new ArrayList();
-		knownManagers = new ArrayList();
-		ArrayList errorManagers = new ArrayList();
-		ArrayList errorManagersLevel = new ArrayList();
+		unknownManagers = new ArrayList<Integer>();
+		knownManagers = new ArrayList<Integer>();
+		ArrayList<Integer> errorManagers = new ArrayList<Integer>();
+		ArrayList<Integer> errorManagersLevel = new ArrayList<Integer>();
 		if (SanityManager.DEBUG)
 			trace("Manager Levels");
 
@@ -8733,7 +8733,7 @@ class DRDAConnThread extends Thread {
 
   void writeEXTDTA (DRDAStatement stmt) throws SQLException, DRDAProtocolException
   {
-	  ArrayList extdtaValues = stmt.getExtDtaObjects();
+	  ArrayList<Object> extdtaValues = stmt.getExtDtaObjects();
     // build the EXTDTA data, if necessary
     if (extdtaValues == null) 
 		return;

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAProtocolException.java Mon
Jul 16 07:22:45 2012
@@ -82,7 +82,7 @@ class DRDAProtocolException extends Exce
 	// when getMessage() is called on this Exception object
 	private String msg;
     
-	private static Hashtable errorInfoTable;
+	private static Hashtable<String, DRDAProtocolExceptionInfo> errorInfoTable;
 	
 	protected static String DRDA_Proto_CMDCHKRM=	"DRDA_Proto_CMDCHKRM";
 	protected static String DRDA_Proto_CMDNSPRM=	"DRDA_Proto_CMDNSPRM";
@@ -109,7 +109,7 @@ class DRDAProtocolException extends Exce
 	   DRDAProtocolExceptionInfo for each of our messages.
 	*/
 	
-	errorInfoTable = new Hashtable();
+	errorInfoTable = new Hashtable<String, DRDAProtocolExceptionInfo>();
 	
 	errorInfoTable.put(
 			   DRDA_Proto_CMDCHKRM,

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAResultSet.java Mon Jul 16
07:22:45 2012
@@ -79,11 +79,10 @@ class DRDAResultSet
 	protected int nbrrow;			   // number of fetch or insert rows
 	protected byte [] rslsetflg;		// Result Set Flags
 
-	private ArrayList  extDtaObjects;  // Arraylist of Blobs and Clobs 
-	                                   // Return Values to 
-		                               // send with extdta objects.
+    /** List of Blobs and Clobs. Return values to send with extdta objects. */
+    private ArrayList<Object> extDtaObjects;
 	
-	private ArrayList rsExtPositions;
+    private ArrayList<Integer> rsExtPositions;
 
 	protected ConsistencyToken pkgcnstkn; // Unique consistency token for ResultSet 0
 
@@ -258,11 +257,11 @@ class DRDAResultSet
 	protected void  addExtDtaObject (Object o, int jdbcIndex )
 	{
 		if (extDtaObjects == null)
-			extDtaObjects = new java.util.ArrayList();
+			extDtaObjects = new java.util.ArrayList<Object>();
 		extDtaObjects.add (o);
 
 		if (rsExtPositions == null)
-			rsExtPositions = new java.util.ArrayList();
+			rsExtPositions = new java.util.ArrayList<Integer>();
 		
 		// need to record the 0 based position so subtract 1
 		rsExtPositions.add (new Integer(jdbcIndex -1 ));
@@ -312,21 +311,12 @@ class DRDAResultSet
 	 *
 	 *  @return ArrayList with extdta
 	 */
-	protected ArrayList getExtDtaObjects()
+	protected ArrayList<Object> getExtDtaObjects()
 	{
 		return extDtaObjects;
 	}
 
 	/**
-	 * Set the extData Objects
-	 */
-	protected void  setExtDtaObjects(ArrayList a)
-	{
-		extDtaObjects =a;
-	}
-	
-	
-	/**
 	 * This method closes the JDBC objects and frees up all references held by
 	 * this object.
 	 * 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAStatement.java Mon Jul 16
07:22:45 2012
@@ -99,8 +99,10 @@ class DRDAStatement
 
 
 	private DRDAResultSet currentDrdaRs;  // Current ResultSet
-	private Hashtable resultSetTable;     // Hashtable with resultsets            
-	private ArrayList resultSetKeyList;  // ordered list of hash keys
+    /** Hashtable with resultsets. */
+    private Hashtable<ConsistencyToken, DRDAResultSet> resultSetTable;
+    /** Ordered list of hash keys. */
+    private ArrayList<ConsistencyToken> resultSetKeyList;
 	private int numResultSets = 0;  
 
     /**
@@ -414,19 +416,11 @@ class DRDAStatement
 	 *
 	 *  @return ArrayList with extdta
 	 */
-	protected ArrayList getExtDtaObjects()
+	protected ArrayList<Object> getExtDtaObjects()
 	{
 		return currentDrdaRs.getExtDtaObjects();
 	}
 
-	/**
-	 * Set the extData Objects
-	 */
-	protected void  setExtDtaObjects(ArrayList a)
-	{
-		currentDrdaRs.setExtDtaObjects(a);
-	}
-
 	public void setSplitQRYDTA(byte []data)
 	{
 		currentDrdaRs.setSplitQRYDTA(data);
@@ -981,9 +975,10 @@ class DRDAStatement
 				// If hashtable doesn't exist, create it and store resultSet 0
 				// before we store our new resultSet.
 				// For just a single resultSet we don't ever create the Hashtable.
-				resultSetTable = new Hashtable();
+				resultSetTable =
+                        new Hashtable<ConsistencyToken, DRDAResultSet>();
 				resultSetTable.put(pkgcnstkn, currentDrdaRs);
-				resultSetKeyList = new ArrayList();
+				resultSetKeyList = new ArrayList<ConsistencyToken>();
 				resultSetKeyList.add(0, pkgcnstkn);
 			}
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java Mon Jul 16 07:22:45
2012
@@ -81,7 +81,8 @@ class Database
 	DRDAStatement defaultStatement;    // default statement used 
 													   // for execute imm
 	private DRDAStatement currentStatement; // current statement we are working on
-	private Hashtable stmtTable;		// Hash table for storing statements
+    /** Hash table for storing statements. */
+    private Hashtable<Object, DRDAStatement> stmtTable;
 
 	// constructor
 	/**
@@ -92,7 +93,7 @@ class Database
 	Database (String dbName)
 	{
 		setDatabaseName(dbName);
-		this.stmtTable = new Hashtable();
+		this.stmtTable = new Hashtable<Object, DRDAStatement>();
 		initializeDefaultStatement();
 	}
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DssTrace.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DssTrace.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DssTrace.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DssTrace.java Mon Jul 16 07:22:45
2012
@@ -185,9 +185,9 @@ public class DssTrace
                 try {             	
                     // The writer will be buffered for effeciency.
                     comBufferWriter =
-                        ((PrintWriter)AccessController.doPrivileged(
-                            new PrivilegedExceptionAction() {
-                                public Object run()
+                        (AccessController.doPrivileged(
+                            new PrivilegedExceptionAction<PrintWriter>() {
+                                public PrintWriter run()
                                         throws SecurityException, IOException {
                                     File f = new File(fileName);
                                     boolean exists = f.exists();
@@ -214,8 +214,8 @@ public class DssTrace
                         final File traceDirectory = new File(fileName).getParentFile();
                         if (traceDirectory != null) {
                             AccessController.doPrivileged(
-                                    new PrivilegedAction() {
-                                        public Object run() {
+                                    new PrivilegedAction<Void>() {
+                                        public Void run() {
                                             // DERBY-4128: First try to create the
                                             // directory with mkdir(), as that doesn't
                                             // require read permission for the parent

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
(original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
Mon Jul 16 07:22:45 2012
@@ -225,7 +225,7 @@ public final class NetworkServerControlI
 	private final static int ERRTYPE_UNKNOWN = -1;
 
 	// command argument information
-	private Vector commandArgs = new Vector();
+	private Vector<String> commandArgs = new Vector<String>();
 	private String databaseArg;
 	// DERBY-2109: Note that derby JDBC clients have a default user name
     // "APP" (= Property.DEFAULT_USER_NAME) assigned if they don't provide
@@ -303,26 +303,28 @@ public final class NetworkServerControlI
 	private NetworkServerControlImpl serverInstance;
 	private LocalizedResource langUtil;
 	public String clientLocale;
-	ArrayList  localAddresses; // list of local addresses for checking admin
-	                              // commands. 
+    /** List of local addresses for checking admin commands. */
+    ArrayList<InetAddress> localAddresses;
 
 	// open sessions
-	private Hashtable sessionTable = new Hashtable();
+	private Hashtable<Integer, Session> sessionTable =
+            new Hashtable<Integer, Session>();
 
 	// current session
 	private Session currentSession;
 	// DRDAConnThreads
-	private Vector threadList = new Vector();
+	private Vector<DRDAConnThread> threadList = new Vector<DRDAConnThread>();
 
 	// queue of sessions waiting for a free thread - the queue is managed
 	// in a simple first come, first serve manner - no priorities
-	private Vector runQueue = new Vector();
+	private Vector<Session> runQueue = new Vector<Session>();
 
 	// number of DRDAConnThreads waiting for something to do
 	private int freeThreads;
 
 	// known application requesters
-	private Hashtable appRequesterTable = new Hashtable();
+	private Hashtable<String, AppRequester> appRequesterTable =
+            new Hashtable<String, AppRequester>();
 
 	// accessed by inner classes for privileged action
 	private String propertyFileName;
@@ -718,9 +720,9 @@ public final class NetworkServerControlI
 		// Open a server socket listener	  
 		try{
 			serverSocket = 
-				(ServerSocket) 
-				AccessController.doPrivileged(new PrivilegedExceptionAction() {
-						public Object run() throws IOException
+				AccessController.doPrivileged(
+                    new PrivilegedExceptionAction<ServerSocket>() {
+						public ServerSocket run() throws IOException
 						{
 							return createServerSocket();
 						}
@@ -790,16 +792,12 @@ public final class NetworkServerControlI
 
 		// We accept clients on a separate thread so we don't run into a problem
 		// blocking on the accept when trying to process a shutdown
-		final ClientThread clientThread =	 
-			(ClientThread) AccessController.doPrivileged(
-								new PrivilegedExceptionAction() {
-									public Object run() throws Exception
-									{
-										return new ClientThread(thisControl, 
-																serverSocket);
-									}
-								}
-							);
+        final ClientThread clientThread = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<ClientThread>() {
+                    public ClientThread run() throws Exception {
+                        return new ClientThread(thisControl, serverSocket);
+                    }
+                });
 		clientThread.start();
 
 		try {
@@ -818,8 +816,8 @@ public final class NetworkServerControlI
 	        
 	        try {
 	            AccessController.doPrivileged(
-	                    new PrivilegedAction() {
-	                        public Object run()  {
+	                    new PrivilegedAction<Void>() {
+	                        public Void run() {
 	                        // Need to interrupt the memcheck thread if it is sleeping.
 	                            if (mc != null)
 	                                mc.interrupt();
@@ -857,12 +855,12 @@ public final class NetworkServerControlI
 	 	                
 	 	 				threadi.close();
 	 					AccessController.doPrivileged(
-	 								new PrivilegedAction() {
-	 									public Object run() {
-	 										threadi.interrupt();
-	 										return null;
-	 									}
-	 								});
+                                new PrivilegedAction<Void>() {
+                                    public Void run() {
+                                        threadi.interrupt();
+                                        return null;
+                                    }
+                                });
 	 				} catch (Exception exception) {
 	 		        	consolePrintAndIgnore("DRDA_UnexpectedException.S", exception, true);
 	 				}
@@ -2534,10 +2532,10 @@ public final class NetworkServerControlI
 	{
 		
 		try {
-			clientSocket = (Socket) AccessController.doPrivileged(
-								new PrivilegedExceptionAction() {
+			clientSocket = AccessController.doPrivileged(
+								new PrivilegedExceptionAction<Socket>() {
 										
-									public Object run() 
+									public Socket run()
 										throws UnknownHostException,
 											   IOException, 
 											   java.security.NoSuchAlgorithmException,
@@ -2626,7 +2624,7 @@ public final class NetworkServerControlI
 	 **/
 	private void buildLocalAddressList(InetAddress bindAddr) 
 	{
-        localAddresses = new ArrayList(3);
+        localAddresses = new ArrayList<InetAddress>(3);
         localAddresses.add(bindAddr);
         
         try { localAddresses.add(InetAddress.getLocalHost()); }
@@ -4098,19 +4096,18 @@ public final class NetworkServerControlI
 	{
 		ProductVersionHolder myPVH= null;
 		try {
-			myPVH = (ProductVersionHolder) AccessController.doPrivileged(
-								new PrivilegedExceptionAction() {
-										
-									public Object run() throws UnknownHostException,IOException
-									{
-										InputStream versionStream = getClass().getResourceAsStream(ProductGenusNames.NET_INFO);
-
-										return ProductVersionHolder.getProductVersionHolderFromMyEnv(versionStream);
-									}
-									});
-		
-}
-		catch(PrivilegedActionException e) {
+			myPVH = AccessController.doPrivileged(
+                new PrivilegedExceptionAction<ProductVersionHolder>() {
+                    public ProductVersionHolder run()
+                            throws UnknownHostException, IOException {
+                        InputStream versionStream =
+                            getClass().getResourceAsStream(
+                                ProductGenusNames.NET_INFO);
+                        return ProductVersionHolder.
+                                getProductVersionHolderFromMyEnv(versionStream);
+                    }
+                });
+        } catch (PrivilegedActionException e) {
 			Exception e1 = e.getException();
 			consolePropertyMessage("DRDA_ProductVersionReadError.S", e1.getMessage());			
 		}

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Session.java Mon Jul 16 07:22:45
2012
@@ -69,7 +69,8 @@ class Session
 	protected LocalizedResource langUtil;		// localization information for command session
 										// client
 
-	private	Hashtable	dbtable;		// Table of databases accessed in this session
+    /** Table of databases accessed in this session. */
+    private	Hashtable<String, Database> dbtable;
 	private NetworkServerControlImpl nsctrl;        // NetworkServerControlImpl needed for logging
                                                         // message if tracing fails.
                                                         
@@ -94,7 +95,7 @@ class Session
 		this.traceOn = traceOn;
 		if (traceOn)
 			dssTrace = new DssTrace(); 
-		dbtable = new Hashtable();
+		dbtable = new Hashtable<String, Database>();
 		initialize(traceDirectory);
 	}
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/build.xml?rev=1361925&r1=1361924&r2=1361925&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/build.xml (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/build.xml Mon Jul 16 07:22:45
2012
@@ -36,47 +36,9 @@
   <target name="drda" depends="compile"/>
 
   <target name="compile">
-  <javac
-      source="1.4"
-      target="1.4"
-      bootclasspath="${empty}"
-      nowarn="on"
-      debug="${debug}"
-      depend="${depend}"
-      deprecation="${deprecation}"
-      optimize="${optimize}"
-      proceed="${proceed}"
-      verbose="${verbose}"
-      srcdir="${derby.drda.src.dir}"
-      destdir="${out.dir}">
-      <classpath>
-        <pathelement path="${java15compile.classpath}"/>
-      </classpath>
-      <include name="${derby.dir}/impl/drda/DecryptionManager.java"/>
-    </javac>
-  <javac
-    source="1.4"
-    target="1.4"
-      bootclasspath="${empty}"
-      nowarn="on"
-      debug="${debug}"
-      depend="${depend}"
-      deprecation="${deprecation}"
-      optimize="${optimize}"
-      proceed="${proceed}"
-      verbose="${verbose}"
-      srcdir="${derby.drda.src.dir}"
-      destdir="${out.dir}">
-      <classpath>
-        <pathelement path="${java15compile.classpath}"/>
-      </classpath>
-      <include name="${derby.dir}/impl/drda/DRDAXAProtocol.java"/>
-      <include name="${derby.dir}/impl/drda/DRDAXid.java"/>
-      <include name="${derby.dir}/impl/drda/XADatabase.java"/>
-    </javac>
     <javac
-      source="1.4"
-      target="1.4"
+      source="1.5"
+      target="1.5"
       bootclasspath="${empty}"
       nowarn="on"
       debug="${debug}"
@@ -91,10 +53,6 @@
         <pathelement path="${java15compile.classpath}"/>
       </classpath>
       <include name="${derby.dir}/impl/drda/*.java"/>
-      <exclude name="${derby.dir}/impl/drda/DecryptionManager.java"/>
-      <exclude name="${derby.dir}/impl/drda/DRDAXAProtocol.java"/>
-      <exclude name="${derby.dir}/impl/drda/DRDAXid.java"/>
-      <exclude name="${derby.dir}/impl/drda/XADatabase.java"/>
     </javac>
   </target>
 



Mime
View raw message