db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1360135 - /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
Date Wed, 11 Jul 2012 12:11:46 GMT
Author: kahatlen
Date: Wed Jul 11 12:11:45 2012
New Revision: 1360135

URL: http://svn.apache.org/viewvc?rev=1360135&view=rev
Log:
DERBY-5847: Clean up IDE warnings in DRDAConnThread

Fix warnings:

- Remove if statement that was previously disabled by prepending
  "false &&" to the condition. Silences "unreachable code" warning.
- Remove no-op bitwise shift operation.
- Rename local variable that hides field.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java

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=1360135&r1=1360134&r2=1360135&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 Wed Jul 11
12:11:45 2012
@@ -4255,11 +4255,10 @@ class DRDAConnThread extends Thread {
 		else  if (! sendSQLDTARD)
 		{
 			int updateCount = ps.getUpdateCount();
-			if (false && (database.RDBUPDRM_sent == false) &&
-				! isProcedure)
-			{
-				writeRDBUPDRM();
-			}
+
+            // The protocol wants us to send RDBUPDRM here, but we don't do
+            // that because it used to cause protocol errors. DERBY-5847 has
+            // some discussion about this issue.
 
 			checkWarning(database.getConnection(), stmt.ps, null, updateCount, true, true);
 		}
@@ -7694,7 +7693,7 @@ class DRDAConnThread extends Thread {
 				case Types.DECIMAL:
 				case Types.NUMERIC:
 					scale = rtnOutput ? rsmeta.getScale(jdbcElemNum) : pmeta.getScale(jdbcElemNum);
-					outlen[0] = ((precision <<8) | (scale <<0));
+					outlen[0] = ((precision <<8) | scale);
 					if (SanityManager.DEBUG) 
 						trace("\n\nprecision =" +precision +
 						  " scale =" + scale);
@@ -8704,15 +8703,17 @@ class DRDAConnThread extends Thread {
 	 */
 	private void setDatabase(int codePoint) throws DRDAProtocolException
 	{
-		String rdbnam = parseRDBNAM();
+		String dbname = parseRDBNAM();
 		// using same database so we are done
-		if (database != null && database.getDatabaseName().equals(rdbnam))
+		if (database != null && database.getDatabaseName().equals(dbname)) {
 			return;
-		Database d = session.getDatabase(rdbnam);
-		if (d == null)
+        }
+		Database d = session.getDatabase(dbname);
+		if (d == null) {
 			rdbnamMismatch(codePoint);
-		else
+        } else {
 			database = d;
+        }
 		session.database = d;
 	}
 	/**



Mime
View raw message