db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1495305 [14/21] - in /db/derby/code/trunk: java/engine/org/apache/derby/ java/engine/org/apache/derby/catalog/types/ java/engine/org/apache/derby/iapi/services/io/ java/engine/org/apache/derby/iapi/sql/ java/engine/org/apache/derby/iapi/sq...
Date Fri, 21 Jun 2013 07:47:52 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultColumnList.java Fri Jun 21 07:47:47 2013
@@ -20,15 +20,13 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-
 import java.lang.reflect.Modifier;
 import java.sql.ResultSetMetaData;
 import java.sql.Types;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-
+import java.util.Map;
 import org.apache.derby.catalog.types.DefaultInfoImpl;
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.ClassName;
@@ -42,7 +40,6 @@ import org.apache.derby.iapi.services.lo
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-import org.apache.derby.iapi.sql.compile.NodeFactory;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
@@ -61,7 +58,6 @@ import org.apache.derby.iapi.types.DataV
 import org.apache.derby.iapi.types.RowLocation;
 import org.apache.derby.iapi.types.TypeId;
 import org.apache.derby.iapi.util.JBitSet;
-import org.apache.derby.iapi.util.ReuseFactory;
 
 /**
  * A ResultColumnList is the target list of a SELECT, INSERT, or UPDATE.
@@ -69,7 +65,7 @@ import org.apache.derby.iapi.util.ReuseF
  * @see ResultColumn
  */
 
