db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1102679 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ engine/org/apache/derby/iapi/types/ engine/org/apache/derby/impl/services/locks/ engine/org/apache/derby/impl/sql/catalog/ engine/org/apache/derby/impl/sql/compile/...
Date Fri, 13 May 2011 11:21:19 GMT
Author: kahatlen
Date: Fri May 13 11:21:18 2011
New Revision: 1102679

URL: http://svn.apache.org/viewvc?rev=1102679&view=rev
Log:
DERBY-5224: reduce cohesion by removing overzealous casting

Contributed by Dave Brosius <dbrosius@apache.org>.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/AbstractPool.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockTableVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/D_BTreeController.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogicalStatementEntity.java
Fri May 13 11:21:18 2011
@@ -100,9 +100,9 @@ abstract class LogicalStatementEntity
         this.cache = cacheInteractor.getCache();
         this.owner = cacheInteractor;
         this.physicalPs = physicalPs;
-        if (physicalPs instanceof CallableStatement) {
+        if (physicalPs instanceof java.sql.CallableStatement) {
             this.hasCallableStmt = true;
-            this.physicalCs = (CallableStatement)physicalPs;
+            this.physicalCs = (java.sql.CallableStatement)physicalPs;
         } else {
             this.hasCallableStmt = false;
             this.physicalCs = null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/NumberDataType.java Fri May
13 11:21:18 2011
@@ -70,7 +70,7 @@ public abstract class NumberDataType ext
             return minus(result);
 
         if(result == null)
-            result = (NumberDataType)getNewNull();
+            result = (NumberDataValue)getNewNull();
         
         result.setValue(this);
         return result;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/AbstractPool.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/AbstractPool.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/AbstractPool.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/AbstractPool.java
Fri May 13 11:21:18 2011
@@ -396,7 +396,7 @@ abstract class AbstractPool implements L
 
 		try {
 
-			Serializable value = (String) PropertyUtil.getPropertyFromSet(dbOnly, p, key);
+			Serializable value = (Serializable) PropertyUtil.getPropertyFromSet(dbOnly, p, key);
 			if (value != null) {
 				validate(key, value, p);
 				apply(key, value, p);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockTableVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockTableVTI.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockTableVTI.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockTableVTI.java
Fri May 13 11:21:18 2011
@@ -100,10 +100,9 @@ class LockTableVTI implements Enumeratio
 
 	private Latch getNextLock(Control control) {
 		Latch lock = null;
-//System.out.println("next lock ");
 		if (grantedList != null) {
 			if (grantedList.hasNext()) {
-				lock = (Lock) grantedList.next();
+				lock = (Latch) grantedList.next();
 			}
 			else
 				grantedList = null;
@@ -112,7 +111,7 @@ class LockTableVTI implements Enumeratio
 		if (lock == null) {
 			if (waitingList != null) {
 				if (waitingList.hasNext()) {
-					lock = (Lock) waitingList.next();
+					lock = (Latch) waitingList.next();
 				}
 				else
 					waitingList = null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java
Fri May 13 11:21:18 2011
@@ -13722,7 +13722,7 @@ public final class	DataDictionaryImpl
         keyRow.setColumn(1, objIdOrderable);
 
         while ((curRow = ti.getRow(tc, keyRow, rf.PERMS_OBJECTID_IDX_NUM)) != null) {
-            perm = (PermDescriptor) rf.buildDescriptor(curRow, (TupleDescriptor) null, this);
+            perm = (PermissionsDescriptor) rf.buildDescriptor(curRow, (TupleDescriptor) null,
this);
             removePermEntryInCache(perm);
 
             // Build new key based on UUID and drop the entry as we want to drop

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java Fri
May 13 11:21:18 2011
@@ -226,7 +226,7 @@ public class DistinctNode extends Single
 		/* We need to implement this method since a PRN can appear above a
 		 * SelectNode in a query tree.
 		 */
-		childResult = (ProjectRestrictNode) childResult.optimize(
+		childResult = (ResultSetNode) childResult.optimize(
 															dataDictionary,
 															predicates,
 															outerRows);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java Fri
May 13 11:21:18 2011
@@ -959,7 +959,7 @@ public class GroupByNode extends SingleC
 		/* We need to implement this method since a PRN can appear above a
 		 * SelectNode in a query tree.
 		 */
-		childResult = (FromTable) childResult.optimize(
+		childResult = (ResultSetNode) childResult.optimize(
 											dataDictionary,
 											predicates,
 											outerRows);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/InsertNode.java Fri
May 13 11:21:18 2011
@@ -462,7 +462,7 @@ public final class InsertNode extends DM
 		{
             
 			resultSet = 
-			(NormalizeResultSetNode) getNodeFactory().getNode(
+			(ResultSetNode) getNodeFactory().getNode(
 			C_NodeTypes.NORMALIZE_RESULT_SET_NODE, resultSet,
 			resultColumnList, null, Boolean.FALSE,
 			getContextManager());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/IntersectOrExceptNode.java
Fri May 13 11:21:18 2011
@@ -329,7 +329,7 @@ public class IntersectOrExceptNode exten
                 treeTop.getResultColumns().copyListAndObjects();
             newRcl.genVirtualColumnNodes(treeTop, treeTop.getResultColumns());
 
-            treeTop = (RowCountNode)getNodeFactory().getNode(
+            treeTop = (ResultSetNode)getNodeFactory().getNode(
                 C_NodeTypes.ROW_COUNT_NODE,
                 treeTop,
                 newRcl,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/MethodCallNode.java
Fri May 13 11:21:18 2011
@@ -186,7 +186,7 @@ abstract class MethodCallNode extends Ja
 			*/
 			if ( ! (qt instanceof JavaValueNode))
 			{
-				qt = (SQLToJavaValueNode) getNodeFactory().getNode(
+				qt = (QueryTreeNode) getNodeFactory().getNode(
 						C_NodeTypes.SQL_TO_JAVA_VALUE_NODE, 
 						qt, 
 						getContextManager());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowResultSetNode.java
Fri May 13 11:21:18 2011
@@ -649,7 +649,7 @@ public class RowResultSetNode extends Fr
                 treeTop.getResultColumns().copyListAndObjects();
             newRcl.genVirtualColumnNodes(treeTop, treeTop.getResultColumns());
 
-            treeTop = (RowCountNode)getNodeFactory().getNode(
+            treeTop = (ResultSetNode)getNodeFactory().getNode(
                 C_NodeTypes.ROW_COUNT_NODE,
                 treeTop,
                 newRcl,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/SelectNode.java Fri
May 13 11:21:18 2011
@@ -1651,7 +1651,7 @@ public class SelectNode extends ResultSe
             ResultColumnList newSelectList = topList.copyListAndObjects();
             prnRSN.setResultColumns(newSelectList);
             topList.genVirtualColumnNodes(prnRSN, newSelectList);
-            prnRSN = (RowCountNode)getNodeFactory().getNode(
+            prnRSN = (ResultSetNode)getNodeFactory().getNode(
                 C_NodeTypes.ROW_COUNT_NODE,
                 prnRSN,
                 topList,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UnionNode.java Fri May
13 11:21:18 2011
@@ -445,7 +445,7 @@ public class UnionNode extends SetOperat
 			if (! columnTypesAndLengthsMatch())
 			{
 			    treeTop = 
-				(NormalizeResultSetNode) getNodeFactory().getNode(
+				(ResultSetNode) getNodeFactory().getNode(
 				C_NodeTypes.NORMALIZE_RESULT_SET_NODE,
 				treeTop, null, null, Boolean.FALSE,
 				getContextManager());	
@@ -487,7 +487,7 @@ public class UnionNode extends SetOperat
                 treeTop.getResultColumns().copyListAndObjects();
             newRcl.genVirtualColumnNodes(treeTop, treeTop.getResultColumns());
 
-            treeTop = (RowCountNode)getNodeFactory().getNode(
+            treeTop = (ResultSetNode)getNodeFactory().getNode(
                 C_NodeTypes.ROW_COUNT_NODE,
                 treeTop,
                 newRcl,

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UpdateNode.java Fri
May 13 11:21:18 2011
@@ -498,13 +498,13 @@ public final class UpdateNode extends DM
 			resultColumnList.appendResultColumns(afterColumns, false);
 
 			/* Generate the RowLocation column */
-			rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode(
+			rowLocationNode = (ValueNode) getNodeFactory().getNode(
 										C_NodeTypes.CURRENT_ROW_LOCATION_NODE,
 										getContextManager());
         }
         else
         {
-			rowLocationNode = (NumericConstantNode) getNodeFactory().getNode(
+			rowLocationNode = (ValueNode) getNodeFactory().getNode(
 										C_NodeTypes.INT_CONSTANT_NODE,
                                         ReuseFactory.getInteger( 0),
 										getContextManager());
@@ -554,7 +554,7 @@ public final class UpdateNode extends DM
 		 */
 		if (! resultColumnList.columnTypesAndLengthsMatch())
  		{
-			resultSet = (NormalizeResultSetNode) getNodeFactory().getNode(
+			resultSet = (ResultSetNode) getNodeFactory().getNode(
 			    C_NodeTypes.NORMALIZE_RESULT_SET_NODE, 
 			    resultSet, resultColumnList, null, Boolean.TRUE,
 			    getContextManager());

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/execute/SetConstraintsConstantAction.java
Fri May 13 11:21:18 2011
@@ -322,7 +322,7 @@ class SetConstraintsConstantAction exten
 			int cdlSize = cdl.size();
 			for (int index = 0; index < cdlSize; index++)
 			{
-				cd = (CheckConstraintDescriptor) cdl.elementAt(index);
+				cd = (ConstraintDescriptor) cdl.elementAt(index);
 				if (text == null)
 				{
 					text = new StringBuffer("(").append(cd.getConstraintText()).append(") ");

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/D_BTreeController.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/D_BTreeController.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/D_BTreeController.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/D_BTreeController.java
Fri May 13 11:21:18 2011
@@ -391,7 +391,7 @@ public class D_BTreeController extends D
     public String diag()
         throws StandardException
     {
-        OpenBTree   open_btree  = (BTreeController) this.diag_object;
+        OpenBTree   open_btree  = (OpenBTree) this.diag_object;
         ControlRow  root        = null;
         int         tree_height;
         LevelInfo   level_info[] = null;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java?rev=1102679&r1=1102678&r2=1102679&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/access/btree/index/B2IFactory.java
Fri May 13 11:21:18 2011
@@ -284,7 +284,7 @@ public class B2IFactory implements Congl
                 SanityManager.ASSERT(root.getPage().isLatched());
 
             // read the Conglomerate from it's entry in the control row.
-            btree = (B2I) root.getConglom(B2I.FORMAT_NUMBER);
+            btree = (Conglomerate) root.getConglom(B2I.FORMAT_NUMBER);
 
             if (SanityManager.DEBUG)
                 SanityManager.ASSERT(btree instanceof B2I);



Mime
View raw message