You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2013/05/20 17:33:20 UTC
svn commit: r1484498 - in /db/derby/code/trunk/java:
engine/org/apache/derby/iapi/sql/conn/ engine/org/apache/derby/impl/sql/
engine/org/apache/derby/impl/sql/compile/
engine/org/apache/derby/impl/sql/conn/ shared/
Author: rhillegas
Date: Mon May 20 15:33:20 2013
New Revision: 1484498
URL: http://svn.apache.org/r1484498
Log:
DERBY-6213: Generify impl/sql/conn package.
Modified:
db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
db/derby/code/trunk/java/shared/build.xml
Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/conn/LanguageConnectionContext.java Mon May 20 15:33:20 2013
@@ -977,7 +977,7 @@ public interface LanguageConnectionConte
* Copy a map of autoincrement key value pairs into the cache of
* ai values stored in the language connection context.
*/
- public void copyHashtableToAIHT(Map from);
+ public void copyHashtableToAIHT(Map<Object,Long> from);
/**
* returns the <b>next</b> value to be inserted into an autoincrement col.
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/build.xml Mon May 20 15:33:20 2013
@@ -84,6 +84,23 @@
</fileset>
</replaceregexp>
+ <!-- Generify some types so they will compile cleanly on Java 6. -->
+ <replaceregexp match="java.util.Vector" replace="java.util.Vector<Object>" flags="m">
+ <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
+ <include name="SQLParser.java"/>
+ </fileset>
+ </replaceregexp>
+ <replaceregexp match="java.util.Vector\(\)" replace="java.util.Vector<Object>()" flags="m">
+ <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
+ <include name="SQLParser.java"/>
+ </fileset>
+ </replaceregexp>
+ <replaceregexp match="java.util.Enumeration" replace="java.util.Enumeration<Object>" flags="m">
+ <fileset dir="${generated.src.dir}/${derby.dir}/impl/sql/compile">
+ <include name="SQLParser.java"/>
+ </fileset>
+ </replaceregexp>
+
</target>
<target name="compile" depends="parser">
@@ -106,6 +123,7 @@
</classpath>
<include name="${derby.dir}/${cur.dir}/catalog/**"/>
<include name="${derby.dir}/${cur.dir}/depend/**"/>
+ <include name="${derby.dir}/${cur.dir}/conn/**"/>
<compilerarg value="-Xlint:unchecked"/>
</javac>
@@ -128,6 +146,7 @@
<include name="${derby.dir}/${cur.dir}/**"/>
<exclude name="${derby.dir}/${cur.dir}/catalog/**"/>
<exclude name="${derby.dir}/${cur.dir}/depend/**"/>
+ <exclude name="${derby.dir}/${cur.dir}/conn/**"/>
<!-- <compilerarg value="-Xlint:unchecked"/> -->
</javac>
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java Mon May 20 15:33:20 2013
@@ -127,6 +127,7 @@ public class CreateAliasNode extends DDL
*
* @exception StandardException Thrown on error
*/
+ @SuppressWarnings("unchecked")
public void init(
Object aliasName,
Object targetObject,
@@ -211,10 +212,10 @@ public class CreateAliasNode extends DDL
if (paramCount != 0) {
- names = (String[]) ((List) parameters[0]).toArray(
+ names = (String[]) ((List<String>) parameters[0]).toArray(
new String[paramCount]);
- types = (TypeDescriptor[]) ((List) parameters[1]).toArray(
+ types = (TypeDescriptor[]) ((List<TypeDescriptor>) parameters[1]).toArray(
new TypeDescriptor[paramCount]);
modes = new int[paramCount];
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/PrivilegeNode.java Mon May 20 15:33:20 2013
@@ -139,7 +139,7 @@ public class PrivilegeNode extends Query
*
* @exception StandardException Standard error policy.
*/
- public QueryTreeNode bind( HashMap dependencies, List grantees, boolean isGrant ) throws StandardException
+ public QueryTreeNode bind( HashMap<Provider,Provider> dependencies, List grantees, boolean isGrant ) throws StandardException
{
// The below code handles the case where objectName.getSchemaName()
// returns null, in which case we'll fetch the schema descriptor for
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/TablePrivilegesNode.java Mon May 20 15:33:20 2013
@@ -49,7 +49,7 @@ public class TablePrivilegesNode extends
private ResultColumnList[] columnLists = new ResultColumnList[ TablePrivilegeInfo.ACTION_COUNT];
private FormatableBitSet[] columnBitSets = new FormatableBitSet[ TablePrivilegeInfo.ACTION_COUNT];
private TableDescriptor td;
- private List descriptorList;
+ private List<Provider> descriptorList;
/**
* Add all actions
@@ -141,7 +141,7 @@ public class TablePrivilegesNode extends
ViewDescriptor vd = dd.getViewDescriptor(td);
DependencyManager dm = dd.getDependencyManager();
ProviderInfo[] pis = dm.getPersistentProviderInfos(vd);
- this.descriptorList = new ArrayList();
+ this.descriptorList = new ArrayList<Provider>();
int siz = pis.length;
for (int i=0; i < siz; i++)
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj Mon May 20 15:33:20 2013
@@ -173,7 +173,7 @@ public class SQLParser
private int parameterNumber;
/* The list of ? parameters */
- private ArrayList parameterList;
+ private ArrayList<ParameterNode> parameterList;
/* Remember if the last identifier or keyword was a
* delimited identifier. This is used for remembering
@@ -481,7 +481,7 @@ public class SQLParser
*/
void initUnnamedParameterList()
{
- parameterList = new ArrayList();
+ parameterList = new ArrayList<ParameterNode>();
}
/**
@@ -3318,7 +3318,7 @@ CursorNode
preparableSelectStatement(boolean checkParams) throws StandardException :
{
ResultSetNode queryExpression;
- ArrayList updateColumns = new ArrayList();
+ ArrayList<String> updateColumns = new ArrayList<String>();
int forUpdateState = CursorNode.UNSPECIFIED;
int isolationLevel = TransactionControl.UNSPECIFIED_ISOLATION_LEVEL;
CursorNode retval;
@@ -5874,7 +5874,7 @@ nonStaticMethodCallOrFieldAccess(ValueNo
ValueNode
nonStaticMethodInvocation(ValueNode receiver) throws StandardException :
{
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
MethodCallNode methodNode;
}
{
@@ -5996,7 +5996,7 @@ staticMethodName(String javaClassName) t
* <A NAME="methodParameter">methodParameter</A>
*/
void
-methodParameter(List parameterList) throws StandardException :
+methodParameter(List<ValueNode> parameterList) throws StandardException :
{
ValueNode parameter;
}
@@ -6216,7 +6216,7 @@ escapedValueFunction() throws StandardEx
ValueNode
escapedSYSFUNFunction() throws StandardException :
{
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
Token tok;
}
{
@@ -7678,7 +7678,7 @@ JavaToSQLValueNode
newInvocation() throws StandardException :
{
QueryTreeNode newNode;
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
String javaClassName;
}
{
@@ -7736,7 +7736,7 @@ vtiTableConstruct() throws StandardExcep
{
NewInvocationNode newNode = null;
QueryTreeNode invocationNode = null;
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
TableName vtiTableName = null;
TableDescriptor td;
MethodCallNode methodNode;
@@ -7795,7 +7795,7 @@ vtiTableConstruct() throws StandardExcep
ValueNode
staticMethodInvocation(String javaClassName) throws StandardException :
{
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
MethodCallNode methodNode;
}
{
@@ -7819,7 +7819,7 @@ staticMethodInvocation(String javaClassN
* <A NAME="methodCallParameterList">methodCallParameterList</A>
*/
-void methodCallParameterList(List parameterList) throws StandardException :
+void methodCallParameterList(List<ValueNode> parameterList) throws StandardException :
{
}
{
@@ -7857,7 +7857,7 @@ routineInvocation() throws StandardExcep
ValueNode
routineExpression() throws StandardException :
{
- ArrayList parameterList = new ArrayList();
+ ArrayList<ValueNode> parameterList = new ArrayList<ValueNode>();
TableName routineName;
MethodCallNode methodNode;
}
@@ -8385,7 +8385,7 @@ fetchFirstClause() throws StandardExcept
* <A NAME="forUpdateClause">forUpdateClause</A>
*/
int
-forUpdateClause(List columnList) throws StandardException :
+forUpdateClause(List<String> columnList) throws StandardException :
{
}
{
@@ -8409,7 +8409,7 @@ forUpdateClause(List columnList) throws
* <A NAME="forUpdateColumnList">forUpdateColumnList</A>
*/
void
-forUpdateColumnList(List columnList) throws StandardException :
+forUpdateColumnList(List<String> columnList) throws StandardException :
{
}
{
@@ -8420,7 +8420,7 @@ forUpdateColumnList(List columnList) thr
* <A NAME="forUpdateColumn">forUpdateColumn</A>
*/
void
-forUpdateColumn(List columnList) throws StandardException :
+forUpdateColumn(List<String> columnList) throws StandardException :
{
String columnName;
}
@@ -9390,7 +9390,7 @@ columnNameItem(ResultColumnList columnLi
* <A NAME="indexColumnList">indexColumnList</A>
*/
void
-indexColumnList(List columnList) throws StandardException :
+indexColumnList(List<String> columnList) throws StandardException :
{}
{
indexColumnItem(columnList) ( <COMMA> indexColumnItem(columnList) ) *
@@ -9400,7 +9400,7 @@ indexColumnList(List columnList) throws
* <A NAME="indexColumnItem">indexColumnItem</A>
*/
void
-indexColumnItem(List columnList) throws StandardException :
+indexColumnItem(List<String> columnList) throws StandardException :
{
String columnName;
}
@@ -10584,7 +10584,7 @@ indexDefinition() throws StandardExcepti
Properties properties = null;
TableName indexName;
TableName tableName;
- ArrayList indexColumnList = new ArrayList();
+ ArrayList<String> indexColumnList = new ArrayList<String>();
}
{
/*
@@ -10833,23 +10833,27 @@ Short parameterStyle( boolean isTableFun
Object[]
procedureParameterList( Object[] procedureElements ) throws StandardException :
{
- List[] list = {
- new ArrayList(), // name
- new ArrayList(), // type
- new ArrayList(), // in/out
- };
+ List<String> names = new ArrayList<String>();
+ List<TypeDescriptor> types = new ArrayList<TypeDescriptor>();
+ List<Integer> inOut = new ArrayList<Integer>();
+ Object[] result = new Object[ 3 ];
Boolean ellipsis = null;
}
{
<LEFT_PAREN>
- [ procedureParameterDefinition(list)
- ( <COMMA> procedureParameterDefinition(list) )*
+ [ procedureParameterDefinition( names, types, inOut )
+ ( <COMMA> procedureParameterDefinition( names, types, inOut ) )*
[ ellipsis = ellipsis() ]
]
<RIGHT_PAREN>
{
procedureElements[ CreateAliasNode.VARARGS ] = ellipsis;
- return list;
+
+ result[ 0 ] = names;
+ result[ 1 ] = types;
+ result[ 2 ] = inOut;
+
+ return result;
}
}
@@ -10857,7 +10861,12 @@ procedureParameterList( Object[] procedu
* <A NAME="Definition">procedureParameterDefinition</A>
*/
void
-procedureParameterDefinition(List[] list) throws StandardException :
+procedureParameterDefinition
+(
+ List<String> names,
+ List<TypeDescriptor> types,
+ List<Integer> inOut
+) throws StandardException :
{
DataTypeDescriptor typeDescriptor;
String parameterName = "";
@@ -10872,9 +10881,9 @@ procedureParameterDefinition(List[] list
]
typeDescriptor = dataTypeDDL()
{
- list[0].add(parameterName);
- list[1].add(typeDescriptor.getCatalogType());
- list[2].add(inout);
+ names.add(parameterName);
+ types.add(typeDescriptor.getCatalogType());
+ inOut.add(inout);
}
}
@@ -10935,23 +10944,27 @@ functionDefinition() throws StandardExce
Object[]
functionParameterList( Object[] functionElements ) throws StandardException :
{
- List[] list = {
- new ArrayList(), // name
- new ArrayList(), // type
- new ArrayList(), // in/out - ALWAYS IN
- };
+ List<String> names = new ArrayList<String>();
+ List<TypeDescriptor> types = new ArrayList<TypeDescriptor>();
+ List<Integer> inOut = new ArrayList<Integer>(); // in/out - ALWAYS IN
+ Object[] result = new Object[ 3 ];
Boolean ellipsis = null;
}
{
<LEFT_PAREN>
- [ functionParameterDefinition(list)
- ( <COMMA> functionParameterDefinition(list) )*
+ [ functionParameterDefinition( names, types,inOut )
+ ( <COMMA> functionParameterDefinition( names, types,inOut ) )*
[ ellipsis = ellipsis() ]
]
<RIGHT_PAREN>
{
functionElements[ CreateAliasNode.VARARGS ] = ellipsis;
- return list;
+
+ result[ 0 ] = names;
+ result[ 1 ] = types;
+ result[ 2 ] = inOut;
+
+ return result;
}
}
@@ -10970,7 +10983,12 @@ ellipsis() throws StandardException :
* <A NAME="Definition">functionParameterDefinition</A>
*/
void
-functionParameterDefinition(List[] list) throws StandardException :
+functionParameterDefinition
+(
+ List<String> names,
+ List<TypeDescriptor> types,
+ List<Integer> inOut
+) throws StandardException :
{
DataTypeDescriptor typeDescriptor;
String parameterName = "";
@@ -10982,9 +11000,9 @@ functionParameterDefinition(List[] list)
]
typeDescriptor = dataTypeDDL()
{
- list[0].add(parameterName);
- list[1].add(typeDescriptor.getCatalogType());
- list[2].add(ReuseFactory.getInteger(JDBC30Translation.PARAMETER_MODE_IN));
+ names.add(parameterName);
+ types.add(typeDescriptor.getCatalogType());
+ inOut.add(ReuseFactory.getInteger(JDBC30Translation.PARAMETER_MODE_IN));
}
}
@@ -11014,8 +11032,8 @@ functionReturnDataType() throws Standard
TypeDescriptor
functionTableType() throws StandardException :
{
- ArrayList names = new ArrayList();
- ArrayList types = new ArrayList();
+ ArrayList<String> names = new ArrayList<String>();
+ ArrayList<TypeDescriptor> types = new ArrayList<TypeDescriptor>();
String[] nameArray;
TypeDescriptor[] typeArray;
int columnCount;
@@ -11056,8 +11074,8 @@ functionTableType() throws StandardExcep
void
functionTableReturnColumn
(
- ArrayList names,
- ArrayList types
+ ArrayList<String> names,
+ ArrayList<TypeDescriptor> types
)
throws StandardException :
{
@@ -11338,7 +11356,7 @@ rowOrStatement() :
List
triggerReferencingClause() throws StandardException :
{
- ArrayList expressions = new ArrayList();
+ ArrayList<TriggerReferencingStruct> expressions = new ArrayList<TriggerReferencingStruct>();
}
{
<REFERENCING> triggerReferencingExpression(expressions) ( triggerReferencingExpression(expressions) )*
@@ -11348,7 +11366,7 @@ triggerReferencingClause() throws Standa
}
void
-triggerReferencingExpression(List expressions) throws StandardException :
+triggerReferencingExpression(List<TriggerReferencingStruct> expressions) throws StandardException :
{
String identifier;
boolean isNew = true;
@@ -14029,7 +14047,7 @@ RoutineDesignator routineDesignator() th
{
Token procOrFunction;
TableName name;
- List paramTypeList = null;
+ List<TypeDescriptor> paramTypeList = null;
}
{
( procOrFunction = <FUNCTION> | procOrFunction = <PROCEDURE> )
@@ -14047,9 +14065,9 @@ RoutineDesignator routineDesignator() th
/*
* <A NAME="parameterTypeList">parameterTypeList</A>
*/
-List/*<TypeDescriptor>*/ parameterTypeList( ) throws StandardException :
+List<TypeDescriptor> parameterTypeList( ) throws StandardException :
{
- ArrayList list = new ArrayList();
+ ArrayList<TypeDescriptor> list = new ArrayList<TypeDescriptor>();
TypeDescriptor type;
}
{
@@ -14127,7 +14145,7 @@ ResultColumnList privilegeColumnList() t
*/
List granteeList() throws StandardException :
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
}
{
grantee( list) ( <COMMA> grantee( list) ) *
@@ -14137,7 +14155,7 @@ List granteeList() throws StandardExcept
}
void
-grantee( List list) throws StandardException :
+grantee( List<String> list) throws StandardException :
{
String str;
}
@@ -14191,7 +14209,7 @@ roleGrantStatement() throws StandardExce
*/
List roleList() throws StandardException :
{
- ArrayList list = new ArrayList();
+ ArrayList<String> list = new ArrayList<String>();
}
{
roleElement(list) ( <COMMA> roleElement(list) ) *
@@ -14205,7 +14223,7 @@ List roleList() throws StandardException
* <A NAME="roleElement">roleElement</A>
*/
void
-roleElement( List list) throws StandardException :
+roleElement( List<String> list) throws StandardException :
{
String str;
}
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericLanguageConnectionContext.java Mon May 20 15:33:20 2013
@@ -113,7 +113,7 @@ public class GenericLanguageConnectionCo
fields
*/
- private final ArrayList acts;
+ private final ArrayList<Activation> acts;
private volatile boolean unusedActs=false;
/** The maximum size of acts since the last time it was trimmed. Used to
* determine whether acts should be trimmed to reclaim space. */
@@ -141,10 +141,10 @@ public class GenericLanguageConnectionCo
* can be prepared and used to insert rows into the table during the
* capturing of statistics data into the user XPLAIN tables.
*/
- private Map xplain_statements = new HashMap();
+ private Map<Object,Object> xplain_statements = new HashMap<Object,Object>();
//all the temporary tables declared for this connection
- private ArrayList allDeclaredGlobalTempTables;
+ private ArrayList<TempTableInfo> allDeclaredGlobalTempTables;
//The currentSavepointLevel is used to provide the rollback behavior of
//temporary tables. At any point, this variable has the total number of
@@ -269,9 +269,9 @@ public class GenericLanguageConnectionCo
// database is booted.
private int lockEscalationThreshold;
- private ArrayList stmtValidators;
- private ArrayList triggerExecutionContexts;
- private ArrayList triggerTables;
+ private ArrayList<ExecutionStmtValidator> stmtValidators;
+ private ArrayList<TriggerExecutionContext> triggerExecutionContexts;
+ private ArrayList <TableDescriptor> triggerTables;
// OptimizerTrace
private OptTrace optimizerTracer;
@@ -282,7 +282,7 @@ public class GenericLanguageConnectionCo
* To support lastAutoincrementValue: This is a hashtable which maps
* schemaName,tableName,columnName to a Long value.
*/
- private HashMap autoincrementHT;
+ private HashMap<Object,Long> autoincrementHT;
/**
* whether to allow updates or not.
*/
@@ -291,7 +291,7 @@ public class GenericLanguageConnectionCo
private boolean identityNotNull; //frugal programmer
// cache of ai being handled in memory (bulk insert + alter table).
- private HashMap autoincrementCacheHashtable;
+ private HashMap<String,AutoincrementCounter> autoincrementCacheHashtable;
// User-written inspector to print out query tree
private ASTVisitor astWalker;
@@ -308,7 +308,7 @@ public class GenericLanguageConnectionCo
* for keeping track of referenced columns for a table during DDL
* operations.
*/
- private WeakHashMap referencedColumnMap;
+ private WeakHashMap<TableDescriptor,FormatableBitSet> referencedColumnMap;
/*
constructor
@@ -328,7 +328,7 @@ public class GenericLanguageConnectionCo
throws StandardException
{
super(cm, org.apache.derby.iapi.reference.ContextId.LANG_CONNECTION);
- acts = new ArrayList();
+ acts = new ArrayList<Activation>();
tran = tranCtrl;
dataFactory = lcf.getDataValueFactory();
@@ -360,9 +360,9 @@ public class GenericLanguageConnectionCo
Property.MIN_LOCKS_ESCALATION_THRESHOLD,
Integer.MAX_VALUE,
Property.DEFAULT_LOCKS_ESCALATION_THRESHOLD);
- stmtValidators = new ArrayList();
- triggerExecutionContexts = new ArrayList();
- triggerTables = new ArrayList();
+ stmtValidators = new ArrayList<ExecutionStmtValidator>();
+ triggerExecutionContexts = new ArrayList<TriggerExecutionContext>();
+ triggerTables = new ArrayList<TableDescriptor>();
}
/**
@@ -396,7 +396,7 @@ public class GenericLanguageConnectionCo
}
setDefaultSchema(initDefaultSchemaDescriptor());
- referencedColumnMap = new WeakHashMap();
+ referencedColumnMap = new WeakHashMap<TableDescriptor,FormatableBitSet>();
}
/**
@@ -520,7 +520,7 @@ public class GenericLanguageConnectionCo
if (i >= acts.size())
continue;
- Activation a1 = (Activation) acts.get(i);
+ Activation a1 = acts.get(i);
if (!a1.isInUse()) {
a1.close();
}
@@ -577,7 +577,7 @@ public class GenericLanguageConnectionCo
// tables currently active in the transaction.
if (allDeclaredGlobalTempTables == null)
- allDeclaredGlobalTempTables = new ArrayList();
+ allDeclaredGlobalTempTables = new ArrayList<TempTableInfo>();
allDeclaredGlobalTempTables.add(tempTableInfo);
}
@@ -654,7 +654,7 @@ public class GenericLanguageConnectionCo
for (int i = 0; i < allDeclaredGlobalTempTables.size(); i++)
{
TempTableInfo tempTableInfo =
- (TempTableInfo)allDeclaredGlobalTempTables.get(i);
+ allDeclaredGlobalTempTables.get(i);
if (tempTableInfo.getDroppedInSavepointLevel() >
currentSavepointLevel)
@@ -705,7 +705,7 @@ public class GenericLanguageConnectionCo
for (int i = allDeclaredGlobalTempTables.size()-1; i >= 0; i--)
{
TempTableInfo tempTableInfo =
- (TempTableInfo)allDeclaredGlobalTempTables.get(i);
+ allDeclaredGlobalTempTables.get(i);
if (tempTableInfo.getDroppedInSavepointLevel() != -1)
{
@@ -739,8 +739,8 @@ public class GenericLanguageConnectionCo
for (int i=0; i<allDeclaredGlobalTempTables.size(); i++)
{
TableDescriptor td =
- ((TempTableInfo) (allDeclaredGlobalTempTables.
- get(i))).getTableDescriptor();
+ allDeclaredGlobalTempTables.
+ get(i).getTableDescriptor();
if (td.isOnCommitDeleteRows() == false)
{
// do nothing for temp table with ON COMMIT PRESERVE ROWS
@@ -784,8 +784,7 @@ public class GenericLanguageConnectionCo
{
// remove all temp tables from this context.
TableDescriptor td =
- ((TempTableInfo)
- (allDeclaredGlobalTempTables.get(i))).getTableDescriptor();
+ allDeclaredGlobalTempTables.get(i).getTableDescriptor();
//remove the conglomerate created for this temp table
tc.dropConglomerate(td.getHeapConglomerateId());
@@ -821,7 +820,7 @@ public class GenericLanguageConnectionCo
// Reset the current user
getCurrentSQLSessionContext().setUser(getSessionUserId());
- referencedColumnMap = new WeakHashMap();
+ referencedColumnMap = new WeakHashMap<TableDescriptor,FormatableBitSet>();
}
// debug methods
@@ -851,7 +850,7 @@ public class GenericLanguageConnectionCo
try
{
TempTableInfo tempTableInfo =
- (TempTableInfo)allDeclaredGlobalTempTables.get(i);
+ allDeclaredGlobalTempTables.get(i);
TableDescriptor td = tempTableInfo.getTableDescriptor();
@@ -937,7 +936,7 @@ public class GenericLanguageConnectionCo
for (int i = allDeclaredGlobalTempTables.size()-1; i >= 0; i--)
{
TempTableInfo tempTableInfo =
- (TempTableInfo)allDeclaredGlobalTempTables.get(i);
+ allDeclaredGlobalTempTables.get(i);
if (tempTableInfo.getDeclaredInSavepointLevel() >=
currentSavepointLevel)
@@ -1076,8 +1075,8 @@ public class GenericLanguageConnectionCo
return null;
for (int i = 0; i < allDeclaredGlobalTempTables.size(); i++) {
- if (((TempTableInfo)allDeclaredGlobalTempTables.get(i)).matches(tableName))
- return (TempTableInfo)allDeclaredGlobalTempTables.get(i);
+ if ((allDeclaredGlobalTempTables.get(i)).matches(tableName))
+ return allDeclaredGlobalTempTables.get(i);
}
return null;
}
@@ -1163,7 +1162,7 @@ public class GenericLanguageConnectionCo
int cursorHash = cursorName.hashCode();
for (int i = 0; i < size; i++) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (!a.isInUse())
{
@@ -1970,7 +1969,7 @@ public class GenericLanguageConnectionCo
throws StandardException
{
for (int i = acts.size() - 1; i >= 0; i--) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (a.checkIfThisActivationHasHoldCursor(tableName))
return true;
}
@@ -1998,7 +1997,7 @@ public class GenericLanguageConnectionCo
/* For every activation */
for (int i = acts.size() - 1; i >= 0; i--) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (SanityManager.DEBUG)
{
@@ -2037,7 +2036,7 @@ public class GenericLanguageConnectionCo
/* For every activation */
for (int i = acts.size() - 1; i >= 0; i--) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (SanityManager.DEBUG)
{
@@ -2094,7 +2093,7 @@ public class GenericLanguageConnectionCo
// in this list, thus invalidating the Enumeration
for (int i = acts.size() - 1; i >= 0; i--) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (!a.isInUse())
{
@@ -2131,7 +2130,7 @@ public class GenericLanguageConnectionCo
// in this list, thus invalidating the Enumeration
for (int i = acts.size() - 1; i >= 0; i--) {
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
if (!a.isInUse())
{
@@ -2713,8 +2712,7 @@ public class GenericLanguageConnectionCo
{
return triggerExecutionContexts.size() == 0 ?
(TriggerExecutionContext)null :
- (TriggerExecutionContext)triggerExecutionContexts.get(
- triggerExecutionContexts.size() - 1);
+ triggerExecutionContexts.get( triggerExecutionContexts.size() - 1 );
}
/**
@@ -2737,9 +2735,9 @@ public class GenericLanguageConnectionCo
if (stmtValidators.size() > 0)
{
- for (Iterator it = stmtValidators.iterator(); it.hasNext(); )
+ for (Iterator<ExecutionStmtValidator> it = stmtValidators.iterator(); it.hasNext(); )
{
- ((ExecutionStmtValidator)it.next())
+ it.next()
.validateStatement(constantAction);
}
}
@@ -2786,7 +2784,7 @@ public class GenericLanguageConnectionCo
{
return triggerTables.size() == 0 ?
(TableDescriptor)null :
- (TableDescriptor)triggerTables.get(triggerTables.size() - 1);
+ triggerTables.get(triggerTables.size() - 1);
}
/**
* @see LanguageConnectionContext#getDatabase
@@ -3093,7 +3091,7 @@ public class GenericLanguageConnectionCo
// the end of the array
if (i >= acts.size())
continue;
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
a.reset();
a.close();
}
@@ -3159,7 +3157,7 @@ public class GenericLanguageConnectionCo
if (i >= acts.size())
continue;
- Activation a = (Activation) acts.get(i);
+ Activation a = acts.get(i);
/*
** Look for stale activations. Activations are
** marked as unused during statement finalization.
@@ -3328,8 +3326,7 @@ public class GenericLanguageConnectionCo
for (int i = size - 1; i >= 0; i--)
{
// first loop through triggers.
- TriggerExecutionContext itec =
- (TriggerExecutionContext) triggerExecutionContexts.get(i);
+ TriggerExecutionContext itec = triggerExecutionContexts.get(i);
Long value = itec.getAutoincrementValue(aiKey);
if (value == null)
continue;
@@ -3368,11 +3365,11 @@ public class GenericLanguageConnectionCo
if (autoincrementCacheHashtable == null)
{
- autoincrementCacheHashtable = new HashMap();
+ autoincrementCacheHashtable = new HashMap<String,AutoincrementCounter>();
}
AutoincrementCounter aic =
- (AutoincrementCounter)autoincrementCacheHashtable.get(key);
+ autoincrementCacheHashtable.get(key);
if (aic != null)
{
if (SanityManager.DEBUG)
@@ -3407,7 +3404,7 @@ public class GenericLanguageConnectionCo
columnName);
AutoincrementCounter aic =
- (AutoincrementCounter)autoincrementCacheHashtable.get(key);
+ autoincrementCacheHashtable.get(key);
if (aic == null)
{
@@ -3440,15 +3437,15 @@ public class GenericLanguageConnectionCo
return;
if (autoincrementHT == null)
- autoincrementHT = new HashMap();
+ autoincrementHT = new HashMap<Object,Long>();
DataDictionary dd = getDataDictionary();
- for (Iterator it = autoincrementCacheHashtable.keySet().iterator();
+ for (Iterator<String> it = autoincrementCacheHashtable.keySet().iterator();
it.hasNext(); )
{
Object key = it.next();
AutoincrementCounter aic =
- (AutoincrementCounter)autoincrementCacheHashtable.get(key);
+ autoincrementCacheHashtable.get(key);
Long value = aic.getCurrentValue();
aic.flushToDisk(getTransactionExecute(), dd, tableUUID);
if (value != null)
@@ -3464,12 +3461,12 @@ public class GenericLanguageConnectionCo
* into autoincrementHT, the cache of autoincrement values
* kept in the languageconnectioncontext.
*/
- public void copyHashtableToAIHT(Map from)
+ public void copyHashtableToAIHT(Map<Object,Long> from)
{
if (from.isEmpty())
return;
if (autoincrementHT == null)
- autoincrementHT = new HashMap();
+ autoincrementHT = new HashMap<Object,Long>();
autoincrementHT.putAll(from);
}
@@ -3511,7 +3508,7 @@ public class GenericLanguageConnectionCo
*/
public Activation getLastActivation()
{
- return (Activation)acts.get(acts.size() - 1);
+ return acts.get(acts.size() - 1);
}
public StringBuffer appendErrorInfo() {
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/conn/GenericStatementContext.java Mon May 20 15:33:20 2013
@@ -65,7 +65,7 @@ final class GenericStatementContext
private boolean setSavePoint;
private String internalSavePointName;
private ResultSet topResultSet;
- private ArrayList dependencies;
+ private ArrayList<Dependency> dependencies;
private NoPutResultSet[] subqueryTrackingArray;
private NoPutResultSet[] materializedSubqueries;
private final LanguageConnectionContext lcc;
@@ -462,7 +462,7 @@ final class GenericStatementContext
if (dependencies == null)
{
- dependencies = new ArrayList();
+ dependencies = new ArrayList<Dependency>();
}
dependencies.add(dy);
}
@@ -562,9 +562,9 @@ final class GenericStatementContext
{
DependencyManager dmgr = lcc.getDataDictionary().getDependencyManager();
- for (Iterator iterator = dependencies.iterator(); iterator.hasNext(); )
+ for (Iterator<Dependency> iterator = dependencies.iterator(); iterator.hasNext(); )
{
- Dependency dy = (Dependency) iterator.next();
+ Dependency dy = iterator.next();
dmgr.clearInMemoryDependency(dy);
}
Modified: db/derby/code/trunk/java/shared/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/shared/build.xml?rev=1484498&r1=1484497&r2=1484498&view=diff
==============================================================================
--- db/derby/code/trunk/java/shared/build.xml (original)
+++ db/derby/code/trunk/java/shared/build.xml Mon May 20 15:33:20 2013
@@ -53,8 +53,8 @@
<echo level="info" message="building generated sanity info"/>
<target name="compile">
<javac
- source="1.4"
- target="1.4"
+ source="1.6"
+ target="1.6"
bootclasspath="${empty}"
nowarn="on"
debug="${debug}"
@@ -66,13 +66,13 @@
srcdir="${generated.src.dir}"
destdir="${out.dir}">
<classpath>
- <pathelement path="${java15compile.classpath}"/>
+ <pathelement path="${java16compile.classpath}"/>
</classpath>
</javac>
<javac
- source="1.4"
- target="1.4"
+ source="1.6"
+ target="1.6"
bootclasspath="${empty}"
nowarn="on"
debug="${debug}"
@@ -85,15 +85,15 @@
includes="org/apache/derby/shared/**"
destdir="${out.dir}">
<classpath>
- <pathelement path="${java15compile.classpath}"/>
+ <pathelement path="${java16compile.classpath}"/>
</classpath>
<include name="org/apache/derby/shared/**"/>
<exclude name="org/apache/derby/shared/common/sanity/ThreadDump.java"/>
</javac>
<javac
- source="1.5"
- target="1.5"
+ source="1.6"
+ target="1.6"
bootclasspath="${empty}"
nowarn="on"
debug="${debug}"
@@ -105,7 +105,7 @@
srcdir="${derby.shared.src.dir}"
destdir="${out.dir}">
<classpath>
- <pathelement path="${java15compile.classpath}"/>
+ <pathelement path="${java16compile.classpath}"/>
</classpath>
<include name="org/apache/derby/shared/common/sanity/ThreadDump.java"/>
</javac>