-public class ResultColumnList extends QueryTreeNodeVector
+class ResultColumnList extends QueryTreeNodeVector
 {
 	/* Is this the ResultColumnList for an index row? */
 	protected boolean indexRow;
@@ -110,8 +106,9 @@ public class ResultColumnList extends Qu
 	// ones were added internally.
 	private int initialListSize = 0;
 
-	public ResultColumnList()
-	{
+    ResultColumnList(ContextManager cm) {
+        super(cm);
+        setNodeType(C_NodeTypes.RESULT_COLUMN_LIST);
 	}
 
 	/**
@@ -121,7 +118,7 @@ public class ResultColumnList extends Qu
 	 * @param resultColumn	The ResultColumn to add to the list
 	 */
 
-	public void addResultColumn(ResultColumn resultColumn)
+    void addResultColumn(ResultColumn resultColumn)
 	{
 		/* Vectors are 0-based, ResultColumns are 1-based */
 		resultColumn.setVirtualColumnId(size() + 1);
@@ -136,7 +133,7 @@ public class ResultColumnList extends Qu
 	 * @param destructiveCopy	Whether or not this is a descructive copy
 	 *							from resultColumns
 	 */
-	public void appendResultColumns(ResultColumnList resultColumns,
+    void appendResultColumns(ResultColumnList resultColumns,
 									boolean destructiveCopy)
 	{
 		int	oldSize = size();
@@ -174,7 +171,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column at that position.
 	 */
 
-	public ResultColumn getResultColumn(int position)
+    ResultColumn getResultColumn(int position)
 	{
 		/*
 		** First see if it falls in position x.  If not,
@@ -219,19 +216,17 @@ public class ResultColumnList extends Qu
 	 *  is also returned via the whichRC parameter.  If no match is found,
 	 *  return null and leave whichRC untouched.
 	 */
-	public ResultColumn getResultColumn(int colNum, ResultSetNode rsn,
+    ResultColumn getResultColumn(int colNum, ResultSetNode rsn,
 		int [] whichRC) throws StandardException
 	{
 		if (colNum == -1)
 			return null;
 
-		ResultColumn rc = null;
-		ColumnReference colRef = null;
 		int [] crColNum = new int[] { -1 };
 
 		for (int index = size() - 1; index >= 0; index--)
 		{
-			rc = (ResultColumn) elementAt(index);
+            ResultColumn rc = (ResultColumn) elementAt(index);
 			if (!(rc.getExpression() instanceof ColumnReference))
 			{
 				// If the rc's expression isn't a column reference then
@@ -239,7 +234,7 @@ public class ResultColumnList extends Qu
 				continue;
 			}
 
-			colRef = (ColumnReference)rc.getExpression();
+            ColumnReference colRef = (ColumnReference)rc.getExpression();
 			if ((rsn == colRef.getSourceResultSet(crColNum)) &&
 				(crColNum[0] == colNum))
 			{
@@ -260,7 +255,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return	the column at that position, null if out of range
 	 */
-	public ResultColumn getOrderByColumn(int position)
+    ResultColumn getOrderByColumn(int position)
 	{
 		// this wraps the cast needed, and the 0-based nature of the Vectors.
 		if (position == 0) 
@@ -278,7 +273,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column that matches that name.
 	 */
 
-	public ResultColumn getResultColumn(String columnName)
+    ResultColumn getResultColumn(String columnName)
 	{
         return getResultColumn( columnName, true );
 	}
@@ -293,7 +288,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column that matches that name.
 	 */
 
-	public ResultColumn getResultColumn(String columnName, boolean markIfReferenced )
+    ResultColumn getResultColumn(String columnName, boolean markIfReferenced )
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -453,7 +448,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column that matches that name.
 	 */
 
-	public ResultColumn getResultColumn(String columnsTableName, String columnName)
+    ResultColumn getResultColumn(String columnsTableName, String columnName)
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -504,7 +499,7 @@ public class ResultColumnList extends Qu
 	 * @exception StandardException	Thrown on error
 	 */
 
-	public ResultColumn getAtMostOneResultColumn(
+    ResultColumn getAtMostOneResultColumn(
 								ColumnReference cr,
 								String exposedTableName,
 								boolean considerGeneratedColumns)
@@ -574,7 +569,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column that matches that name.
 	 * @exception StandardException thrown on ambiguity
 	 */
-	public ResultColumn getOrderByColumnToBind(
+    ResultColumn getOrderByColumnToBind(
             String columnName,
             TableName tableName,
             int tableNumber,
@@ -704,7 +699,7 @@ public class ResultColumnList extends Qu
 	 * @return	the column that matches that name, or NULL if pull-up needed
 	 * @exception StandardException thrown on ambiguity
 	 */
-	public ResultColumn findResultColumnForOrderBy(
+    ResultColumn findResultColumnForOrderBy(
                             String columnName, TableName tableName)
 		throws StandardException
 	{
@@ -843,7 +838,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindResultColumnsToExpressions()
+    void bindResultColumnsToExpressions()
 					throws StandardException
 	{
 		int size = size();
@@ -862,7 +857,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindResultColumnsByName(TableDescriptor targetTableDescriptor)
+    void bindResultColumnsByName(TableDescriptor targetTableDescriptor)
 					throws StandardException
 	{
 		int			size = size();
@@ -1015,7 +1010,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindResultColumnsByPosition(TableDescriptor targetTableDescriptor)
+    void bindResultColumnsByPosition(TableDescriptor targetTableDescriptor)
 					throws StandardException
 	{
 		int size = size();
@@ -1046,7 +1041,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void preprocess(int numTables,
+    void preprocess(int numTables,
 							FromList outerFromList,
 							SubqueryList outerSubqueryList,
 							PredicateList outerPredicateList) 
@@ -1095,7 +1090,7 @@ public class ResultColumnList extends Qu
 	  @param heapColCount the number of heap columns
 	  @exception StandardException	Thrown on error
 	 */
-	public int[] getStreamStorableColIds(int heapColCount) throws StandardException
+    int[] getStreamStorableColIds(int heapColCount) throws StandardException
 	{
 		//@#$
 		//System.out.println("getStreamStorableColids");
@@ -1158,6 +1153,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
     void generate(ActivationClassBuilder acb, MethodBuilder mb)
 			throws StandardException
 	{
@@ -1637,7 +1633,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return	A ResultDescription for this ResultSetNode.
 	 */
-	public ResultColumnDescriptor[] makeResultDescriptors()
+    ResultColumnDescriptor[] makeResultDescriptors()
 	{
 	    ResultColumnDescriptor colDescs[] = new ResultColumnDescriptor[size()];
 		int size = size();
@@ -1660,7 +1656,7 @@ public class ResultColumnList extends Qu
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public void expandAllsAndNameColumns(FromList fromList)
+    void expandAllsAndNameColumns(FromList fromList)
 					throws StandardException
 	{
 		boolean			expanded = false;
@@ -1739,7 +1735,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void nameAllResultColumns()
+    void nameAllResultColumns()
 		throws StandardException
 	{
 		int size = size();
@@ -1829,7 +1825,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return	true if this RCL is a No-Op projection of the given RCL.
 	 */
-	public boolean nopProjection(ResultColumnList childRCL)
+    boolean nopProjection(ResultColumnList childRCL)
 	{
 		/*
 		** This RCL is a useless projection if each column in the child
@@ -1851,7 +1847,7 @@ public class ResultColumnList extends Qu
 		for (int index = 0; index < size; index++)
 		{
 			ResultColumn thisColumn = (ResultColumn) elementAt(index);
-			ResultColumn referencedColumn = null;
+            ResultColumn referencedColumn;
 
 			/*
 			** A No-Op projection can point to a VirtualColumnNode or a
@@ -1894,7 +1890,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultColumnList copyListAndObjects()
+    ResultColumnList copyListAndObjects()
 					throws StandardException
 	{
 		ResultColumn	 newResultColumn;
@@ -1902,9 +1898,7 @@ public class ResultColumnList extends Qu
 		ResultColumnList newList;
 
 		/* Create the new ResultColumnList */
-		newList = (ResultColumnList) getNodeFactory().getNode(
-										C_NodeTypes.RESULT_COLUMN_LIST,
-										getContextManager());
+        newList = new ResultColumnList(getContextManager());
 
 		/* Walk the current list - for each ResultColumn in the list, make a copy
 		 * and add it to the new list.
@@ -1931,7 +1925,7 @@ public class ResultColumnList extends Qu
 	 * to be removed. 
 	 *
 	 */
-	public void removeOrderByColumns() 
+    void removeOrderByColumns()
 	{
 		int idx = size() - 1;
 		for (int i = 0; i < orderBySelect; i++, idx--) {
@@ -1950,7 +1944,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void genVirtualColumnNodes(ResultSetNode sourceResultSet, 
+    void genVirtualColumnNodes(ResultSetNode sourceResultSet,
 									  ResultColumnList sourceResultColumnList)
 				throws StandardException
 	{
@@ -1970,7 +1964,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void genVirtualColumnNodes(ResultSetNode sourceResultSet, 
+    void genVirtualColumnNodes(ResultSetNode sourceResultSet,
 									  ResultColumnList sourceResultColumnList,
 									  boolean markReferenced)
 				throws StandardException
@@ -1985,12 +1979,11 @@ public class ResultColumnList extends Qu
 			DataTypeDescriptor dts = resultColumn.getTypeServices();
 
 			/* Vectors are 0-based, VirtualColumnIds are 1-based */
-			resultColumn.expression = (ValueNode) getNodeFactory().getNode(
-							C_NodeTypes.VIRTUAL_COLUMN_NODE,
-							sourceResultSet,
-							sourceResultColumnList.elementAt(index),
-							ReuseFactory.getInteger(index + 1),
-							getContextManager());
+            resultColumn.expression = new VirtualColumnNode(
+                    sourceResultSet,
+                    (ResultColumn)sourceResultColumnList.elementAt(index),
+                    index + 1,
+                    getContextManager());
 
 			/* Mark the ResultColumn as being referenced */
 			if (markReferenced)
@@ -2007,7 +2000,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @param adjust		The size of the increment.
 	 */
-	public void adjustVirtualColumnIds(int adjust)
+    void adjustVirtualColumnIds(int adjust)
 	{
 		int size = size();
 
@@ -2039,11 +2032,11 @@ public class ResultColumnList extends Qu
 	 * 
 	 * @exception StandardException		Thrown on error
 	 */
-	public void	doProjection() throws StandardException
+    void    doProjection() throws StandardException
 	{
 		int				numDeleted = 0;
 		int size = size();
-		ResultColumnList deletedRCL = new ResultColumnList();
+        ResultColumnList deletedRCL = new ResultColumnList(getContextManager());
 		for (int index = 0; index < size; index++)
 		{
 			ResultColumn resultColumn = (ResultColumn) elementAt(index);
@@ -2092,7 +2085,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return String	The first duplicate column name, if any.
 	 */
-	public String verifyUniqueNames(boolean errForGenCols)
+    String verifyUniqueNames(boolean errForGenCols)
 					throws StandardException
 	{
 		int size = size();
@@ -2127,7 +2120,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException	Thrown on error
 	 */
-	public void propagateDCLInfo(ResultColumnList derivedRCL, String tableName)
+    void propagateDCLInfo(ResultColumnList derivedRCL, String tableName)
 					throws StandardException
 	{
 		String duplicateColName;
@@ -2215,15 +2208,15 @@ public class ResultColumnList extends Qu
 	void rejectXMLValues() throws StandardException
 	{
 		int sz = size();
-		ResultColumn rc = null;
-		for (int i = 1; i <= sz; i++) {
+
+        for (int i = 1; i <= sz; i++) {
 
 			if (i > initialListSize)
 			// this RC was generated internally and will not
 			// be returned to the user, so don't throw error.
 				continue;
 
-			rc = getResultColumn(i);
+            ResultColumn rc = getResultColumn(i);
 			if ((rc != null) && (rc.getType() != null) &&
 				rc.getType().getTypeId().isXMLTypeId())
 			{ // Disallow it.
@@ -2239,7 +2232,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @param resultSetNumber	The resultSetNumber
 	 */
-	public void setResultSetNumber(int resultSetNumber)
+    void setResultSetNumber(int resultSetNumber)
 	{
 		int size = size();
 
@@ -2254,7 +2247,7 @@ public class ResultColumnList extends Qu
 	 * Useful when chopping a ResultSetNode out of a tree when there are
 	 * still references to its RCL.
 	 */
-	public void setRedundant()
+    void setRedundant()
 	{
 		int size = size();
 
@@ -2311,7 +2304,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException			Thrown on error
 	 */
-	public void	setUnionResultExpression(ResultColumnList otherRCL,
+    void    setUnionResultExpression(ResultColumnList otherRCL,
                                          int tableNumber,
                                          int level,
                                          String operatorName)
@@ -2339,18 +2332,11 @@ public class ResultColumnList extends Qu
 		}
 
 		/* Make a dummy TableName to be shared by all new CRs */
-		dummyTN = (TableName) getNodeFactory().getNode(
-										C_NodeTypes.TABLE_NAME,
-										null,
-										null,
-										getContextManager());
-
-		ContextManager cm = getContextManager();
+        dummyTN = new TableName(null, null, getContextManager());
 
 		int size = visibleSize();
 		for (int index = 0; index < size; index++)
 		{
-			boolean		 nullableResult;
 			ColumnReference newCR;
 			ResultColumn thisRC = (ResultColumn) elementAt(index);
 			ResultColumn otherRC = (ResultColumn) otherRCL.elementAt(index);
@@ -2396,11 +2382,8 @@ public class ResultColumnList extends Qu
 												otherExpr.getTypeServices(),
 												cf);
 
-			newCR = (ColumnReference) getNodeFactory().getNode(
-										C_NodeTypes.COLUMN_REFERENCE,
-										thisRC.getName(),
-										dummyTN,
-										getContextManager());
+            newCR = new ColumnReference(
+                    thisRC.getName(), dummyTN, getContextManager());
 			newCR.setType(resultType);
 			/* Set the tableNumber and nesting levels in newCR.
 			 * If thisExpr is not a CR, then newCR cannot be
@@ -2481,7 +2464,8 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return boolean	Whether or not there is an exact UNION type match on the 2 RCLs.
 	 */
-	public boolean isExactTypeAndLengthMatch(ResultColumnList otherRCL) throws StandardException
+    boolean isExactTypeAndLengthMatch(ResultColumnList otherRCL)
+            throws StandardException
 	{
 
         if (SanityManager.DEBUG) {
@@ -2604,7 +2588,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultColumnList expandToAll(TableDescriptor td,
+    ResultColumnList expandToAll(TableDescriptor td,
 								TableName tableName)
 						throws StandardException
 	{
@@ -2615,10 +2599,7 @@ public class ResultColumnList extends Qu
 		int							posn;
 
 		/* Get a new ResultColumnList */
-		retval = (ResultColumnList) getNodeFactory().getNode(
-										C_NodeTypes.RESULT_COLUMN_LIST,
-										getContextManager());
-
+        retval = new ResultColumnList(getContextManager());
 		/*
 		** Form a sorted array of the ResultColumns
 		*/
@@ -2632,7 +2613,7 @@ public class ResultColumnList extends Qu
 
 		for (int index = 0; index < cdlSize; index++)
 		{
-			cd = (ColumnDescriptor) cdl.elementAt(index);
+            cd = cdl.elementAt(index);
 
 			if ((posn < originalRCS.length) &&
 				(cd.getPosition() == originalRCS[posn].getColumnPosition()))
@@ -2672,7 +2653,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
+    void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
 				throws StandardException
 	{
 		if (bindingRCL == null)
@@ -2735,7 +2716,7 @@ public class ResultColumnList extends Qu
 	 * 
 	 * @return String	The 1st column name, if any, that is not in the list.
 	 */
-	public String verifyCreateConstraintColumnList(TableElementList tel)
+    String verifyCreateConstraintColumnList(TableElementList tel)
 	{
 		int size = size();
 
@@ -2756,7 +2737,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @param columnNames	String[] to hold the column names.
 	 */
-	public void exportNames(String[] columnNames)
+    void exportNames(String[] columnNames)
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -2787,7 +2768,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return ResultColumn	The parent ResultColumn
 	 */
-	public ResultColumn findParentResultColumn(ResultColumn childRC)
+    ResultColumn findParentResultColumn(ResultColumn childRC)
 	{
 		ResultColumn	parentRC = null;
 
@@ -2868,7 +2849,7 @@ public class ResultColumnList extends Qu
      * @param updateColumns     A list representing the columns
 	 *							to be updated.
 	 */
-	void markColumnsInSelectListUpdatableByCursor(List updateColumns)
+    void markColumnsInSelectListUpdatableByCursor(List<String> updateColumns)
 	{
 		commonCodeForUpdatableByCursor(updateColumns, true);
 	}
@@ -2885,13 +2866,14 @@ public class ResultColumnList extends Qu
 	 * list but we will not find updatable column c12 in the select column list
 	 */
     private void commonCodeForUpdatableByCursor(
-            List updateColumns, boolean dealingWithSelectResultColumnList)
+            List<String> updateColumns,
+            boolean dealingWithSelectResultColumnList)
 	{
 		/*
 		** If there is no update column list, or the list is empty, then it means that
 		** all the columns which have a base table associated with them are updatable.
 		*/
-		if ( (updateColumns == null) || (updateColumns.size() == 0) )
+        if ( (updateColumns == null) || (updateColumns.isEmpty()) )
 		{
 			markUpdatableByCursor();
 		}
@@ -2903,7 +2885,7 @@ public class ResultColumnList extends Qu
 
 			for (int index = 0; index < ucSize; index++)
 			{
-				columnName = (String) updateColumns.get(index);
+                columnName = updateColumns.get(index);
 
 				resultColumn = getResultColumn(columnName);
 				if (SanityManager.DEBUG)
@@ -2930,7 +2912,7 @@ public class ResultColumnList extends Qu
      * @param updateColumns     A list representing the columns
 	 *							to be updated.
 	 */
-	void markUpdatableByCursor(List updateColumns)
+    void markUpdatableByCursor(List<String> updateColumns)
 	{
 		commonCodeForUpdatableByCursor(updateColumns, false);
 	}
@@ -2955,7 +2937,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return boolean	Whether or not this RCL can be flattened out of a tree.
 	 */
-	public boolean isCloneable()
+    boolean isCloneable()
 	{
 		boolean retcode = true;
 		int size = size();
@@ -2980,7 +2962,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException			Thrown on error
 	 */
-	public void remapColumnReferencesToExpressions() throws StandardException
+    void remapColumnReferencesToExpressions() throws StandardException
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3020,7 +3002,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return boolean	Whether or not the type information is consistent
 	 */
-	public boolean hasConsistentTypeInfo() throws StandardException
+    boolean hasConsistentTypeInfo() throws StandardException
 	{
 		boolean isConsistent = true;
 
@@ -3060,7 +3042,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return Whether or not this RCL contains an AllResultColumn.
 	 */
-	public boolean containsAllResultColumn()
+    boolean containsAllResultColumn()
 	{
 		boolean	containsAllResultColumn = false;
 
@@ -3082,7 +3064,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return	The number of RCs in the list that are referenced.
 	 */
-	public int countReferencedColumns()
+    int countReferencedColumns()
 	{
 		int numReferenced = 0;
 
@@ -3104,7 +3086,7 @@ public class ResultColumnList extends Qu
 	 * @param idArray	int[] for column ids
 	 * @param basis		0 (for 0-based ids) or 1 (for 1-based ids)
 	 */
-	public void recordColumnReferences(int[] idArray, int basis)
+    void recordColumnReferences(int[] idArray, int basis)
 	{
 		int currArrayElement = 0;
 		int size = size();
@@ -3125,7 +3107,7 @@ public class ResultColumnList extends Qu
 	 * @param name       Name of the column
 	 * @param basis		0 (for 0-based ids) or 1 (for 1-based ids)
 	 */
-	public int getPosition( String name, int basis )
+    int getPosition( String name, int basis )
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3153,7 +3135,7 @@ public class ResultColumnList extends Qu
 	 * @param tableColMap	JBitSet[] for tables
 	 * @param tableNumber	Table number of column references
 	 */
-	public void recordColumnReferences(boolean[] colArray1, JBitSet[] tableColMap,
+    void recordColumnReferences(boolean[] colArray1, JBitSet[] tableColMap,
 			int tableNumber)
 	{
 		int size = size();
@@ -3216,7 +3198,7 @@ public class ResultColumnList extends Qu
 	 * Clear the column references from the RCL. (Restore RCL back to a state
 	 * where none of the RCs are marked as referenced.)
 	 */
-	public void clearColumnReferences()
+    void clearColumnReferences()
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3235,7 +3217,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @param targetList	The list to copy to
 	 */
-	public void copyReferencedColumnsToNewList(ResultColumnList targetList)
+    void copyReferencedColumnsToNewList(ResultColumnList targetList)
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3255,7 +3237,8 @@ public class ResultColumnList extends Qu
 	 * @param targetList	The list to copy to,
 	 * @param copyList      1 based bitMap we copy columns associated with set bits.
 	 */
-	public void copyColumnsToNewList(ResultColumnList targetList, FormatableBitSet copyList)
+    void copyColumnsToNewList(
+        ResultColumnList targetList, FormatableBitSet copyList)
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3274,7 +3257,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return the FormatableBitSet
 	 */
-	public FormatableBitSet getColumnReferenceMap()
+    FormatableBitSet getColumnReferenceMap()
 	{
 		FormatableBitSet colMap = new FormatableBitSet(size());
 		int size = size();
@@ -3304,7 +3287,7 @@ public class ResultColumnList extends Qu
         }
     } // end of pullVirtualIsReferenced
 
-	public void clearTableNames()
+    void clearTableNames()
 	{
 		int size = size();
 		for (int index = 0; index < size; index++)
@@ -3350,7 +3333,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return the size
 	 */
-	public int getTotalColumnSize()
+    int getTotalColumnSize()
 	{
 		int colSize = 0;
 		int size = size();
@@ -3371,7 +3354,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException			Thrown on error
 	 */
-	public void createListFromResultSetMetaData(ResultSetMetaData rsmd,
+    void createListFromResultSetMetaData(ResultSetMetaData rsmd,
 												TableName tableName,
 												String javaClassName)
 			throws StandardException
@@ -3463,24 +3446,19 @@ public class ResultColumnList extends Qu
 	}
 
     /** 
-     * Add a column to the list given a tablename, columnname, and datatype.
+     * Add a column to the list given a table name, column name, and data type.
      * Return the just-added column.
      *
      */
     public ResultColumn addColumn( TableName tableName, String columnName, DataTypeDescriptor dts )
         throws StandardException
     {
-        ValueNode bcn = (ValueNode) getNodeFactory().getNode(
-                                                             C_NodeTypes.BASE_COLUMN_NODE,
-                                                             columnName,
-                                                             tableName,
-                                                             dts,
-                                                             getContextManager());
-        ResultColumn rc = (ResultColumn) getNodeFactory().getNode(
-                                                                  C_NodeTypes.RESULT_COLUMN,
-                                                                  columnName,
-                                                                  bcn,
-                                                                  getContextManager());
+        ValueNode bcn = new BaseColumnNode(columnName,
+                                           tableName,
+                                           dts,
+                                           getContextManager());
+        ResultColumn rc =
+                new ResultColumn(columnName, bcn, getContextManager());
         rc.setType(dts);
         addResultColumn(rc);
 
@@ -3496,22 +3474,16 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException			Thrown on error
 	 */
-	public void addRCForRID()
+    void addRCForRID()
 		throws StandardException
 	{
 		ResultColumn		rowLocationColumn;
 		CurrentRowLocationNode		rowLocationNode;
 
 		/* Generate the RowLocation column */
-		rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode(
-										C_NodeTypes.CURRENT_ROW_LOCATION_NODE,
-										getContextManager());
+        rowLocationNode = new CurrentRowLocationNode(getContextManager());
 		rowLocationColumn =
-				(ResultColumn) getNodeFactory().getNode(
-									C_NodeTypes.RESULT_COLUMN,
-									"",
-									rowLocationNode,
-									getContextManager());
+               new ResultColumn("", rowLocationNode, getContextManager());
 		rowLocationColumn.markGenerated();
 
 		/* Append to the ResultColumnList */
@@ -3526,7 +3498,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void markAllUnreferenced()
+    void markAllUnreferenced()
 				throws StandardException
 	{
 		int size = size();
@@ -3683,7 +3655,7 @@ public class ResultColumnList extends Qu
 
 	/** Set the nullability of every ResultColumn in this list 
 	 * @throws StandardException */
-	public void setNullability(boolean nullability) throws StandardException
+    void setNullability(boolean nullability) throws StandardException
 	{
 		int size = size();
 
@@ -3801,9 +3773,7 @@ public class ResultColumnList extends Qu
 			return this;
 		}
 	
-		ResultColumnList newCols = (ResultColumnList) getNodeFactory().getNode(
-												C_NodeTypes.RESULT_COLUMN_LIST,
-												getContextManager());
+        ResultColumnList newCols = new ResultColumnList(getContextManager());
 
 		int size = size();
 		for (index = 0; index < size; index++)
@@ -3873,7 +3843,7 @@ public class ResultColumnList extends Qu
 	ResultColumnList getJoinColumns(ResultColumnList joinColumns)
             throws StandardException
 	{
-		ResultColumnList	newRCL = new ResultColumnList();
+        ResultColumnList    newRCL = new ResultColumnList(getContextManager());
 
 		/* Find all of the join columns and put them 1st on the
 		 * new RCL.
@@ -3954,7 +3924,7 @@ public class ResultColumnList extends Qu
 	 *
 	 *	@exception	throws StandardException on error
 	 */
-	public int[] getColumnPositions( TableDescriptor td )
+    int[] getColumnPositions( TableDescriptor td )
 		throws StandardException
 	{
 		int 				size = size();
@@ -3986,7 +3956,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return the array of strings
 	 */
-	public String[] getColumnNames()
+    String[] getColumnNames()
 	{
 		String strings[] = new String[size()];
 
@@ -4079,9 +4049,7 @@ public class ResultColumnList extends Qu
 				else
 				{
 					rc.setExpression(
-						(ValueNode) getNodeFactory().getNode(
-										C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
-										getContextManager()));
+                            new UntypedNullConstantNode(getContextManager()));
                     rc.setWasDefaultColumn( true );
 				}
                 rc.setDefaultColumn(false);
@@ -4153,7 +4121,6 @@ public class ResultColumnList extends Qu
 		if ( columnIDs == null ) { return; }
 
 		int						count = columnIDs.length;
-		TableName				tableName = makeTableName( table.getSchemaName(), table.getName() );
 		String					columnName;
 		int						columnPosition;
 		ResultColumn			rc;
@@ -4173,15 +4140,7 @@ public class ResultColumnList extends Qu
 	private	ResultColumn	makeColumnFromName( String columnName )
 		throws StandardException
 	{
-		ResultColumn	resultColumn = (ResultColumn) getNodeFactory().getNode
-			(
-				C_NodeTypes.RESULT_COLUMN,
-				columnName,
-				null,
-				getContextManager()
-			);
-
-		return resultColumn;
+       return new ResultColumn(columnName, null, getContextManager());
 	}
 
 	private	ResultColumn	makeColumnReferenceFromName
@@ -4192,19 +4151,10 @@ public class ResultColumnList extends Qu
 		throws StandardException
 	{
 		ContextManager	cm = getContextManager();
-		NodeFactory		nodeFactory = getNodeFactory();
 
-		ResultColumn	rc = (ResultColumn) nodeFactory.getNode
-			(
-				C_NodeTypes.RESULT_COLUMN,
+        ResultColumn rc = new ResultColumn(
 				columnName,
-				nodeFactory.getNode
-				(
-					C_NodeTypes.COLUMN_REFERENCE,
-					columnName,
-					tableName,
-					cm
-				),
+                new ColumnReference(columnName, tableName, cm),
 				cm
 			);
 
@@ -4218,7 +4168,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @exception StandardException		If the column is an ai column
 	 */
-	public void forbidOverrides(ResultColumnList sourceRSRCL)
+    void forbidOverrides(ResultColumnList sourceRSRCL)
 		throws StandardException
 	{
 		int size = size();
@@ -4256,7 +4206,7 @@ public class ResultColumnList extends Qu
 		}
 	}
 
-	public void incOrderBySelect()
+    void incOrderBySelect()
 	{
 		orderBySelect++;
 	}
@@ -4266,7 +4216,7 @@ public class ResultColumnList extends Qu
 		orderBySelect--;
 	}
 
-	public int getOrderBySelect()
+    int getOrderBySelect()
 	{
 		return orderBySelect;
 	}
@@ -4349,7 +4299,7 @@ public class ResultColumnList extends Qu
 	 * During compilation we can add columns for a group by/order by but these
 	 * to an RCL but these are projected out during query execution. 
 	 */
-	public int visibleSize() 
+    int visibleSize()
 	{
 		return size() - orderBySelect - numGeneratedColumns();
 	}
@@ -4360,6 +4310,7 @@ public class ResultColumnList extends Qu
 	 *
 	 * @return	This object as a String
 	 */
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG) {
@@ -4397,8 +4348,7 @@ public class ResultColumnList extends Qu
         mapArray[index] = vcId;
 
         if (streamableType(rc)) {
-            Integer seenIndex =
-                (Integer)seenMap.get(new Integer(vcId));
+            Integer seenIndex = seenMap.get(Integer.valueOf(vcId));
 
             if (seenIndex != null) {
                 // We have already mapped this column at index

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/ResultSetNode.java Fri Jun 21 07:47:47 2013
@@ -21,44 +21,36 @@
 
 package	org.apache.derby.impl.sql.compile;
 
+import java.util.List;
+import java.util.Set;
+import org.apache.derby.catalog.types.DefaultInfoImpl;
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.services.classfile.VMOpcode;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.ResultColumnDescriptor;
+import org.apache.derby.iapi.sql.ResultDescription;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.compile.CostEstimate;
-import org.apache.derby.iapi.sql.compile.OptimizerFactory;
-import org.apache.derby.iapi.sql.compile.Optimizer;
 import org.apache.derby.iapi.sql.compile.OptimizableList;
 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
+import org.apache.derby.iapi.sql.compile.Optimizer;
+import org.apache.derby.iapi.sql.compile.OptimizerFactory;
 import org.apache.derby.iapi.sql.compile.Parser;
+import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
 import org.apache.derby.iapi.sql.compile.Visitable;
 import org.apache.derby.iapi.sql.compile.Visitor;
-import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.DefaultDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-
-import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.sql.ResultColumnDescriptor;
-import org.apache.derby.iapi.sql.ResultDescription;
-
 import org.apache.derby.iapi.store.access.TransactionController;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.reference.ClassName;
-
-import org.apache.derby.iapi.services.compiler.MethodBuilder;
-
+import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.iapi.util.JBitSet;
-import org.apache.derby.iapi.services.classfile.VMOpcode;
-
-import org.apache.derby.catalog.types.DefaultInfoImpl;
-
-import java.util.List;
-import java.util.Set;
 
 /**
  * A ResultSetNode represents a result set, that is, a set of rows.  It is
@@ -87,13 +79,17 @@ public abstract class ResultSetNode exte
 	// query. Subclasses will set this value where appropriate.
 	CostEstimate		finalCostEstimate;
 
-	/**
-	 * Convert this object to a String.  See comments in QueryTreeNode.java
-	 * for how this should be done for tree printing.
-	 *
-	 * @return	This object as a String
-	 */
+    ResultSetNode(ContextManager cm) {
+        super(cm);
+    }
 
+    /**
+     * Convert this object to a String.  See comments in QueryTreeNode.java
+     * for how this should be done for tree printing.
+     *
+     * @return  This object as a String
+     */
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -119,7 +115,7 @@ public abstract class ResultSetNode exte
 	 * @param depth		The depth of this node in the tree
 	 */
 
-	public void printSubNodes(int depth)
+    void printSubNodes(int depth)
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -150,7 +146,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return	The CostEstimate for this ResultSetNode.
 	 */
-	public CostEstimate getCostEstimate()
+    CostEstimate getCostEstimate()
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -169,7 +165,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return	The final CostEstimate for this ResultSetNode.
 	 */
-	public CostEstimate getFinalCostEstimate()
+    CostEstimate getFinalCostEstimate()
 		throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -191,7 +187,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public void assignResultSetNumber() throws StandardException
+    void assignResultSetNumber() throws StandardException
 	{
 		resultSetNumber = getCompilerContext().getNextResultSetNumber();
 		resultColumns.setResultSetNumber(resultSetNumber);
@@ -209,7 +205,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, 
+    ResultSetNode bindNonVTITables(DataDictionary dataDictionary,
 							FromList fromListParam) 
 							throws StandardException {
 		return this;
@@ -227,7 +223,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultSetNode bindVTITables(FromList fromListParam) 
+    ResultSetNode bindVTITables(FromList fromListParam)
 		throws StandardException {
 		return this;
 	}
@@ -241,7 +237,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindExpressions(FromList fromListParam)
+    void bindExpressions(FromList fromListParam)
 					throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -259,7 +255,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindExpressionsWithTables(FromList fromListParam)
+    void bindExpressionsWithTables(FromList fromListParam)
 					throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -278,7 +274,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public void bindTargetExpressions(FromList fromListParam)
+    void bindTargetExpressions(FromList fromListParam)
 					throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -315,7 +311,7 @@ public abstract class ResultSetNode exte
 	/**
 	 * Remember that this node is the source result set for an INSERT.
 	 */
-	public void setInsertSource()
+    void setInsertSource()
 	{
 		insertSource = true;
 	}
@@ -328,7 +324,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void verifySelectStarSubquery(FromList outerFromList, int subqueryType)
+    void verifySelectStarSubquery(FromList outerFromList, int subqueryType)
 					throws StandardException
 {
 		if (SanityManager.DEBUG)
@@ -349,7 +345,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultColumnList getAllResultColumns(TableName allTableName)
+    ResultColumnList getAllResultColumns(TableName allTableName)
 					throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -372,7 +368,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultColumn getMatchingColumn(
+    ResultColumn getMatchingColumn(
 						ColumnReference columnReference)
 						throws StandardException
 	{
@@ -399,10 +395,9 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode setResultToBooleanTrueNode(boolean onlyConvertAlls)
+    ResultSetNode setResultToBooleanTrueNode(boolean onlyConvertAlls)
 		throws StandardException
 	{
-		BooleanConstantNode	booleanNode;
 		ResultColumn		resultColumn;
 
 		/* We need to be able to handle both ResultColumn and AllResultColumn
@@ -410,11 +405,7 @@ public abstract class ResultSetNode exte
 		 */
 		if (resultColumns.elementAt(0) instanceof AllResultColumn)
 		{
-			resultColumn = (ResultColumn) getNodeFactory().getNode(
-												C_NodeTypes.RESULT_COLUMN,
-												"",
-												null,
-												getContextManager());
+           resultColumn = new ResultColumn("", null, getContextManager());
 		}
 		else if (onlyConvertAlls)
 		{
@@ -432,10 +423,8 @@ public abstract class ResultSetNode exte
 			}
 		}
 		
-		booleanNode = (BooleanConstantNode) getNodeFactory().getNode(
-										C_NodeTypes.BOOLEAN_CONSTANT_NODE,
-										Boolean.TRUE,
-										getContextManager());
+       BooleanConstantNode booleanNode =
+                new BooleanConstantNode(true, getContextManager());
 
 		resultColumn.setExpression(booleanNode);
 		resultColumn.setType(booleanNode.getTypeServices());
@@ -455,13 +444,11 @@ public abstract class ResultSetNode exte
 	 * @return FromList
 	 * @exception StandardException		Thrown on error
 	 */
-	public FromList getFromList()
+    FromList getFromList()
 		throws StandardException
 	{
-		return (FromList) getNodeFactory().getNode(
-									C_NodeTypes.FROM_LIST,
-									getNodeFactory().doJoinOrderOptimization(),
-									getContextManager());
+        return new FromList(getOptimizerFactory().doJoinOrderOptimization(),
+                            getContextManager());
 	}
 
 	/**
@@ -475,7 +462,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public void bindResultColumns(FromList fromListParam)
+    void bindResultColumns(FromList fromListParam)
 				throws StandardException
 	{
 		resultColumns.bindResultColumnsToExpressions();
@@ -534,7 +521,7 @@ public abstract class ResultSetNode exte
 			if (targetTableDescriptor != null)
 			{
 				resultColumns.bindResultColumnsByName(
-						targetTableDescriptor, (DMLStatementNode)statement);
+                        targetTableDescriptor, statement);
 			}
 			else
 			{
@@ -556,10 +543,9 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void bindUntypedNullsToResultColumns(ResultColumnList rcl)
+    void bindUntypedNullsToResultColumns(ResultColumnList rcl)
 				throws StandardException
 	{
-		return;
 	}
 
 	/**
@@ -581,7 +567,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultSetNode preprocess(int numTables,
+    ResultSetNode preprocess(int numTables,
 									GroupByList gbl,
 									FromList fromList)
 								throws StandardException
@@ -608,7 +594,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode ensurePredicateList(int numTables) 
+    ResultSetNode ensurePredicateList(int numTables)
 		throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -628,7 +614,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode addNewPredicate(Predicate predicate)
+    ResultSetNode addNewPredicate(Predicate predicate)
 			throws StandardException
 	{
 		if (SanityManager.DEBUG)
@@ -649,7 +635,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return boolean	Whether or not the FromSubquery is flattenable.
 	 */
-	public boolean flattenableInFromSubquery(FromList fromList)
+    boolean flattenableInFromSubquery(FromList fromList)
 	{
 		if (SanityManager.DEBUG)
 		SanityManager.THROWASSERT(
@@ -685,8 +671,7 @@ public abstract class ResultSetNode exte
 		 */
 		prRCList.genVirtualColumnNodes(this, resultColumns, false);
 		/* Finally, we create the new ProjectRestrictNode */
-		return (ResultSetNode) getNodeFactory().getNode(
-								C_NodeTypes.PROJECT_RESTRICT_NODE,
+        return new ProjectRestrictNode(
 								this,
 								prRCList,
 								null,	/* Restriction */
@@ -715,7 +700,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultSetNode optimize(DataDictionary dataDictionary,
+    ResultSetNode optimize(DataDictionary dataDictionary,
 								  PredicateList predicates,
 								  double outerRows) 
 				throws StandardException	
@@ -736,7 +721,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode modifyAccessPaths() throws StandardException
+    ResultSetNode modifyAccessPaths() throws StandardException
 	{
 		/* Default behavior is to do nothing */
 		return this;
@@ -752,7 +737,7 @@ public abstract class ResultSetNode exte
 	 * @return The modified query tree
 	 * @exception StandardException        Thrown on error
 	 */
-	public ResultSetNode modifyAccessPaths(PredicateList predList)
+    ResultSetNode modifyAccessPaths(PredicateList predList)
 		throws StandardException
 	{
 		// Default behavior is to call the no-arg version of this method.
@@ -787,7 +772,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @param newRCL		The new ResultColumnList for this ResultSetNode
 	 */
-	public void setResultColumns(ResultColumnList newRCL)
+    void setResultColumns(ResultColumnList newRCL)
 	{
 		resultColumns = newRCL;
 	}
@@ -797,7 +782,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return ResultColumnList for this ResultSetNode
 	 */
-	public ResultColumnList getResultColumns()
+    ResultColumnList getResultColumns()
 	{
 		return resultColumns;
 	}
@@ -807,7 +792,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @param newRTM	The new referencedTableMap for this ResultSetNode
 	 */
-	public void setReferencedTableMap(JBitSet newRTM)
+    void setReferencedTableMap(JBitSet newRTM)
 	{
 		referencedTableMap = newRTM;
 	}
@@ -827,7 +812,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @param passedMap	The table map to fill in.
 	 */
-	public void fillInReferencedTableMap(JBitSet passedMap)
+    void fillInReferencedTableMap(JBitSet passedMap)
 	{
 	}
 
@@ -839,7 +824,7 @@ public abstract class ResultSetNode exte
 	 *									directly under a ResultColumn
 	 */
 
-	public void rejectParameters() throws StandardException
+    void rejectParameters() throws StandardException
 	{
 		/* Okay if no resultColumns yet - means no parameters there */
 		if (resultColumns != null)
@@ -858,7 +843,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown if an XML value found
 	 *									directly under a ResultColumn
 	 */
-	public void rejectXMLValues() throws StandardException
+    void rejectXMLValues() throws StandardException
 	{
 		if (resultColumns != null)
 		{
@@ -870,7 +855,7 @@ public abstract class ResultSetNode exte
 	 * Rename generated result column names as '1', '2' etc... These will be the result
 	 * column names seen by JDBC clients.
 	 */
-	public void renameGeneratedResultNames() throws StandardException
+    void renameGeneratedResultNames() throws StandardException
 	{
 		for (int i=0; i<resultColumns.size(); i++)
 		{
@@ -885,7 +870,7 @@ public abstract class ResultSetNode exte
 		if it is the one controlling the statement -- i.e., it is
 		the outermost result set node for the statement.
 	 */
-	public void markStatementResultSet()
+    void markStatementResultSet()
 	{
 		statementResultSet = true;
 	}
@@ -933,10 +918,8 @@ public abstract class ResultSetNode exte
 			throws StandardException
 	{
 		// our newResultCols are put into the bound form straight away.
-		ResultColumnList newResultCols =
-							(ResultColumnList) getNodeFactory().getNode(
-												C_NodeTypes.RESULT_COLUMN_LIST,
-												getContextManager());
+        ResultColumnList
+                newResultCols = new ResultColumnList(getContextManager());
 
 		/* Create a massaged version of the source RCL.
 		 * (Much simpler to build new list and then assign to source,
@@ -945,7 +928,7 @@ public abstract class ResultSetNode exte
 		int numTargetColumns = target.resultColumnList.size();
 		for (int index = 0; index < numTargetColumns; index++)
 		{
-			ResultColumn	newResultColumn = null;
+            ResultColumn newResultColumn;
 
 			if (colMap[index] != -1)
 			{
@@ -985,7 +968,7 @@ public abstract class ResultSetNode exte
 								   DataDictionary dataDictionary)
 		throws StandardException
 	{
-		ResultColumn newResultColumn = null;
+        ResultColumn newResultColumn;
 
 		// the i-th column's value was not specified, so create an
 		// expression containing its default value (null for now)
@@ -1031,8 +1014,10 @@ public abstract class ResultSetNode exte
                         ValueNode defaultTree = parseDefault(defaultText);
                         defaultTree = defaultTree.bindExpression
                             (getFromList(), (SubqueryList) null, (List<AggregateNode>) null);
-                        newResultColumn = (ResultColumn) getNodeFactory().getNode
-                            ( C_NodeTypes.RESULT_COLUMN, defaultTree.getTypeServices(), defaultTree, getContextManager());
+                        newResultColumn = new ResultColumn(
+                                defaultTree.getTypeServices(),
+                                defaultTree,
+                                getContextManager());
                     }
 
                     DefaultDescriptor defaultDescriptor = colDesc.getDefaultDescriptor(dataDictionary);
@@ -1046,21 +1031,14 @@ public abstract class ResultSetNode exte
             }
             else if (colDesc.isAutoincrement())
             {
-                newResultColumn = 
-                  (ResultColumn)getNodeFactory().getNode(
-                      C_NodeTypes.RESULT_COLUMN,
-                      colDesc, null,
-                      getContextManager());
+                newResultColumn =
+                        new ResultColumn(colDesc, null, getContextManager());
                 newResultColumn.setAutoincrementGenerated();
             }
             else
             {
-                newResultColumn = (ResultColumn) getNodeFactory().getNode(
-                    C_NodeTypes.RESULT_COLUMN,
-                    colType,
-                    getNullNode(colType),
-                    getContextManager()
-                    );
+                newResultColumn = new ResultColumn(
+                        colType, getNullNode(colType), getContextManager());
             }
         }
 
@@ -1086,10 +1064,8 @@ public abstract class ResultSetNode exte
 		throws StandardException
 	{
 		// our newResultCols are put into the bound form straight away.
-		ResultColumnList newResultCols =
-								(ResultColumnList) getNodeFactory().getNode(
-												C_NodeTypes.RESULT_COLUMN_LIST,
-												getContextManager());
+        ResultColumnList
+                newResultCols = new ResultColumnList(getContextManager());
 
 		int numTargetColumns = target.resultColumnList.size();
 
@@ -1110,11 +1086,9 @@ public abstract class ResultSetNode exte
 				oldResultColumn =
 						resultColumns.getResultColumn(colMap[index] + 1);
 
-				newColumnReference = (ColumnReference) getNodeFactory().getNode(
-												C_NodeTypes.COLUMN_REFERENCE,
-												oldResultColumn.getName(),
-												null,
-												getContextManager());
+                newColumnReference = new ColumnReference(
+                        oldResultColumn.getName(), null, getContextManager());
+
 				/* The ColumnReference points to the source of the value */
 				newColumnReference.setSource(oldResultColumn);
 				// colMap entry is 0-based, columnId is 1-based.
@@ -1128,8 +1102,7 @@ public abstract class ResultSetNode exte
 				// column descriptors into the result, we grab it from there.
 				// alternatively, we could do what the else clause does,
 				// and look it up in the DD again.
-				newResultColumn = (ResultColumn) getNodeFactory().getNode(
-						C_NodeTypes.RESULT_COLUMN,
+               newResultColumn = new ResultColumn(
 						oldResultColumn.getType(),
 						newColumnReference,
 						getContextManager());
@@ -1155,16 +1128,14 @@ public abstract class ResultSetNode exte
 		 *		   top of the query tree which has ColumnReferences under
 		 *		   its ResultColumnList prior to expression push down.
 		 */
-		return (ResultSetNode) getNodeFactory().getNode(
-									C_NodeTypes.PROJECT_RESTRICT_NODE,
-									this,
-									newResultCols,
-									null,
-									null,
-									null,
-									null,
-									null,
-									getContextManager());
+        return new ProjectRestrictNode(this,
+                                       newResultCols,
+                                       null,
+                                       null,
+                                       null,
+                                       null,
+                                       null,
+                                       getContextManager());
 	}
 
 	/**
@@ -1177,10 +1148,9 @@ public abstract class ResultSetNode exte
          )
         throws StandardException
     {
-        ValueNode       dummy = (ValueNode) getNodeFactory().getNode
-            ( C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE, getContextManager());
-        ResultColumn    newResultColumn = (ResultColumn) getNodeFactory().getNode
-            ( C_NodeTypes.RESULT_COLUMN, colDesc.getType(), dummy, getContextManager());
+        ValueNode dummy = new UntypedNullConstantNode(getContextManager());
+        ResultColumn newResultColumn =
+            new ResultColumn(colDesc.getType(), dummy, getContextManager());
         newResultColumn.setColumnDescriptor( targetTD, colDesc );
 
         return newResultColumn;
@@ -1204,7 +1174,6 @@ public abstract class ResultSetNode exte
 		Parser						p;
 		ValueNode					defaultTree;
 		LanguageConnectionContext	lcc = getLanguageConnectionContext();
-		CompilerContext 			compilerContext = getCompilerContext();
 
 		/* Get a Statement to pass to the parser */
 
@@ -1295,7 +1264,7 @@ public abstract class ResultSetNode exte
 		cursor.  Most types of ResultSetNode can't be target tables.
 		@return true if the target table supports positioned updates.
 	 */
-	public boolean markAsCursorTargetTable()
+    boolean markAsCursorTargetTable()
 	{
 		return false;
 	}
@@ -1331,7 +1300,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public ResultSetNode genProjectRestrict()
+    ResultSetNode genProjectRestrict()
 				throws StandardException
 	{
 		/* We get a shallow copy of the ResultColumnList and its 
@@ -1347,8 +1316,7 @@ public abstract class ResultSetNode exte
 		prRCList.genVirtualColumnNodes(this, resultColumns);
 
 		/* Finally, we create the new ProjectRestrictNode */
-		return (ResultSetNode) getNodeFactory().getNode(
-								C_NodeTypes.PROJECT_RESTRICT_NODE,
+        return new ProjectRestrictNode(
 								this,
 								prRCList,
 								null,	/* Restriction */
@@ -1356,7 +1324,7 @@ public abstract class ResultSetNode exte
 								null,	/* Project subquery list */
 								null,	/* Restrict subquery list */
 								null,
-								getContextManager()				 );
+                                getContextManager());
 	}
 
 	/** 
@@ -1382,7 +1350,7 @@ public abstract class ResultSetNode exte
 	 * @exception StandardException		Thrown on error
 	 */
 
-	protected ResultSetNode genProjectRestrict(int numTables)
+    ResultSetNode genProjectRestrict(int numTables)
 				throws StandardException
 	{
 		return genProjectRestrict();
@@ -1442,7 +1410,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode changeAccessPath() throws StandardException
+    ResultSetNode changeAccessPath() throws StandardException
 	{
 		return this;
 	}
@@ -1457,7 +1425,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public boolean referencesTarget(String name, boolean baseTable)
+    boolean referencesTarget(String name, boolean baseTable)
 		throws StandardException
 	{
 		return false;
@@ -1488,7 +1456,7 @@ public abstract class ResultSetNode exte
 	 * @return Whether or not the underlying ResultSet tree will return a single row.
 	 * @exception StandardException		Thrown on error
 	 */
-	public boolean isOneRowResultSet()	throws StandardException
+    boolean isOneRowResultSet() throws StandardException
 	{
 		// Default is false
 		return false;
@@ -1500,7 +1468,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return Whether or not the underlying ResultSet tree if for NOT EXISTS.
 	 */
-	public boolean isNotExists()
+    boolean isNotExists()
 	{
 		// Default is false
 		return false;
@@ -1574,6 +1542,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException on error
 	 */
+    @Override
 	void acceptChildren(Visitor v)
 		throws StandardException
 	{
@@ -1593,7 +1562,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public ResultSetNode considerMaterialization(JBitSet outerTables)
+    ResultSetNode considerMaterialization(JBitSet outerTables)
 		throws StandardException
 	{
 		return this;
@@ -1607,7 +1576,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public boolean performMaterialization(JBitSet outerTables)
+    boolean performMaterialization(JBitSet outerTables)
 		throws StandardException
 	{
 		return false;
@@ -1715,7 +1684,7 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return	The lock mode
 	 */
-	public int updateTargetLockMode()
+    int updateTargetLockMode()
 	{
 		return TransactionController.MODE_TABLE;
 	}
@@ -1791,7 +1760,7 @@ public abstract class ResultSetNode exte
 	 * @param distinctColumns the set of distinct columns
 	 * @return Whether or not it is possible to do a distinct scan on this ResultSet tree.
 	 */
-	boolean isPossibleDistinctScan(Set distinctColumns)
+    boolean isPossibleDistinctScan(Set<BaseColumnNode> distinctColumns)
 	{
 		return false;
 	}
@@ -1867,14 +1836,14 @@ public abstract class ResultSetNode exte
 	 *
 	 * @return number of aggregates
 	 */
-    static int numDistinctAggregates(List aggregates)
+    static int numDistinctAggregates(List<AggregateNode> aggregates)
 	{
 		int		count = 0;
         int     size = aggregates.size();
 
 		for (int index = 0; index < size; index++)
 		{
-            if (((AggregateNode) aggregates.get(index)).isDistinct()) {
+            if ((aggregates.get(index)).isDistinct()) {
                 count++;
             }
 		}
@@ -1884,7 +1853,7 @@ public abstract class ResultSetNode exte
 
 	// It may be we have a SELECT view underneath a LOJ.
 	// Return null for now.. we don't do any optimization.
-	public JBitSet LOJgetReferencedTables(int numTables)
+    JBitSet LOJgetReferencedTables(int numTables)
 				throws StandardException
 	{
 		if (this instanceof FromTable)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeNode.java Fri Jun 21 07:47:47 2013
@@ -21,23 +21,39 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.depend.Provider;
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.impl.sql.execute.PrivilegeInfo;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.error.StandardException;
-
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.sql.depend.Provider;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
 
 /**
  * This class represents a REVOKE statement.
  */
-public class RevokeNode extends DDLStatementNode
+class RevokeNode extends DDLStatementNode
 {
     private PrivilegeNode privileges;
-    private List grantees;
+    private List<String> grantees;
+
+    /**
+     * Construct a RevokeNode.
+     *
+     * @param privileges PrivilegesNode
+     * @param grantees List
+     * @param cm Context manager
+     */
+    RevokeNode(PrivilegeNode privileges,
+                          List<String> grantees,
+                          ContextManager cm)
+    {
+        super(cm);
+        setNodeType(C_NodeTypes.REVOKE_NODE);
+        this.privileges = privileges;
+        this.grantees = grantees;
+    }
 
 	/**
 	 * Convert this object to a String.  See comments in QueryTreeNode.java
@@ -45,17 +61,17 @@ public class RevokeNode extends DDLState
 	 *
 	 * @return	This object as a String
 	 */
-
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
 		{
-            StringBuffer sb = new StringBuffer();
-            for( Iterator it = grantees.iterator(); it.hasNext();)
-            {
+            StringBuilder sb = new StringBuilder();
+
+            for(String grantee : grantees) {
                 if( sb.length() > 0)
                     sb.append( ",");
-                sb.append( it.next().toString());
+                sb.append(grantee);
             }
 			return super.toString() +
                    privileges.toString() +
@@ -67,31 +83,18 @@ public class RevokeNode extends DDLState
 		}
     } // end of toString
 
-	public String statementToString()
+    String statementToString()
 	{
         return "REVOKE";
     }
 
-    
-    /**
-     * Initialize a RevokeNode.
-     *
-     * @param privileges PrivilegesNode
-     * @param grantees List
-     */
-    public void init( Object privileges,
-                      Object grantees)
-    {
-        this.privileges = (PrivilegeNode) privileges;
-        this.grantees = (List) grantees;
-    }
-
     /**
      * Bind this RevokeNode. Resolve all table, column, and routine references.
      *
      *
      * @exception StandardException	Standard error policy.
      */
+    @Override
 	public void bindStatement() throws StandardException
 	{
         privileges = (PrivilegeNode) privileges.bind( new HashMap<Provider,Provider>(), grantees, false);
@@ -103,6 +106,7 @@ public class RevokeNode extends DDLState
 	 *
 	 * @exception StandardException	Standard error policy.
 	 */
+    @Override
 	public ConstantAction makeConstantAction() throws StandardException
 	{
         return getGenericConstantActionFactory().getRevokeConstantAction( privileges.makePrivilegeInfo(),

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeRoleNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeRoleNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeRoleNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RevokeRoleNode.java Fri Jun 21 07:47:47 2013
@@ -21,34 +21,37 @@
 
 package org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.error.StandardException;
-
 import java.util.Iterator;
 import java.util.List;
-import org.apache.derby.iapi.sql.compile.CompilerContext;
-import org.apache.derby.iapi.sql.conn.Authorizer;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
 
 /**
  * This class represents a REVOKE role statement.
  */
-public class RevokeRoleNode extends DDLStatementNode
+class RevokeRoleNode extends DDLStatementNode
 {
-	private List roles;
-	private List grantees;
+    private List<String> roles;
+    private List<String> grantees;
 
 	/**
-	 * Initialize a RevokeRoleNode.
+     * Construct a RevokeRoleNode.
 	 *
 	 * @param roles list of strings containing role name to be revoked
 	 * @param grantees list of strings containing grantee names
+     * @param cm context manager
 	 */
-	public void init(Object roles, Object grantees) throws StandardException
+    RevokeRoleNode( List<String> roles,
+                    List<String> grantees,
+                    ContextManager cm) throws StandardException
 	{
-		initAndCheck(null);
-		this.roles = (List) roles;
-		this.grantees = (List) grantees;
+        super(cm);
+        setNodeType(C_NodeTypes.REVOKE_ROLE_NODE);
+        this.roles = roles;
+        this.grantees = grantees;
 	}
 
 
@@ -57,6 +60,7 @@ public class RevokeRoleNode extends DDLS
 	 *
 	 * @exception StandardException Standard error policy.
 	 */
+    @Override
 	public ConstantAction makeConstantAction() throws StandardException
 	{
 		return getGenericConstantActionFactory().
@@ -69,11 +73,11 @@ public class RevokeRoleNode extends DDLS
 	 *
 	 * @return	This object as a String
 	 */
-
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG) {
-			StringBuffer sb1 = new StringBuffer();
+            StringBuilder sb1 = new StringBuilder();
 			for( Iterator it = roles.iterator(); it.hasNext();) {
 				if( sb1.length() > 0) {
 					sb1.append( ", ");
@@ -81,7 +85,7 @@ public class RevokeRoleNode extends DDLS
 				sb1.append( it.next().toString());
 			}
 
-			StringBuffer sb2 = new StringBuffer();
+            StringBuilder sb2 = new StringBuilder();
 			for( Iterator it = grantees.iterator(); it.hasNext();) {
 				if( sb2.length() > 0) {
 					sb2.append( ", ");
@@ -99,7 +103,7 @@ public class RevokeRoleNode extends DDLS
 	} // end of toString
 
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "REVOKE role";
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RoutineDesignator.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RoutineDesignator.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RoutineDesignator.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RoutineDesignator.java Fri Jun 21 07:47:47 2013
@@ -21,20 +21,17 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.error.StandardException;
-
+import java.util.List;
+import org.apache.derby.catalog.TypeDescriptor;
+import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;
 import org.apache.derby.impl.sql.execute.PrivilegeInfo;
 import org.apache.derby.impl.sql.execute.RoutinePrivilegeInfo;
-import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;
-
-import java.util.List;
 
 /**
  * This node represents a routine signature.
  */
 class RoutineDesignator
 {
-	boolean isSpecific;
 	TableName name; // TableName is a misnomer it is really just a schema qualified name
 	boolean isFunction; // else a procedure
 	/**
@@ -42,15 +39,13 @@ class RoutineDesignator
 	 * if null then the signature is not specified and this designator is ambiguous if there is
 	 * more than one function (procedure) with this name.
 	 */
-	List paramTypeList;
+    List<TypeDescriptor> paramTypeList;
 	AliasDescriptor aliasDescriptor;
 
-	RoutineDesignator( boolean isSpecific,
-							  TableName name,
-							  boolean isFunction,
-							  List paramTypeList)
+    RoutineDesignator( TableName name,
+                       boolean isFunction,
+                       List<TypeDescriptor> paramTypeList)
 	{
-		this.isSpecific = isSpecific;
 		this.name = name;
 		this.isFunction = isFunction;
 		this.paramTypeList = paramTypeList;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowCountNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowCountNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowCountNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowCountNode.java Fri Jun 21 07:47:47 2013
@@ -26,6 +26,8 @@ import org.apache.derby.iapi.services.co
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.services.classfile.VMOpcode;
 import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 
 /**
  * The result set generated by this node (RowCountResultSet) implements the
@@ -52,23 +54,37 @@ public final class RowCountNode extends 
 
 
     /**
-     * Initializer for a RowCountNode
+     * Constructor for a RowCountNode
      *
      * @exception StandardException
      */
-    public void init(Object childResult,
-                     Object rcl,
-                     Object offset,
-                     Object fetchFirst,
-                     Object hasJDBClimitClause)
-        throws StandardException {
 
-        init(childResult, null);
-        resultColumns = (ResultColumnList) rcl;
+    /**
+     * Constructor for a RowCountNode
+     * @param childResult        The result set for which we want to get
+     *                           only a subset
+     * @param rcl                The result columns we want
+     * @param offset             The offset, if any, in the result set
+     * @param fetchFirst         The number of rows to inspect to get
+     * @param hasJDBClimitClause {@true} if a JDBC limit syntax was used
+     * @param cm                 The context manager
+     * @throws StandardException
+     */
+    RowCountNode(ResultSetNode    childResult,
+                 ResultColumnList rcl,
+                 ValueNode        offset,
+                 ValueNode        fetchFirst,
+                 boolean          hasJDBClimitClause,
+                 ContextManager   cm)
+        throws StandardException {
 
-        this.offset = (ValueNode)offset;
-        this.fetchFirst = (ValueNode)fetchFirst;
-        this.hasJDBClimitClause = (hasJDBClimitClause == null) ? false : ((Boolean) hasJDBClimitClause).booleanValue();
+        super(childResult, null, cm);
+        setNodeType(C_NodeTypes.ROW_COUNT_NODE);
+        resultColumns = rcl;
+
+        this.offset = offset;
+        this.fetchFirst = fetchFirst;
+        this.hasJDBClimitClause = hasJDBClimitClause;
     }
 
 
@@ -80,6 +96,7 @@ public final class RowCountNode extends 
      *
      * @exception StandardException         Thrown on error
      */
+    @Override
     void generate(ActivationClassBuilder acb, MethodBuilder mb)
             throws StandardException {
 
@@ -158,7 +175,7 @@ public final class RowCountNode extends 
      *
      * @return  This object as a String
      */
-
+    @Override
     public String toString() {
         if (SanityManager.DEBUG) {
             return "offset: " + offset + "\n" +

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowNumberFunctionNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowNumberFunctionNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowNumberFunctionNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowNumberFunctionNode.java Fri Jun 21 07:47:47 2013
@@ -20,30 +20,27 @@
 
 package org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.types.TypeId;
-
 import java.sql.Types;
 import java.util.List;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.types.TypeId;
 
 /**
  * Class that represents a call to the ROW_NUMBER() window function.
  */
 public final class RowNumberFunctionNode extends WindowFunctionNode
 {
-
     /**
-     * Initializer. QueryTreeNode override.
      *
-     * @param arg1 null (Operand)
-     * @param arg2 The window definition or reference
-     *
-     * @exception StandardException
+     * @param op operand (null for now)
+     * @param w The window definition or reference
      */
-    public void init(Object arg1, Object arg2)
-        throws StandardException
-    {
-        super.init(arg1, "ROW_NUMBER", arg2);
+    RowNumberFunctionNode(ValueNode op, WindowNode w, ContextManager cm)
+            throws StandardException {
+        super(op, "ROW_NUMBER", w, cm);
+        setNodeType(C_NodeTypes.ROW_NUMBER_FUNCTION_NODE);
         setType( TypeId.getBuiltInTypeId( Types.BIGINT ),
                  TypeId.LONGINT_PRECISION,
                  TypeId.LONGINT_SCALE,
@@ -55,6 +52,7 @@ public final class RowNumberFunctionNode
      * ValueNode override.
      * @see ValueNode#bindExpression
      */
+    @Override
     ValueNode bindExpression(
                     FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates)
             throws StandardException

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowOrderingImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowOrderingImpl.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowOrderingImpl.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/RowOrderingImpl.java Fri Jun 21 07:47:47 2013
@@ -23,13 +23,10 @@ package org.apache.derby.impl.sql.compil
 
 import java.util.ArrayList;
 import java.util.Iterator;
-
-import org.apache.derby.iapi.sql.compile.RowOrdering;
-import org.apache.derby.iapi.sql.compile.Optimizable;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.Optimizable;
+import org.apache.derby.iapi.sql.compile.RowOrdering;
 
 class RowOrderingImpl implements RowOrdering {
 
@@ -99,7 +96,7 @@ class RowOrderingImpl implements RowOrde
 		if (orderPosition >= ordering.size())
 			return false;
 
-		ColumnOrdering co = (ColumnOrdering) ordering.get(orderPosition);
+        ColumnOrdering co = ordering.get(orderPosition);
 
 		/*
 		** Is the column in question ordered with the given direction at
@@ -136,7 +133,7 @@ class RowOrderingImpl implements RowOrde
 		boolean ordered = false;
 
 		for (int i = 0; i < ordering.size(); i++) {
-			ColumnOrdering co = (ColumnOrdering) ordering.get(i);
+            ColumnOrdering co = ordering.get(i);
 
 			/*
 			** Is the column in question ordered with the given direction at
@@ -164,30 +161,30 @@ class RowOrderingImpl implements RowOrde
 			return;
         }
 
-		ColumnOrdering currentColumnOrdering;
+        ColumnOrdering currColOrder;
 
 		if (ordering.isEmpty())
 		{
-			currentColumnOrdering = new ColumnOrdering(direction);
-			ordering.add(currentColumnOrdering);
+            currColOrder = new ColumnOrdering(direction);
+            ordering.add(currColOrder);
 		}
 		else
 		{
-			currentColumnOrdering =
+            currColOrder =
 				ordering.get(ordering.size() - 1);
 		}
 
 		if (SanityManager.DEBUG)
 		{
-			if (currentColumnOrdering.direction() != direction)
+            if (currColOrder.direction() != direction)
 			{
 				SanityManager.THROWASSERT("direction == " + direction +
 					", currentColumnOrdering.direction() == " +
-					currentColumnOrdering.direction());
+                    currColOrder.direction());
 			}
 		}
 
-		currentColumnOrdering.addColumn(tableNumber, columnNumber);
+        currColOrder.addColumn(tableNumber, columnNumber);
 	}
 
 	/** @see RowOrdering#nextOrderPosition */
@@ -227,9 +224,7 @@ class RowOrderingImpl implements RowOrde
 			(
 				(ordering.isEmpty()) ||
 				(
-					hasTableNumber &&
-					((ColumnOrdering) ordering.get(0)).hasTable(
-																	tableNumber)
+                    hasTableNumber && ordering.get(0).hasTable(tableNumber)
 				)
 			)
 			&&
@@ -284,7 +279,7 @@ class RowOrderingImpl implements RowOrde
 			/*
 			** First, remove the table from all the ColumnOrderings
 			*/
-			ColumnOrdering ord = (ColumnOrdering) ordering.get(i);
+            ColumnOrdering ord = ordering.get(i);
 			ord.removeColumns(tableNumber);
 			if (ord.empty())
 				ordering.remove(i);
@@ -367,9 +362,10 @@ class RowOrderingImpl implements RowOrde
 	}
 
 	private void rememberCurrentColumnOrdering(int posn) {
-		currentColumnOrdering = (ColumnOrdering) ordering.get(posn);
+        currentColumnOrdering = ordering.get(posn);
 	}
 
+    @Override
 	public String toString() {
 		String retval = null;
 
@@ -380,7 +376,7 @@ class RowOrderingImpl implements RowOrde
 
 			for (i = 0; i < unorderedOptimizables.size(); i++) 
 			{
-				Optimizable opt = (Optimizable) unorderedOptimizables.get(i);
+                Optimizable opt = unorderedOptimizables.get(i);
 				if (opt.getBaseTableName() != null)
 				{
 					retval += opt.getBaseTableName();



Mime
View raw message