id
stringlengths 22
25
| commit_message
stringlengths 137
6.96k
| diffs
listlengths 0
63
|
|---|---|---|
derby-DERBY-5840-2a57bb08
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Store lists of implementation classes in a list instead of an array,
since arrays cannot have generic types. This silences an unchecked
conversion warning and allows us to remove a SuppressWarnings
annotation.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1486826 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.List;"
],
"header": "@@ -72,10 +72,12 @@ import java.io.BufferedReader;",
"removed": []
},
{
"added": [
" private List<List<Class<?>>> implementationSets;"
],
"header": "@@ -109,7 +111,7 @@ abstract class BaseMonitor",
"removed": [
"\tVector[] implementationSets;"
]
},
{
"added": [
" Vector<Class<?>> defaultImplementations = getDefaultImplementations();"
],
"header": "@@ -292,7 +294,7 @@ abstract class BaseMonitor",
"removed": [
"\t\tVector defaultImplementations = getDefaultImplementations();"
]
},
{
"added": [
" implementationSets = new ArrayList<List<Class<?>>>(implementationCount);",
"",
" implementationSets.add(bootImplementations);",
" implementationSets.add(systemImplementations);",
" implementationSets.add(applicationImplementations);",
" implementationSets.add(defaultImplementations);"
],
"header": "@@ -309,23 +311,22 @@ abstract class BaseMonitor",
"removed": [
"\t\timplementationSets = new Vector[implementationCount];",
"\t\timplementationCount = 0;",
"\t\t\timplementationSets[implementationCount++] = bootImplementations;",
"\t\t\t\timplementationSets[implementationCount++] = systemImplementations;",
"\t\t\t\timplementationSets[implementationCount++] = applicationImplementations;",
"\t\t\timplementationSets[implementationCount++] = defaultImplementations;",
""
]
},
{
"added": [],
"header": "@@ -698,8 +699,6 @@ abstract class BaseMonitor",
"removed": [
"\tprivate Boolean exceptionTrace;",
""
]
},
{
"added": [],
"header": "@@ -708,7 +707,6 @@ abstract class BaseMonitor",
"removed": [
" @SuppressWarnings(\"unchecked\")"
]
},
{
"added": [
" for (List<Class<?>> set : implementationSets) {",
" instance = loadInstance(set, factoryInterface, properties);"
],
"header": "@@ -718,8 +716,8 @@ abstract class BaseMonitor",
"removed": [
"\t\tfor (int i = 0; i < implementationSets.length; i++) {",
"\t\t\tinstance = loadInstance( (Vector<Class<?>>) implementationSets[i], factoryInterface, properties);"
]
},
{
"added": [
" private Object loadInstance(List<Class<?>> implementations,",
" Class<?> factoryInterface,",
" Properties properties) {"
],
"header": "@@ -727,8 +725,9 @@ abstract class BaseMonitor",
"removed": [
"",
"\tprivate Object loadInstance(Vector<Class<?>> implementations, Class<?> factoryInterface, Properties properties) {"
]
},
{
"added": [
" into the implementations vector of that class. Returns -1 if no class",
" private static int findImplementation(List<Class<?>> implementations,",
" int startIndex, Class<?> factoryInterface) {"
],
"header": "@@ -748,10 +747,11 @@ abstract class BaseMonitor",
"removed": [
"\t\tinto the implementations vecotr of that class. Returns -1 if no class",
"\tprivate static int findImplementation(Vector<Class<?>> implementations, int startIndex, Class<?> factoryInterface) {"
]
}
]
}
] |
derby-DERBY-5840-3f7581c0
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
- Make ArrayUtil.asReadOnlyList() use checked conversions and remove
SuppressWarnings annotation
- Generify the signature of ArrayUtil.copy(Object[]), remove the now
redundant copy(String[]) overload, and remove the now redundant
casts in many of the call sites
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485676 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/io/ArrayUtil.java",
"hunks": [
{
"added": [
"\t// Methods to copy arrays.",
" public static <T> T[] copy( T[] original )",
" return (original == null) ?",
" null :",
" Arrays.copyOf(original, original.length);"
],
"header": "@@ -38,21 +38,16 @@ public abstract class ArrayUtil",
"removed": [
"\t// Methods to copy arrays. We'd like to use java.util.copyOf(), but",
" // we have to run on Java 5.",
" public static Object[] copy( Object[] original )",
" return (original == null) ? null : (Object[]) original.clone();",
" }",
"",
" /** Copy a (possibly null) array of strings */",
" public static String[] copy( String[] original )",
" {",
" return (original == null) ? null : (String[]) original.clone();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/sql/dictionary/IndexLister.java",
"hunks": [
{
"added": [
" return ArrayUtil.copy(indexRowGenerators);"
],
"header": "@@ -87,7 +87,7 @@ public class IndexLister",
"removed": [
"\t\treturn\t(IndexRowGenerator[]) ArrayUtil.copy( indexRowGenerators );"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/sql/dictionary/SPSDescriptor.java",
"hunks": [
{
"added": [
" return ArrayUtil.copy(params);"
],
"header": "@@ -596,7 +596,7 @@ public class SPSDescriptor extends UniqueSQLObjectDescriptor",
"removed": [
"\t\treturn (DataTypeDescriptor[]) ArrayUtil.copy( params );"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/GenericResultDescription.java",
"hunks": [
{
"added": [
" this.columns = ArrayUtil.copy(columns);"
],
"header": "@@ -98,7 +98,7 @@ public final class GenericResultDescription",
"removed": [
"\t\tthis.columns = (ResultColumnDescriptor[]) ArrayUtil.copy( columns );"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/rts/RunTimeStatisticsImpl.java",
"hunks": [
{
"added": [
" this.subqueryTrackingArray = ArrayUtil.copy(subqueryTrackingArray);"
],
"header": "@@ -103,7 +103,7 @@ public final class RunTimeStatisticsImpl implements RunTimeStatistics",
"removed": [
"\t\tthis.subqueryTrackingArray = (ResultSetStatistics[]) ArrayUtil.copy( subqueryTrackingArray );"
]
}
]
}
] |
derby-DERBY-5840-4772c7ee
|
DERBY-5840: Compile network client with source and target level 1.5
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1362419 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/ClientPooledConnection.java",
"hunks": [
{
"added": [
"import javax.sql.ConnectionEvent;",
"import javax.sql.ConnectionEventListener;",
"import org.apache.derby.client.net.NetXAConnection;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.jdbc.ClientBaseDataSource;",
"import org.apache.derby.jdbc.ClientDriver;"
],
"header": "@@ -22,18 +22,18 @@ package org.apache.derby.client;",
"removed": [
"import javax.sql.ConnectionEvent;",
"import javax.sql.ConnectionEventListener;",
"import org.apache.derby.client.net.NetXAConnection;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.jdbc.ClientBaseDataSource;",
"import org.apache.derby.jdbc.ClientDriver;"
]
},
{
"added": [
" private ArrayList<ConnectionEventListener> listeners_ =",
" new ArrayList<ConnectionEventListener>();"
],
"header": "@@ -47,7 +47,8 @@ public class ClientPooledConnection implements javax.sql.PooledConnection {",
"removed": [
" private ArrayList listeners_ = new ArrayList();"
]
},
{
"added": [
" listeners_ = new ArrayList<ConnectionEventListener>(listeners_);"
],
"header": "@@ -323,7 +324,7 @@ public class ClientPooledConnection implements javax.sql.PooledConnection {",
"removed": [
" listeners_ = (ArrayList) listeners_.clone();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ByteArrayCombinerStream.java",
"hunks": [
{
"added": [
" private final ArrayList<byte[]> arrays;"
],
"header": "@@ -47,7 +47,7 @@ public class ByteArrayCombinerStream",
"removed": [
" private final ArrayList arrays;"
]
},
{
"added": [
" public ByteArrayCombinerStream(ArrayList<byte[]> arraysIn, long length) {"
],
"header": "@@ -72,7 +72,7 @@ public class ByteArrayCombinerStream",
"removed": [
" public ByteArrayCombinerStream(ArrayList arraysIn, long length) {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ColumnMetaData.java",
"hunks": [
{
"added": [
"import java.util.Hashtable;"
],
"header": "@@ -22,7 +22,7 @@",
"removed": [
""
]
},
{
"added": [
" transient private Hashtable<String, Integer> columnNameToIndexCache_;"
],
"header": "@@ -98,7 +98,7 @@ public class ColumnMetaData implements java.sql.ResultSetMetaData {",
"removed": [
" transient private java.util.Hashtable columnNameToIndexCache_ = null;"
]
},
{
"added": [
" columnNameToIndexCache_ = new Hashtable<String, Integer>();",
" Integer index = columnNameToIndexCache_.get(columnName);"
],
"header": "@@ -805,9 +805,9 @@ public class ColumnMetaData implements java.sql.ResultSetMetaData {",
"removed": [
" columnNameToIndexCache_ = new java.util.Hashtable();",
" Integer index = (Integer) columnNameToIndexCache_.get(columnName);"
]
},
{
"added": [
" columnNameToIndexCache_.put(columnName, col + 1);"
],
"header": "@@ -819,7 +819,7 @@ public class ColumnMetaData implements java.sql.ResultSetMetaData {",
"removed": [
" columnNameToIndexCache_.put(columnName, new Integer(col + 1));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Connection.java",
"hunks": [
{
"added": [
"import java.util.Hashtable;",
"import java.util.Iterator;",
"import java.util.Map;",
"import java.util.Set;",
"import java.util.WeakHashMap;",
"import org.apache.derby.jdbc.ClientBaseDataSource;",
"import org.apache.derby.jdbc.ClientDataSource;",
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -21,13 +21,17 @@",
"removed": [
"import org.apache.derby.jdbc.ClientBaseDataSource;",
"import org.apache.derby.jdbc.ClientDataSource;",
"import org.apache.derby.shared.common.reference.SQLState;",
""
]
},
{
"added": [
" final WeakHashMap<Statement, Void> openStatements_ =",
" new WeakHashMap<Statement, Void>();"
],
"header": "@@ -47,7 +51,8 @@ public abstract class Connection",
"removed": [
" final java.util.WeakHashMap openStatements_ = new java.util.WeakHashMap();"
]
},
{
"added": [
" final WeakHashMap<UnitOfWorkListener, Void> CommitAndRollbackListeners_ =",
" new WeakHashMap<UnitOfWorkListener, Void>();",
""
],
"header": "@@ -55,7 +60,9 @@ public abstract class Connection",
"removed": [
" final java.util.WeakHashMap CommitAndRollbackListeners_ = new java.util.WeakHashMap();"
]
},
{
"added": [
" Hashtable<String, String> clientCursorNameCache_ =",
" new Hashtable<String, String>();",
""
],
"header": "@@ -168,7 +175,9 @@ public abstract class Connection",
"removed": [
" java.util.Hashtable clientCursorNameCache_ = new java.util.Hashtable();"
]
},
{
"added": [
" Set<Statement> keySet = openStatements_.keySet();",
" for (Iterator<Statement> i = keySet.iterator(); i.hasNext();) {",
" Statement stmt = i.next();",
" Set<Statement> keySet = openStatements_.keySet();",
" for (Iterator<Statement> i = keySet.iterator(); i.hasNext();) {",
" i.next().writeClose(false); // false means don't permit auto-commits",
" Set<Statement> keySet = openStatements_.keySet();",
" for (Iterator<Statement> i = keySet.iterator(); i.hasNext();) {",
" i.next().readClose(false); // false means don't permit auto-commits"
],
"header": "@@ -868,25 +877,25 @@ public abstract class Connection",
"removed": [
" \tjava.util.Set keySet = openStatements_.keySet();",
" for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" Statement stmt = (Statement) i.next();",
" \tjava.util.Set keySet = openStatements_.keySet();",
" for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" ((Statement) i.next()).writeClose(false); // false means don't permit auto-commits",
" \tjava.util.Set keySet = openStatements_.keySet();",
" for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" ((Statement) i.next()).readClose(false); // false means don't permit auto-commits"
]
},
{
"added": [
" public Map<String, Class<?>> getTypeMap() throws SQLException {",
" Map<String, Class<?>> map = Collections.emptyMap();"
],
"header": "@@ -1401,14 +1410,14 @@ public abstract class Connection",
"removed": [
" public java.util.Map getTypeMap() throws SQLException {",
" java.util.Map map = Collections.EMPTY_MAP;"
]
},
{
"added": [
" synchronized public void setTypeMap(Map map) throws SQLException {"
],
"header": "@@ -1420,7 +1429,7 @@ public abstract class Connection",
"removed": [
" synchronized public void setTypeMap(java.util.Map map) throws SQLException {"
]
},
{
"added": [
" Set<UnitOfWorkListener> keySet = CommitAndRollbackListeners_.keySet();",
" for (Iterator<UnitOfWorkListener> i = keySet.iterator(); i.hasNext();) {",
" i.next().completeLocalCommit(i);"
],
"header": "@@ -2024,10 +2033,9 @@ public abstract class Connection",
"removed": [
" \tjava.util.Set keySet = CommitAndRollbackListeners_.keySet();",
" for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" UnitOfWorkListener listener = (UnitOfWorkListener) i.next();",
" listener.completeLocalCommit(i);"
]
},
{
"added": [
" Set<UnitOfWorkListener> keySet = CommitAndRollbackListeners_.keySet();",
" for (Iterator<UnitOfWorkListener> i = keySet.iterator(); i.hasNext();) {",
" i.next().completeLocalRollback(i);"
],
"header": "@@ -2041,10 +2049,9 @@ public abstract class Connection",
"removed": [
" \tjava.util.Set keySet = CommitAndRollbackListeners_.keySet();",
" \tfor (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" UnitOfWorkListener listener = (UnitOfWorkListener) i.next();",
" listener.completeLocalRollback(i);"
]
},
{
"added": [
" Set<UnitOfWorkListener> keySet = CommitAndRollbackListeners_.keySet();",
" for (Iterator<UnitOfWorkListener> i = keySet.iterator(); i.hasNext();) {",
" UnitOfWorkListener listener = i.next();"
],
"header": "@@ -2057,9 +2064,9 @@ public abstract class Connection",
"removed": [
" java.util.Set keySet = CommitAndRollbackListeners_.keySet();",
" for (java.util.Iterator i = keySet.iterator(); i.hasNext();) {",
" UnitOfWorkListener listener = (UnitOfWorkListener) i.next();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Cursor.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;"
],
"header": "@@ -30,6 +30,7 @@ import java.io.ObjectInputStream;",
"removed": []
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogWriter.java",
"hunks": [
{
"added": [
"import java.io.IOException;",
"import java.io.PrintWriter;",
"import java.security.AccessController;",
"import java.security.PrivilegedExceptionAction;"
],
"header": "@@ -21,17 +21,17 @@",
"removed": [
"import java.security.AccessController;",
"",
"",
""
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalCallableStatement.java",
"hunks": [
{
"added": [
" public Object getObject(int i, Map<String, Class<?>> map) throws SQLException {"
],
"header": "@@ -267,7 +267,7 @@ public class LogicalCallableStatement",
"removed": [
" public Object getObject(int i, Map map) throws SQLException {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalConnection.java",
"hunks": [
{
"added": [
"import java.util.Map;",
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -20,9 +20,10 @@",
"removed": [
"import org.apache.derby.shared.common.reference.SQLState;"
]
},
{
"added": [
" synchronized public Map<String, Class<?>> getTypeMap() throws SQLException {"
],
"header": "@@ -444,7 +445,7 @@ public class LogicalConnection implements java.sql.Connection {",
"removed": [
" synchronized public java.util.Map getTypeMap() throws SQLException {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalConnection40.java",
"hunks": [
{
"added": [
"import java.sql.SQLClientInfoException;",
"import java.sql.SQLXML;"
],
"header": "@@ -23,19 +23,17 @@ package org.apache.derby.client.am;",
"removed": [
"import java.sql.SQLClientInfoException;",
"import java.sql.SQLXML;",
"",
"import java.util.Map;"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/PreparedStatement.java",
"hunks": [
{
"added": [
" private ArrayList<int[]> parameterTypeList;"
],
"header": "@@ -70,7 +70,7 @@ public class PreparedStatement extends Statement",
"removed": [
" private ArrayList parameterTypeList;"
]
},
{
"added": [
" parameterTypeList = new ArrayList<int[]>();"
],
"header": "@@ -1614,7 +1614,7 @@ public class PreparedStatement extends Statement",
"removed": [
" parameterTypeList = new ArrayList();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/SectionManager.java",
"hunks": [
{
"added": [
"import java.util.Hashtable;",
"import java.util.Stack;"
],
"header": "@@ -22,8 +22,8 @@",
"removed": [
"",
""
]
},
{
"added": [
" private final Stack<Section> freeSectionsNonHold_;",
" private final Stack<Section> freeSectionsHold_;"
],
"header": "@@ -44,8 +44,8 @@ public class SectionManager {",
"removed": [
" java.util.Stack freeSectionsNonHold_ = null;",
" java.util.Stack freeSectionsHold_ = null;"
]
},
{
"added": [
" private final Hashtable<String, Section>",
" positionedUpdateCursorNameToQuerySection_ =",
" new Hashtable<String, Section>();",
" private final Hashtable<String, WeakReference<ResultSet>>",
" positionedUpdateCursorNameToResultSet_ =",
" new Hashtable<String, WeakReference<ResultSet>>();"
],
"header": "@@ -74,11 +74,15 @@ public class SectionManager {",
"removed": [
" private java.util.Hashtable positionedUpdateCursorNameToQuerySection_ = new java.util.Hashtable();",
" private java.util.Hashtable positionedUpdateCursorNameToResultSet_ = new java.util.Hashtable();"
]
},
{
"added": [
" freeSectionsNonHold_ = new Stack<Section>();",
" freeSectionsHold_ = new Stack<Section>();"
],
"header": "@@ -88,8 +92,8 @@ public class SectionManager {",
"removed": [
" freeSectionsNonHold_ = new java.util.Stack();",
" freeSectionsHold_ = new java.util.Stack();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Statement.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;"
],
"header": "@@ -21,8 +21,8 @@",
"removed": [
""
]
},
{
"added": [
" protected ArrayList<String> timeoutArrayList = new ArrayList<String>(1);"
],
"header": "@@ -136,7 +136,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" protected java.util.ArrayList timeoutArrayList = new java.util.ArrayList(1);"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/StatementCacheInteractor.java",
"hunks": [
{
"added": [],
"header": "@@ -24,10 +24,7 @@ package org.apache.derby.client.am;",
"removed": [
"",
"import java.util.Iterator;",
""
]
},
{
"added": [
" private final ArrayList<LogicalStatementEntity> openLogicalStatements =",
" new ArrayList<LogicalStatementEntity>();"
],
"header": "@@ -62,7 +59,8 @@ public final class StatementCacheInteractor {",
"removed": [
" private final ArrayList openLogicalStatements = new ArrayList();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/stmtcache/JDBCStatementCache.java",
"hunks": [
{
"added": [
" private final LinkedHashMap<StatementKey, PreparedStatement> statements;"
],
"header": "@@ -53,7 +53,7 @@ public final class JDBCStatementCache {",
"removed": [
" private final LinkedHashMap statements;"
]
},
{
"added": [
" return statements.remove(statementKey);"
],
"header": "@@ -83,7 +83,7 @@ public final class JDBCStatementCache {",
"removed": [
" return (PreparedStatement)this.statements.remove(statementKey);"
]
},
{
"added": [
" private static class BoundedLinkedHashMap",
" extends LinkedHashMap<StatementKey, PreparedStatement> {"
],
"header": "@@ -117,7 +117,8 @@ public final class JDBCStatementCache {",
"removed": [
" private static class BoundedLinkedHashMap extends LinkedHashMap {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/CodePointNameTable.java",
"hunks": [
{
"added": [
"class CodePointNameTable extends java.util.Hashtable<Integer, String> {"
],
"header": "@@ -27,7 +27,7 @@ package org.apache.derby.client.net;",
"removed": [
"class CodePointNameTable extends java.util.Hashtable {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetConnection40.java",
"hunks": [
{
"added": [],
"header": "@@ -22,8 +22,6 @@",
"removed": [
"import org.apache.derby.client.am.SQLExceptionFactory;",
"import org.apache.derby.client.am.SqlException;"
]
},
{
"added": [
"import org.apache.derby.client.am.SQLExceptionFactory;",
"import org.apache.derby.client.am.SqlException;"
],
"header": "@@ -32,12 +30,13 @@ import java.sql.SQLException;",
"removed": [
"import java.util.Map;"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetCursor.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.HashMap;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.SqlCode;"
],
"header": "@@ -21,17 +21,19 @@",
"removed": [
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.SqlCode;"
]
},
{
"added": [
" HashMap<Integer, Integer> extdtaPositions_;",
"",
" /**",
" * Queue to hold EXTDTA data that hasn't been correlated to its",
" * column number.",
" */",
" ArrayList<byte[]> extdtaData_;"
],
"header": "@@ -55,8 +57,13 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" java.util.HashMap extdtaPositions_;",
" java.util.ArrayList extdtaData_; // queue to hold EXTDTA data that hasn't been correlated to its column #"
]
},
{
"added": [
" extdtaPositions_ = new HashMap<Integer, Integer>();",
" extdtaData_ = new ArrayList<byte[]>();"
],
"header": "@@ -74,8 +81,8 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" extdtaPositions_ = new java.util.HashMap();",
" extdtaData_ = new java.util.ArrayList();"
]
},
{
"added": [
" data = extdtaData_.get(extdtaQueuePosition);"
],
"header": "@@ -882,7 +889,7 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" data = (byte[]) (extdtaData_.get(extdtaQueuePosition));"
]
},
{
"added": [
" columnDataPosition = columnDataPositionCache_.get(row);"
],
"header": "@@ -1138,7 +1145,7 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" columnDataPosition = (int[]) columnDataPositionCache_.get(row);"
]
},
{
"added": [
" columnDataComputedLength = columnDataLengthCache_.get(row);"
],
"header": "@@ -1149,7 +1156,7 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" columnDataComputedLength = (int[]) columnDataLengthCache_.get(row);"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetStatementReply.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.List;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -22,24 +22,23 @@",
"removed": [
"",
"import org.apache.derby.client.am.SqlState;",
"import org.apache.derby.client.am.ClientJDBCObjectFactory;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.shared.common.reference.SQLState;"
]
},
{
"added": [
" List<Section> sectionAL = parseRSLSETRM();"
],
"header": "@@ -371,7 +370,7 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" java.util.ArrayList sectionAL = parseRSLSETRM();"
]
},
{
"added": [
" NetResultSet netResultSet =",
" parseResultSetCursor(statementI, sectionAL.get(i));"
],
"header": "@@ -405,7 +404,8 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" NetResultSet netResultSet = parseResultSetCursor(statementI, (Section) sectionAL.get(i));"
]
},
{
"added": [
" private List<Section> parseRSLSETRM() throws DisconnectException {",
" List<Section> pkgsnlst = null;"
],
"header": "@@ -1142,11 +1142,11 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" protected java.util.ArrayList parseRSLSETRM() throws DisconnectException {",
" java.util.ArrayList pkgsnlst = null;"
]
},
{
"added": [
" protected Section parsePKGNAMCSN(boolean skip) throws DisconnectException {"
],
"header": "@@ -1545,7 +1545,7 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" protected Object parsePKGNAMCSN(boolean skip) throws DisconnectException {"
]
},
{
"added": [
" private List<Section> parsePKGSNLST() throws DisconnectException {",
" ArrayList<Section> pkgsnlst = new ArrayList<Section>();",
" pkgsnlst.add(parsePKGNAMCSN(false));"
],
"header": "@@ -1725,15 +1725,13 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" protected java.util.ArrayList parsePKGSNLST() throws DisconnectException {",
" Object pkgnamcsn = null;",
" java.util.ArrayList pkgsnlst = new java.util.ArrayList(); // what default size should we use",
" pkgnamcsn = parsePKGNAMCSN(false);",
" pkgsnlst.add(pkgnamcsn);"
]
},
{
"added": [
" private int parseSQLRSLRD(List<Section> sections)",
" throws DisconnectException {",
" return parseSQLRSLRDarray(sections);"
],
"header": "@@ -1745,9 +1743,10 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" protected int parseSQLRSLRD(java.util.ArrayList sectionAL) throws DisconnectException {",
" return parseSQLRSLRDarray(sectionAL);"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetStatementRequest.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.HashMap;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.DateTimeValue;",
"import org.apache.derby.client.am.Lob;",
"import org.apache.derby.iapi.reference.DRDAConstants;",
" // Integers: build EXTDTA for column i",
" private ArrayList<Integer> extdtaPositions_ = null;"
],
"header": "@@ -23,25 +23,28 @@ package org.apache.derby.client.net;",
"removed": [
"import org.apache.derby.iapi.reference.DRDAConstants;",
"import org.apache.derby.client.am.Lob;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.DateTimeValue;",
" java.util.ArrayList extdtaPositions_ = null; // Integers: build EXTDTA for column i"
]
},
{
"added": [
" private final HashMap<Integer, Object> promototedParameters_ =",
" new HashMap<Integer, Object>();"
],
"header": "@@ -49,7 +52,8 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" java.util.HashMap promototedParameters_ = new java.util.HashMap();"
]
},
{
"added": [
" int index = extdtaPositions_.get(i);"
],
"header": "@@ -927,7 +931,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" int index = ((Integer) extdtaPositions_.get(i)).intValue();"
]
},
{
"added": [
" return promototedParameters_.get(index);"
],
"header": "@@ -1117,7 +1121,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" return promototedParameters_.get(new Integer(index));"
]
},
{
"added": [
" promototedParameters_.put(i, c);"
],
"header": "@@ -1192,7 +1196,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" promototedParameters_.put(new Integer(i), c);"
]
},
{
"added": [
" promototedParameters_.put(i, c);"
],
"header": "@@ -1340,7 +1344,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" promototedParameters_.put(new Integer(i), c);"
]
},
{
"added": [
" promototedParameters_.put(i, b);"
],
"header": "@@ -1367,7 +1371,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" promototedParameters_.put(new Integer(i), b);"
]
},
{
"added": [
" promototedParameters_.put(i, b);"
],
"header": "@@ -1388,7 +1392,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" promototedParameters_.put(new Integer(i), b);"
]
},
{
"added": [
" extdtaPositions_ = new ArrayList<Integer>();",
" extdtaPositions_.add(i);"
],
"header": "@@ -1775,9 +1779,9 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" extdtaPositions_ = new java.util.ArrayList();",
" extdtaPositions_.add(new Integer(i));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetXAConnectionReply.java",
"hunks": [
{
"added": [],
"header": "@@ -149,7 +149,6 @@ public class NetXAConnectionReply extends NetResultSetReply {",
"removed": [
" java.util.Hashtable indoubtTransactions = null;"
]
},
{
"added": [
" conn.setIndoubtTransactions(parseIndoubtList());"
],
"header": "@@ -183,8 +182,7 @@ public class NetXAConnectionReply extends NetResultSetReply {",
"removed": [
" indoubtTransactions = parseIndoubtList();",
" conn.setIndoubtTransactions(indoubtTransactions);"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/OpenSocketAction.java",
"hunks": [
{
"added": [
"import java.net.Socket;",
"import java.security.PrivilegedExceptionAction;",
"public class OpenSocketAction implements PrivilegedExceptionAction<Socket> {"
],
"header": "@@ -21,12 +21,12 @@",
"removed": [
"import javax.net.ssl.SSLServerSocketFactory;",
"import javax.net.ssl.SSLSocket;",
"public class OpenSocketAction implements java.security.PrivilegedExceptionAction {"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientBaseDataSource.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.io.Serializable;",
"import java.security.AccessController;",
"import java.security.PrivilegedAction;",
"import java.util.NoSuchElementException;",
"import java.util.Properties;",
"import java.util.StringTokenizer;",
"import javax.naming.Reference;",
"import javax.naming.Referenceable;",
"import org.apache.derby.client.ClientDataSourceFactory;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.am.Connection;"
],
"header": "@@ -21,31 +21,30 @@",
"removed": [
"import java.io.Serializable;",
"import java.io.PrintWriter;",
"import java.security.AccessController;",
"import java.util.Properties;",
"import java.util.StringTokenizer;",
"import java.util.NoSuchElementException;",
"",
"import javax.naming.Referenceable;",
"import javax.naming.Reference;",
"",
"import org.apache.derby.client.am.Connection;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.client.ClientDataSourceFactory;"
]
},
{
"added": [
" return AccessController.doPrivileged(new PrivilegedAction<String>() {",
" public String run() {"
],
"header": "@@ -445,9 +444,8 @@ public abstract class ClientBaseDataSource implements Serializable, Referenceabl",
"removed": [
" \treturn (String )AccessController.doPrivileged",
" \t (new java.security.PrivilegedAction(){",
" \t\t public Object run(){"
]
}
]
}
] |
derby-DERBY-5840-503b49c4
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Fix compiler warning in CursorNode.init() by changing parameter from
List<String> to String[] so that the cast from Object can be checked.
Fix compiler warning in TriggerEventActivator by using a List instead
of an array to store generic types.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485984 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CursorNode.java",
"hunks": [
{
"added": [
"import java.util.Arrays;"
],
"header": "@@ -22,6 +22,7 @@",
"removed": []
},
{
"added": [
" * @param updatableColumns The array of updatable columns specified by"
],
"header": "@@ -91,13 +92,12 @@ public class CursorNode extends DMLStatementNode",
"removed": [
"\t * @param updatableColumns The list of updatable columns specified by",
" @SuppressWarnings(\"unchecked\")"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/TriggerEventActivator.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.List;"
],
"header": "@@ -21,6 +21,8 @@",
"removed": []
},
{
"added": [
" List<List<TriggerDescriptor>> executorLists =",
" new ArrayList<List<TriggerDescriptor>>(TriggerEvent.MAX_EVENTS);",
" executorLists.add(new ArrayList<TriggerDescriptor>());"
],
"header": "@@ -128,21 +130,15 @@ public class TriggerEventActivator",
"removed": [
"",
" /** Perform the cast needed to a list of triggers from the executorLists */",
" @SuppressWarnings(\"unchecked\")",
" private Vector<TriggerDescriptor> getTriggers( int idx, Vector[] executorLists )",
" {",
" return (Vector<TriggerDescriptor>) executorLists[ idx ];",
" }",
"\t\tVector[] executorLists = new Vector[TriggerEvent.MAX_EVENTS];",
"\t\t\texecutorLists[i] = new Vector<TriggerDescriptor>();"
]
},
{
"added": [
" executorLists.get(TriggerEvent.BEFORE_INSERT).add(td);",
" executorLists.get(TriggerEvent.AFTER_INSERT).add(td);"
],
"header": "@@ -153,11 +149,11 @@ public class TriggerEventActivator",
"removed": [
"\t\t\t\t\t\tgetTriggers( TriggerEvent.BEFORE_INSERT, executorLists ).addElement( td );",
"\t\t\t\t\t\tgetTriggers( TriggerEvent.AFTER_INSERT, executorLists ).addElement( td );"
]
},
{
"added": [
" executorLists.get(TriggerEvent.BEFORE_DELETE).add(td);",
" executorLists.get(TriggerEvent.AFTER_DELETE).add(td);",
" executorLists.get(TriggerEvent.BEFORE_UPDATE).add(td);",
" executorLists.get(TriggerEvent.AFTER_UPDATE).add(td);"
],
"header": "@@ -165,22 +161,22 @@ public class TriggerEventActivator",
"removed": [
"\t\t\t\t\t\tgetTriggers( TriggerEvent.BEFORE_DELETE, executorLists ).addElement( td );",
"\t\t\t\t\t\tgetTriggers( TriggerEvent.AFTER_DELETE, executorLists ).addElement( td );",
"\t\t\t\t\t\tgetTriggers( TriggerEvent.BEFORE_UPDATE, executorLists ).addElement( td );",
"\t\t\t\t\t\tgetTriggers( TriggerEvent.AFTER_UPDATE, executorLists ).addElement( td );"
]
},
{
"added": [
" for (int i = 0; i < executorLists.size(); i++)",
" List<TriggerDescriptor> descriptors = executorLists.get(i);",
" int size = descriptors.size();",
" TriggerDescriptor td = descriptors.get(j);"
],
"header": "@@ -191,15 +187,16 @@ public class TriggerEventActivator",
"removed": [
"\t\tfor (int i = 0; i < executorLists.length; i++)",
"\t\t\tint size = executorLists[i].size();",
"\t\t\t\t\tTriggerDescriptor td = (TriggerDescriptor)executorLists[i].elementAt(j);"
]
}
]
}
] |
derby-DERBY-5840-654f47f6
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Simplifications enabled by the original cleanup of the compatibility tests.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1359069 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5840-850aba4e
|
DERBY-5840: Compile embedded JDBC 3.0 classes for Java 5
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1364917 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement30.java",
"hunks": [
{
"added": [],
"header": "@@ -22,13 +22,9 @@",
"removed": [
"import java.math.BigDecimal;",
"",
"import java.util.Calendar;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java",
"hunks": [
{
"added": [
" public java.util.Map<String, Class<?>> getTypeMap() throws SQLException"
],
"header": "@@ -336,7 +336,7 @@ public abstract class BrokeredConnection implements EngineConnection",
"removed": [
" public java.util.Map getTypeMap() throws SQLException"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection40.java",
"hunks": [
{
"added": [
"import java.sql.SQLClientInfoException;"
],
"header": "@@ -24,8 +24,8 @@ package org.apache.derby.iapi.jdbc;",
"removed": [
"import java.sql.SQLClientInfoException;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/JDBCBoot.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.util.Properties;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.services.property.PropertyUtil;"
],
"header": "@@ -21,15 +21,13 @@",
"removed": [
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.jdbc.AuthenticationService;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"",
"import java.util.Properties;",
"import java.io.PrintStream;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/security/SecurityUtil.java",
"hunks": [
{
"added": [
" final Set<SystemPrincipal> principals = new HashSet<SystemPrincipal>();"
],
"header": "@@ -54,7 +54,7 @@ public class SecurityUtil {",
"removed": [
" final Set principals = new HashSet();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/services/monitor/Monitor.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.util.Locale;",
"import java.util.Properties;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.reference.EngineType;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;"
],
"header": "@@ -21,24 +21,20 @@",
"removed": [
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;",
"import org.apache.derby.iapi.services.info.ProductGenusNames;",
"import org.apache.derby.iapi.reference.EngineType;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"",
"",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.reference.Property;",
"",
"import java.util.Properties;",
"import java.util.Locale;",
"import java.io.PrintStream;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"hunks": [
{
"added": [
"import java.sql.Savepoint;"
],
"header": "@@ -70,6 +70,7 @@ import java.sql.DatabaseMetaData;",
"removed": []
},
{
"added": [
"import org.apache.derby.iapi.reference.Limits;",
"import org.apache.derby.iapi.sql.conn.StatementContext;"
],
"header": "@@ -81,6 +82,8 @@ import java.util.Iterator;",
"removed": []
},
{
"added": [
" <LI> JDBC 3.0",
"public class EmbedConnection implements EngineConnection"
],
"header": "@@ -106,14 +109,14 @@ import org.apache.derby.impl.jdbc.authentication.NoneAuthenticationServiceImpl;",
"removed": [
" <LI> JDBC 2.0",
"public abstract class EmbedConnection implements EngineConnection"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedSavepoint.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.impl.jdbc.EmbedSavepoint"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.impl.jdbc.EmbedSavepoint30"
]
},
{
"added": [
"import java.sql.Savepoint;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.reference.SQLState;",
" * This class implements the Savepoint interface from JDBC 3.0."
],
"header": "@@ -21,19 +21,13 @@",
"removed": [
"import org.apache.derby.impl.jdbc.EmbedConnection;",
"import org.apache.derby.impl.jdbc.ConnectionChild;",
"import org.apache.derby.impl.jdbc.Util;",
"",
"import org.apache.derby.iapi.reference.SQLState;",
"",
"import org.apache.derby.iapi.error.StandardException;",
"",
"import java.sql.Savepoint;",
" * This class implements the Savepoint interface from JDBC3.0"
]
},
{
"added": [
"final class EmbedSavepoint extends ConnectionChild"
],
"header": "@@ -48,7 +42,7 @@ import java.sql.SQLException;",
"removed": [
"final class EmbedSavepoint30 extends ConnectionChild"
]
},
{
"added": [
" EmbedSavepoint(EmbedConnection conn, String name)"
],
"header": "@@ -66,7 +60,7 @@ final class EmbedSavepoint30 extends ConnectionChild",
"removed": [
" EmbedSavepoint30(EmbedConnection conn, String name)"
]
},
{
"added": [
" \t\tif (savepointID == -1) {",
" }"
],
"header": "@@ -91,8 +85,9 @@ final class EmbedSavepoint30 extends ConnectionChild",
"removed": [
" \t\tif (savepointID == -1)"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/authentication/LDAPAuthenticationSchemeImpl.java",
"hunks": [
{
"added": [
"import java.util.Properties;",
"import javax.naming.*;",
"import javax.naming.directory.*;",
"import org.apache.derby.authentication.UserAuthenticator;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"import org.apache.derby.iapi.util.StringUtil;"
],
"header": "@@ -21,28 +21,19 @@",
"removed": [
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.jdbc.AuthenticationService;",
"",
"import org.apache.derby.authentication.UserAuthenticator;",
"",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"import org.apache.derby.iapi.util.StringUtil;",
"",
"import javax.naming.*;",
"import javax.naming.directory.*;",
"",
"",
"import java.util.Properties;",
"import java.sql.SQLException;"
]
},
{
"added": [
" return AccessController.doPrivileged(",
" new PrivilegedExceptionAction<DirContext>() {",
" public DirContext run() throws NamingException {",
" });",
" } catch (PrivilegedActionException pae) {",
" throw (NamingException) pae.getCause();",
" }",
" }"
],
"header": "@@ -206,22 +197,16 @@ extends JNDIAuthenticationSchemeBase",
"removed": [
" return ((InitialDirContext)AccessController.doPrivileged(",
" new PrivilegedExceptionAction() {",
" public Object run() throws SecurityException, NamingException {",
" }));",
" } catch (PrivilegedActionException pae) {",
" Exception e = pae.getException();",
" ",
" if (e instanceof NamingException)",
" throw (NamingException)e;",
" else",
" throw (SecurityException)e;",
" } ",
" ",
" } "
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java",
"hunks": [
{
"added": [],
"header": "@@ -36,7 +36,6 @@ import org.apache.derby.iapi.services.context.ContextManager;",
"removed": [
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;"
]
},
{
"added": [],
"header": "@@ -72,7 +71,6 @@ import java.io.PrintWriter;",
"removed": [
"import java.io.PrintStream;"
]
},
{
"added": [
"\tprivate PrintWriter logging;"
],
"header": "@@ -127,7 +125,7 @@ abstract class BaseMonitor",
"removed": [
"\tprivate PrintStream logging;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/monitor/FileMonitor.java",
"hunks": [
{
"added": [
"import java.io.FileInputStream;",
"import java.io.PrintWriter;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.services.info.ProductGenusNames;",
"import org.apache.derby.iapi.services.info.ProductVersionHolder;",
"import org.apache.derby.iapi.services.io.FileUtil;"
],
"header": "@@ -21,22 +21,19 @@",
"removed": [
"import org.apache.derby.iapi.reference.Property;",
"",
"import org.apache.derby.iapi.services.io.FileUtil;",
"import org.apache.derby.iapi.services.info.ProductVersionHolder;",
"import org.apache.derby.iapi.services.info.ProductGenusNames;",
"",
"import java.io.FileInputStream;",
"",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver169.java",
"hunks": [
{
"added": [
" return new EmbedConnection(this, url, info);"
],
"header": "@@ -57,7 +57,7 @@ public class Driver169 extends InternalDriver {",
"removed": [
"\t\treturn new EmbedConnection30(this, url, info);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver30.java",
"hunks": [
{
"added": [
" return new EmbedConnection(conn);"
],
"header": "@@ -62,12 +62,7 @@ public class Driver30 extends Driver20 {",
"removed": [
"\t\tif (SanityManager.DEBUG)",
"\t\t{",
"\t\t\tSanityManager.ASSERT(conn instanceof EmbedConnection30,",
"\t\t\t\t\"conn expected to be instanceof EmbedConnection30\");",
"\t\t}",
"\t\treturn new EmbedConnection30(conn);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver40.java",
"hunks": [
{
"added": [],
"header": "@@ -29,7 +29,6 @@ import org.apache.derby.iapi.sql.ResultSet;",
"removed": [
"import org.apache.derby.impl.jdbc.EmbedConnection30;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java",
"hunks": [
{
"added": [
" private ArrayList<ConnectionEventListener> eventListener;"
],
"header": "@@ -71,7 +71,7 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
" private ArrayList eventListener;"
]
},
{
"added": [
" ArrayList<ConnectionEventListener> tmpEventListener = eventListener;"
],
"header": "@@ -198,7 +198,7 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
"\t\t\tArrayList tmpEventListener = eventListener;"
]
},
{
"added": [
" eventListener = new ArrayList<ConnectionEventListener>();",
" eventListener =",
" new ArrayList<ConnectionEventListener>(eventListener);"
],
"header": "@@ -279,13 +279,14 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
" eventListener = new ArrayList();",
" eventListener = (ArrayList) eventListener.clone();"
]
},
{
"added": [
" eventListener =",
" new ArrayList<ConnectionEventListener>(eventListener);"
],
"header": "@@ -303,7 +304,8 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
" eventListener = (ArrayList) eventListener.clone();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDriver.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import java.sql.Driver;",
"import java.sql.DriverManager;",
"import org.apache.derby.iapi.reference.Attribute;"
],
"header": "@@ -21,19 +21,15 @@",
"removed": [
"import java.sql.DriverManager;",
"import java.sql.Driver;",
"",
"import java.io.PrintStream;",
"",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.services.i18n.MessageService;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/ResourceAdapterImpl.java",
"hunks": [
{
"added": [
" private Hashtable<XAXactId, XATransactionState> connectionTable;"
],
"header": "@@ -51,7 +51,7 @@ public class ResourceAdapterImpl",
"removed": [
"\tprivate Hashtable connectionTable;"
]
},
{
"added": [
" connectionTable = new Hashtable<XAXactId, XATransactionState>();"
],
"header": "@@ -63,7 +63,7 @@ public class ResourceAdapterImpl",
"removed": [
"\t\tconnectionTable = new Hashtable();"
]
},
{
"added": [
" for (Enumeration<XATransactionState> e = connectionTable.elements();",
" e.hasMoreElements(); ) {",
" XATransactionState tranState = e.nextElement();"
],
"header": "@@ -77,9 +77,10 @@ public class ResourceAdapterImpl",
"removed": [
"\t\tfor (Enumeration e = connectionTable.elements(); e.hasMoreElements(); ) {",
"\t\t\tXATransactionState tranState = (XATransactionState) e.nextElement();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/XATransactionState.java",
"hunks": [
{
"added": [
" HashMap<EmbedXAResource, XATransactionState> suspendedList;"
],
"header": "@@ -67,7 +67,7 @@ final class XATransactionState extends ContextImpl {",
"removed": [
"\tHashMap suspendedList;"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/unitTests/harness/UnitTestMain.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
"import org.apache.derby.iapi.services.monitor.Monitor;"
],
"header": "@@ -21,11 +21,9 @@",
"removed": [
"import org.apache.derby.iapi.services.monitor.Monitor;",
"",
"import org.apache.derbyTesting.unitTests.harness.UnitTestManager;",
""
]
},
{
"added": [
" Monitor.startMonitor(bootProperties, new PrintWriter(System.err, true));"
],
"header": "@@ -48,6 +46,6 @@ public class UnitTestMain {",
"removed": [
"\t\tMonitor.startMonitor(bootProperties, System.err);"
]
}
]
}
] |
derby-DERBY-5840-89e145b7
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Fix unchecked warning in GroupedAggregateResultSet by changing the type
of the distinctValues field from HashSet[][] to List<List<Set<String>>>.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1486028 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/execute/GroupedAggregateResultSet.java",
"hunks": [
{
"added": [
"import java.util.Set;"
],
"header": "@@ -25,6 +25,7 @@ import java.util.ArrayList;",
"removed": []
},
{
"added": [
" private List<List<Set<String>>> distinctValues;"
],
"header": "@@ -120,7 +121,7 @@ class GroupedAggregateResultSet extends GenericAggregateResultSet",
"removed": [
"\tprivate HashSet [][]\t\t\tdistinctValues;"
]
},
{
"added": [
" {",
" distinctValues =",
" new ArrayList<List<Set<String>>>(resultRows.length);",
" }",
" {",
" distinctValues.add(",
" new ArrayList<Set<String>>(aggregates.length));",
" initializeDistinctMaps(r, true);",
" }"
],
"header": "@@ -238,15 +239,21 @@ class GroupedAggregateResultSet extends GenericAggregateResultSet",
"removed": [
"\t\t\t distinctValues = new HashSet[resultRows.length][aggregates.length];",
"\t\t\t\t\tdistinctValues[r] = new HashSet[aggregates.length];",
"\t\t\t\tinitializeDistinctMaps(r, true);"
]
},
{
"added": [
" String str = newValue.getString();",
" if (str != null && !distinctValues.get(level).get(i).add(str))",
" // The value was already in the set, and we only look",
" // for distinct values. Skip this value.",
" continue;"
],
"header": "@@ -757,12 +764,12 @@ class GroupedAggregateResultSet extends GenericAggregateResultSet",
"removed": [
"\t\t\t\tif (newValue.getString() != null)",
"\t\t\t\t\tif (distinctValues[level][i].contains(",
"\t\t\t\t\t\t newValue.getString()))",
"\t\t\t\t\t\tcontinue;",
" addDistinctValue( level, i, newValue );"
]
},
{
"added": [],
"header": "@@ -771,16 +778,6 @@ class GroupedAggregateResultSet extends GenericAggregateResultSet",
"removed": [
" /** Helper routine to do casting to shut up the compiler */",
" @SuppressWarnings(\"unchecked\")",
" private void addDistinctValue( int level, int aggregateNumber, DataValueDescriptor newValue )",
"\t\tthrows StandardException",
" {",
" HashSet<String> set = (HashSet<String>) distinctValues[ level ][ aggregateNumber ];",
"",
" set.add( newValue.getString() );",
" }",
""
]
},
{
"added": [
"",
" if (allocate) {",
" // Allocate an empty set if the aggregate is distinct.",
" // Otherwise, insert null so that the list is of the right",
" // size and the indexes match those in aggregates[].",
" distinctValues.get(r).add(aInfo.isDistinct() ?",
" new HashSet<String>() : null);",
" }",
"",
" Set<String> set = distinctValues.get(r).get(a);",
" set.clear();",
" set.add(newValue.getString());"
],
"header": "@@ -788,15 +785,22 @@ class GroupedAggregateResultSet extends GenericAggregateResultSet",
"removed": [
"\t\t\t\tif (allocate)",
"\t\t\t\t\tdistinctValues[r][a] = new HashSet<String>();",
"\t\t\t\telse",
"\t\t\t\t\tdistinctValues[r][a].clear();",
" addDistinctValue( r, a, newValue );"
]
}
]
}
] |
derby-DERBY-5840-8b47bc7a
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Refactor ClassSizeCatalog to prevent unchecked conversion warnings when
ClassSize creates an instance via reflection and casts the result to
Hashtable<String, int[]>.
Introduce a new abstract ClassSizeCatalog class and rename the generated
class to ClassSizeCatalogImpl, which extends ClassSizeCatalog. ClassSize
can now access the catalog via the abstract class instead of casting it
unchecked to Hashtable<String, int[]>.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485322 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/build/org/apache/derbyBuild/ClassSizeCrawler.java",
"hunks": [
{
"added": [],
"header": "@@ -27,15 +27,8 @@ import java.io.File;",
"removed": [
"import java.io.FileOutputStream;",
"import java.io.ObjectOutput;",
"import java.io.ObjectOutputStream;",
"import java.lang.SecurityException;",
"import java.lang.ClassNotFoundException;",
"import java.util.Calendar;",
"import java.util.Date;"
]
},
{
"added": [
" * <i>work-space</i>/java/org.apache.derby.iapi.services.cache.ClassSizeCatalogImpl.java."
],
"header": "@@ -56,7 +49,7 @@ import java.util.Date;",
"removed": [
" * <i>work-space</i>/java/org.apache.derby.iapi.services.cache.ClassSizeCatalog.java."
]
},
{
"added": [
" System.getProperty( \"out\", WS + \"/java/org.apache.derby.iapi.services.cache.ClassSizeCatalogImpl.java\");"
],
"header": "@@ -178,7 +171,7 @@ public class ClassSizeCrawler",
"removed": [
" System.getProperty( \"out\", WS + \"/java/org.apache.derby.iapi.services.cache.ClassSizeCatalog.java\");"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/services/cache/ClassSize.java",
"hunks": [
{
"added": [],
"header": "@@ -29,7 +29,6 @@ import java.security.AccessController;",
"removed": [
"@SuppressWarnings(\"unchecked\")"
]
},
{
"added": [],
"header": "@@ -56,20 +55,8 @@ public class ClassSize",
"removed": [
" /* Do not let the compiler see ClassSizeCatalog. Otherwise it will try to",
" * compile it. This may fail because ClassSizeCatalog.java is not created",
" * until everything else has been compiled. Bury ClassSizeCatalog in a string.",
" */",
" private static java.util.Hashtable<String,int[]> catalog;",
" try",
" {",
" catalog = (java.util.Hashtable<String,int[]>)",
" Class.forName( \"org.apache.derby.iapi.services.cache.ClassSizeCatalog\").newInstance();",
" }",
" catch( Exception e){}",
""
]
}
]
}
] |
derby-DERBY-5840-9548d383
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Make DataValueDescriptor.setBigDecimal() take a BigDecimal instead of
a Number. The argument is always null or a BigDecimal instance, but
its declared type had to be Number in order to compile on CDC, which
is no longer supported.
By making the declared type BigDecimal, we avoid an unchecked cast to
Comparable in NumberDataType's implementation of the method.
Also remove the classes that contain the CDC-specific implementation
of the DECIMAL data type.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485076 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/DataType.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;"
],
"header": "@@ -28,6 +28,7 @@ import org.apache.derby.iapi.services.sanity.SanityManager;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/DataValueDescriptor.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;"
],
"header": "@@ -24,11 +24,11 @@ package org.apache.derby.iapi.types;",
"removed": [
"import org.apache.derby.iapi.types.Orderable;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/NumberDataType.java",
"hunks": [
{
"added": [],
"header": "@@ -26,7 +26,6 @@ import java.math.BigDecimal;",
"removed": [
"import org.apache.derby.iapi.services.io.Storable;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/SQLBoolean.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;"
],
"header": "@@ -35,6 +35,7 @@ import org.apache.derby.iapi.util.StringUtil;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/SQLChar.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;"
],
"header": "@@ -55,6 +55,7 @@ import java.io.IOException;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/SQLClob.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;"
],
"header": "@@ -41,6 +41,7 @@ import java.io.InputStream;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/SQLDouble.java",
"hunks": [
{
"added": [
"\tpublic void setBigDecimal(BigDecimal bigDecimal) throws StandardException"
],
"header": "@@ -435,7 +435,7 @@ public final class SQLDouble extends NumberDataType",
"removed": [
"\tpublic void setBigDecimal(Number bigDecimal) throws StandardException"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/SQLReal.java",
"hunks": [
{
"added": [
"\tpublic void setBigDecimal(BigDecimal bigDecimal) throws StandardException"
],
"header": "@@ -392,7 +392,7 @@ public final class SQLReal",
"removed": [
"\tpublic void setBigDecimal(Number bigDecimal) throws StandardException"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/types/UserType.java",
"hunks": [
{
"added": [
"import java.math.BigDecimal;",
""
],
"header": "@@ -41,6 +41,8 @@ import java.io.ObjectOutput;",
"removed": []
},
{
"added": [
"\tpublic void setBigDecimal(BigDecimal theValue)"
],
"header": "@@ -479,7 +481,7 @@ public class UserType extends DataType",
"removed": [
"\tpublic void setBigDecimal(Number theValue)"
]
}
]
}
] |
derby-DERBY-5840-9d44c9e9
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Clean up warnings in various test packages:
- derbynet
- perf
- system
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1482780 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/perf/clients/SequenceGeneratorConcurrency.java",
"hunks": [
{
"added": [],
"header": "@@ -27,7 +27,6 @@ import java.sql.PreparedStatement;",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
" private HashMap<String, int[]> _errorLog;"
],
"header": "@@ -163,7 +162,7 @@ public class SequenceGeneratorConcurrency",
"removed": [
" private HashMap _errorLog;"
]
},
{
"added": [
" _errorLog = new HashMap<String, int[]>();"
],
"header": "@@ -175,7 +174,7 @@ public class SequenceGeneratorConcurrency",
"removed": [
" _errorLog = new HashMap();"
]
},
{
"added": [
" for (String key : _errorLog.keySet()) {"
],
"header": "@@ -325,11 +324,7 @@ public class SequenceGeneratorConcurrency",
"removed": [
" Iterator keyIterator = _errorLog.keySet().iterator();",
"",
" while ( keyIterator.hasNext() )",
" {",
" String key = (String) keyIterator.next();"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/mailjdbc/utils/DbTasks.java",
"hunks": [
{
"added": [
"\t\t\tArrayList<Integer> idArray = new ArrayList<Integer>();"
],
"header": "@@ -662,8 +662,7 @@ public class DbTasks {",
"removed": [
"\t\t\tArrayList idArray = new ArrayList();",
"\t\t\tInteger id_element = new Integer(0);"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/oe/direct/StatementHelper.java",
"hunks": [
{
"added": [],
"header": "@@ -24,7 +24,6 @@ import java.sql.PreparedStatement;",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
" private Map<String, PreparedStatement> statements =",
" new IdentityHashMap<String, PreparedStatement>();"
],
"header": "@@ -60,7 +59,8 @@ class StatementHelper {",
"removed": [
" private Map statements = new IdentityHashMap();"
]
},
{
"added": [
" PreparedStatement ps = statements.get(sql);"
],
"header": "@@ -68,7 +68,7 @@ class StatementHelper {",
"removed": [
" PreparedStatement ps = (PreparedStatement) statements.get(sql);"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/optimizer/query/GenericQuery.java",
"hunks": [
{
"added": [
"\tprotected ArrayList<String> queries = new ArrayList<String>();",
"\tprotected ArrayList<String[]> prepStmtRunResults = new ArrayList<String[]>(); //times using PreparedStatement",
"\tprotected ArrayList<String[]> stmtRunResults = new ArrayList<String[]>(); //times using Statement"
],
"header": "@@ -44,9 +44,9 @@ import org.apache.derbyTesting.system.optimizer.utils.TestUtils;",
"removed": [
"\tprotected ArrayList queries=new ArrayList(); ",
"\tprotected ArrayList prepStmtRunResults=new ArrayList(); //times using PreparedStatement",
"\tprotected ArrayList stmtRunResults=new ArrayList(); //times using Statement"
]
},
{
"added": [
"\t\t\tqueries.add(prop.getProperty(queryName));"
],
"header": "@@ -59,7 +59,7 @@ public class GenericQuery {",
"removed": [
"\t\t\tqueries.add(prop.get(queryName));"
]
},
{
"added": [
"\t\t\t\tquery = queries.get(k);"
],
"header": "@@ -80,7 +80,7 @@ public class GenericQuery {",
"removed": [
"\t\t\t\tquery=(String)queries.get(k);"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/system/optimizer/query/QueryList.java",
"hunks": [
{
"added": [
"\tprivate static ArrayList<GenericQuery> qList = new ArrayList<GenericQuery>();"
],
"header": "@@ -34,7 +34,7 @@ import java.util.Properties;",
"removed": [
"\tprivate static ArrayList qList=new ArrayList();"
]
}
]
}
] |
derby-DERBY-5840-a045b639
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Make the declared type of the lock groups HashMap<Lock, Lock> instead
of HashMap<Lock, Object>.
Stop suppressing unchecked conversion warnings in
PropertyConglomerate, and make all conversions checked.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485609 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/locks/LockSpace.java",
"hunks": [
{
"added": [
" private final HashMap<Object, HashMap<Lock, Lock>> groups;"
],
"header": "@@ -53,7 +53,7 @@ import org.apache.derby.iapi.services.locks.LockOwner;",
"removed": [
"\tprivate final HashMap<Object,HashMap<Lock,Object>> groups;"
]
},
{
"added": [
" private final ArrayDeque<HashMap<Lock, Lock>> spareGroups =",
" new ArrayDeque<HashMap<Lock, Lock>>(MAX_CACHED_GROUPS);"
],
"header": "@@ -61,8 +61,8 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
" private final ArrayDeque<HashMap<Lock, Object>> spareGroups =",
" new ArrayDeque<HashMap<Lock, Object>>(MAX_CACHED_GROUPS);"
]
},
{
"added": [
" groups = new HashMap<Object, HashMap<Lock, Lock>>();"
],
"header": "@@ -76,7 +76,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tgroups = new HashMap<Object,HashMap<Lock,Object>>();"
]
},
{
"added": [
" HashMap<Lock, Lock> dl = groups.get(group);",
" lockInGroup = dl.get(lock);"
],
"header": "@@ -97,11 +97,11 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> dl = groups.get(group);",
"\t\t\tlockInGroup = (Lock) dl.get(lock);"
]
},
{
"added": [
" HashMap<Lock, Lock> dl = groups.remove(group);"
],
"header": "@@ -145,7 +145,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> dl = groups.remove(group);"
]
},
{
"added": [
" private HashMap<Lock, Lock> getGroupMap(Object group) {",
" HashMap<Lock, Lock> dl = spareGroups.poll();",
" dl = new HashMap<Lock, Lock>(5, 0.8f);",
" private void saveGroup(HashMap<Lock, Lock> dl) {"
],
"header": "@@ -160,17 +160,17 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\tprivate HashMap<Lock,Object> getGroupMap(Object group) {",
" HashMap<Lock,Object> dl = spareGroups.poll();",
"\t\t\tdl = new HashMap<Lock,Object>(5, 0.8f);",
" private void saveGroup(HashMap<Lock, Object> dl) {"
]
},
{
"added": [
" HashMap<Lock, Lock> dl = groups.get(group);"
],
"header": "@@ -181,7 +181,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> dl = groups.get(group);"
]
},
{
"added": [
" HashMap<Lock, Lock> from = groups.get(oldGroup);",
" HashMap<Lock, Lock> to = groups.get(newGroup);"
],
"header": "@@ -206,11 +206,11 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> from = groups.get(oldGroup);",
"\t\tHashMap<Lock,Object> to = groups.get(newGroup);"
]
},
{
"added": [
" private void mergeGroups(HashMap<Lock, Lock> from, HashMap<Lock, Lock> into) {",
" Lock lockI = into.get(lock);"
],
"header": "@@ -237,11 +237,11 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\tprivate void mergeGroups(HashMap<Lock,Object> from, HashMap<Lock,Object> into) {",
"\t\t\tObject lockI = into.get(lock);"
]
},
{
"added": [
" Lock intoL = lockI;"
],
"header": "@@ -249,7 +249,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\t\t\tLock intoL = (Lock) lockI;"
]
},
{
"added": [
" HashMap<Lock, Lock> dl = groups.get(group);"
],
"header": "@@ -261,7 +261,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> dl = groups.get(group);"
]
},
{
"added": [
" HashMap<Lock, Lock> dl = groups.get(group);",
" return dl.containsKey(new Lock(this, ref, qualifier));"
],
"header": "@@ -307,12 +307,11 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tHashMap<Lock,Object> dl = groups.get(group);",
"\t\tObject heldLock = dl.get(new Lock(this, ref, qualifier));",
"\t\treturn (heldLock != null);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/access/PropertyConglomerate.java",
"hunks": [
{
"added": [
" private Dictionary<String, Object> cachedSet;"
],
"header": "@@ -96,7 +96,7 @@ class PropertyConglomerate",
"removed": [
"\tprivate Dictionary\tcachedSet;"
]
},
{
"added": [
" Hashtable<Object, Object> defaults = new Hashtable<Object, Object>();"
],
"header": "@@ -271,7 +271,7 @@ class PropertyConglomerate",
"removed": [
"\t\t\t\tHashtable defaults = new Hashtable();"
]
},
{
"added": [
" FormatableHashtable defaults = (FormatableHashtable)"
],
"header": "@@ -360,13 +360,12 @@ class PropertyConglomerate",
"removed": [
" @SuppressWarnings(\"unchecked\")",
"\t\tHashtable<Object,Object> defaults = (Hashtable<Object,Object>)"
]
},
{
"added": [
" Dictionary<Object, Object> d = new Hashtable<Object, Object>();"
],
"header": "@@ -381,7 +380,7 @@ class PropertyConglomerate",
"removed": [
"\t\tDictionary d = new Hashtable();"
]
},
{
"added": [
"",
" private <K, V> Dictionary<? super K, ? super V> copyValues(",
" Dictionary<? super K, ? super V> to,",
" Dictionary<K, V> from, boolean stringsOnly)",
" for (Enumeration<K> keys = from.keys(); keys.hasMoreElements(); ) {",
" K key = keys.nextElement();",
" V value = from.get(key);"
],
"header": "@@ -656,13 +655,15 @@ class PropertyConglomerate",
"removed": [
"\t\t\t\t\t\t\t\t\t",
"\tprivate Dictionary<String,Object> copyValues(Dictionary<String,Object> to, Dictionary<String,Object> from, boolean stringsOnly)",
"\t\tfor (Enumeration keys = from.keys(); keys.hasMoreElements(); ) {",
"\t\t\tString key = (String) keys.nextElement();",
"\t\t\tObject value = from.get(key);"
]
},
{
"added": [
" Dictionary<Object, Object> d,",
" Dictionary<String, Object> dbProps;",
" dbProps = readDbProperties(tc);",
" dbProps = getCachedDbProperties(tc);",
"",
" FormatableHashtable defaults = (FormatableHashtable)",
" dbProps.get(AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);",
" copyValues(d, defaults, stringsOnly);",
" if (!defaultsOnly) {",
" copyValues(d, dbProps, stringsOnly);",
" }"
],
"header": "@@ -679,28 +680,29 @@ class PropertyConglomerate",
"removed": [
" @SuppressWarnings(\"unchecked\")",
"\t\t\t\t\t\t\t Dictionary d,",
"\t\t\tDictionary dbProps = readDbProperties(tc);",
"\t\t\tDictionary defaults = (Dictionary)dbProps.get(AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);",
"\t\t\tcopyValues(d,defaults,stringsOnly);",
"\t\t\tif (!defaultsOnly)copyValues(d,dbProps,stringsOnly);",
"\t\t\tDictionary dbProps = getCachedDbProperties(tc);",
"\t\t\tDictionary defaults = (Dictionary)dbProps.get(AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);",
"\t\t\tcopyValues(d,defaults,stringsOnly);",
"\t\t\tif (!defaultsOnly)copyValues(d,dbProps,stringsOnly);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java",
"hunks": [
{
"added": [
" Dictionary<Object, Object> d = new Hashtable<Object, Object>();"
],
"header": "@@ -876,7 +876,7 @@ public abstract class RAMAccessManager",
"removed": [
"\t\tDictionary d = new Hashtable();"
]
}
]
}
] |
derby-DERBY-5840-a6d25cd5
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Generify CollectNodesVisitor so that the SuppressWarnings annotation
on its visit() method can be removed.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485961 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CollectNodesVisitor.java",
"hunks": [
{
"added": [
" private final Class<T> nodeClass;",
" private final Class<? extends Visitable> skipOverClass;"
],
"header": "@@ -38,8 +38,8 @@ import org.apache.derby.iapi.sql.compile.Visitor;",
"removed": [
" private final Class nodeClass;",
" private final Class skipOverClass;"
]
},
{
"added": [
" public CollectNodesVisitor(Class<T> nodeClass)"
],
"header": "@@ -47,7 +47,7 @@ public class CollectNodesVisitor<T extends Visitable> implements Visitor",
"removed": [
"\tpublic CollectNodesVisitor(Class nodeClass)"
]
},
{
"added": [
" public CollectNodesVisitor(Class<T> nodeClass,",
" Class<? extends Visitable> skipOverClass)"
],
"header": "@@ -60,7 +60,8 @@ public class CollectNodesVisitor<T extends Visitable> implements Visitor",
"removed": [
"\tpublic CollectNodesVisitor(Class nodeClass, Class skipOverClass)"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/FromBaseTable.java",
"hunks": [
{
"added": [],
"header": "@@ -66,7 +66,6 @@ import org.apache.derby.iapi.sql.dictionary.TableDescriptor;",
"removed": [
"import org.apache.derby.iapi.sql.execute.ExecutionContext;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/FromSubquery.java",
"hunks": [
{
"added": [],
"header": "@@ -21,8 +21,6 @@",
"removed": [
"import java.util.Iterator;",
"import java.util.List;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/FromVTI.java",
"hunks": [
{
"added": [],
"header": "@@ -31,7 +31,6 @@ import java.sql.ResultSetMetaData;",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
"import org.apache.derby.iapi.sql.compile.Visitable;"
],
"header": "@@ -54,6 +53,7 @@ import org.apache.derby.iapi.sql.compile.OptimizablePredicate;",
"removed": []
},
{
"added": [],
"header": "@@ -61,7 +61,6 @@ import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;",
"removed": [
"import org.apache.derby.iapi.sql.execute.ExecutionContext;"
]
},
{
"added": [
" for (ColumnReference ref : getNodesFromParameters(ColumnReference.class))"
],
"header": "@@ -901,12 +900,9 @@ public class FromVTI extends FromTable implements VTIEnvironment",
"removed": [
"\t\tList colRefs = getNodesFromParameters(ColumnReference.class);",
"\t\tfor (Iterator it = colRefs.iterator(); it.hasNext(); )",
"\t\t\tColumnReference ref = (ColumnReference) it.next();",
""
]
},
{
"added": [
" <T extends Visitable> List<T> getNodesFromParameters(Class<T> nodeClass)",
" CollectNodesVisitor<T> getCRs = new CollectNodesVisitor<T>(nodeClass);"
],
"header": "@@ -1010,10 +1006,10 @@ public class FromVTI extends FromTable implements VTIEnvironment",
"removed": [
"\tList getNodesFromParameters(Class nodeClass)",
"\t\tCollectNodesVisitor getCRs = new CollectNodesVisitor(nodeClass);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/GroupByNode.java",
"hunks": [
{
"added": [],
"header": "@@ -21,7 +21,6 @@",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
" CollectNodesVisitor<ColumnReference> collectNodesVisitor =",
" new CollectNodesVisitor<ColumnReference>(",
" ColumnReference.class, AggregateNode.class);",
" for (ColumnReference cr: collectNodesVisitor.getList())"
],
"header": "@@ -576,15 +575,13 @@ public class GroupByNode extends SingleChildResultSetNode",
"removed": [
"\t\t\tCollectNodesVisitor collectNodesVisitor = ",
"\t\t\t\tnew CollectNodesVisitor(ColumnReference.class, AggregateNode.class);",
"\t\t\tfor (Iterator it = collectNodesVisitor.getList().iterator();",
"\t\t\t it.hasNext(); ) ",
"\t\t\t\tColumnReference cr = (ColumnReference)it.next();",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/OrderByColumn.java",
"hunks": [
{
"added": [],
"header": "@@ -21,8 +21,6 @@",
"removed": [
"import java.util.Iterator;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/PredicateList.java",
"hunks": [
{
"added": [],
"header": "@@ -58,7 +58,6 @@ import java.lang.reflect.Modifier;",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
" CollectNodesVisitor<ColumnReference> getCRs =",
" new CollectNodesVisitor<ColumnReference>(ColumnReference.class);",
" List<ColumnReference> colRefs = getCRs.getList();"
],
"header": "@@ -1463,11 +1462,11 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\t\tCollectNodesVisitor getCRs = ",
" new CollectNodesVisitor(ColumnReference.class);",
"\t\t\tList colRefs = getCRs.getList();"
]
},
{
"added": [
" for (ColumnReference ref : colRefs)"
],
"header": "@@ -1476,9 +1475,8 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\t\t\tfor (Iterator it = colRefs.iterator(); it.hasNext(); )",
"\t\t\t\t\tColumnReference ref = (ColumnReference) it.next();"
]
},
{
"added": [
" CollectNodesVisitor<ColumnReference> collectCRs =",
" new CollectNodesVisitor<ColumnReference>(ColumnReference.class);"
],
"header": "@@ -1640,8 +1638,8 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\tCollectNodesVisitor collectCRs = ",
" new CollectNodesVisitor(ColumnReference.class);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/SelectNode.java",
"hunks": [
{
"added": [
" CollectNodesVisitor<SubqueryNode> cnv =",
" new CollectNodesVisitor<SubqueryNode>(",
" SubqueryNode.class, SubqueryNode.class);"
],
"header": "@@ -174,8 +174,9 @@ public class SelectNode extends ResultSetNode",
"removed": [
"\t\t\tCollectNodesVisitor cnv = ",
"\t\t\t\tnew CollectNodesVisitor(SubqueryNode.class, SubqueryNode.class);"
]
},
{
"added": [
" CollectNodesVisitor<FromSubquery> cnv =",
" new CollectNodesVisitor<FromSubquery>(",
" FromSubquery.class, FromSubquery.class);"
],
"header": "@@ -756,8 +757,9 @@ public class SelectNode extends ResultSetNode",
"removed": [
"\t\tCollectNodesVisitor cnv = new CollectNodesVisitor(FromSubquery.class, ",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t FromSubquery.class);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/SetOperatorNode.java",
"hunks": [
{
"added": [],
"header": "@@ -39,7 +39,6 @@ import org.apache.derby.iapi.types.DataTypeDescriptor;",
"removed": [
"import java.util.List;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/WindowResultSetNode.java",
"hunks": [
{
"added": [
" CollectNodesVisitor<ColumnReference> getCRVisitor =",
" new CollectNodesVisitor<ColumnReference>(ColumnReference.class);",
" for (ColumnReference cr : getCRVisitor.getList()) {"
],
"header": "@@ -147,20 +147,17 @@ public class WindowResultSetNode extends SingleChildResultSetNode",
"removed": [
" CollectNodesVisitor getCRVisitor =",
" new CollectNodesVisitor(ColumnReference.class);",
" List colRefs = getCRVisitor.getList();",
"",
" for (int i= 0; i< colRefs.size(); i++) {",
" ColumnReference cr = (ColumnReference) colRefs.get(i);"
]
}
]
}
] |
derby-DERBY-5840-a784994d
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Stop suppressing some unchecked conversion warnings. Make the
conversions checked instead.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1484920 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"hunks": [
{
"added": [],
"header": "@@ -45,7 +45,6 @@ import org.apache.derby.iapi.error.SQLWarningFactory;",
"removed": [
"import org.apache.derby.iapi.sql.execute.ExecutionContext;"
]
},
{
"added": [
"import java.util.Collections;"
],
"header": "@@ -78,6 +77,7 @@ import java.sql.SQLPermission;",
"removed": []
},
{
"added": [
" return Collections.emptyMap();"
],
"header": "@@ -3863,11 +3863,10 @@ public abstract class EmbedConnection implements EngineConnection",
"removed": [
" @SuppressWarnings(\"unchecked\")",
"\t\treturn java.util.Collections.EMPTY_MAP;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/CreateAliasNode.java",
"hunks": [
{
"added": [],
"header": "@@ -127,7 +127,6 @@ public class CreateAliasNode extends DDLStatementNode",
"removed": [
" @SuppressWarnings(\"unchecked\")"
]
}
]
}
] |
derby-DERBY-5840-c393694c
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Fix unchecked warnings in test packages:
- engine
- i18n
- store
- tools
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1482862 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5840-c784df50
|
DERBY-5840: Silence deprecation warnings in the network client
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1362420 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/Clob.java",
"hunks": [
{
"added": [
" reInitForNonLocator(",
" string_.substring(0, (int) pos - 1)",
" .concat(str.substring(offset, offset + length)));"
],
"header": "@@ -677,12 +677,9 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" String newString = string_.substring(0, (int) pos - 1);",
" string_ = newString.concat(str.substring(offset, offset + length));",
" asciiStream_ = new java.io.StringBufferInputStream(string_);",
" unicodeStream_ = new java.io.StringBufferInputStream(string_);",
" characterStream_ = new java.io.StringReader(string_);",
" setSqlLength(string_.length());"
]
},
{
"added": [
" reInitForNonLocator(string_.substring(0, (int) len));"
],
"header": "@@ -800,12 +797,7 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" String newstr = string_.substring(0, (int) len);",
" string_ = newstr;",
" asciiStream_ = new java.io.StringBufferInputStream(string_);",
" unicodeStream_ = new java.io.StringBufferInputStream(string_);",
" characterStream_ = new java.io.StringReader(string_);",
" setSqlLength(string_.length());"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ResultSet.java",
"hunks": [
{
"added": [
" /**",
" * Create a calendar with default locale and time zone.",
" * @param date the initial time of the calendar",
" * @return a calendar initialized to the specified time",
" */",
" private static Calendar createCalendar(java.util.Date date) {",
" Calendar cal = Calendar.getInstance();",
" cal.setTime(date);",
" return cal;",
" }",
""
],
"header": "@@ -997,6 +997,17 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": []
},
{
"added": [
" Calendar from = createCalendar(date);",
" cal.set(from.get(Calendar.YEAR),",
" from.get(Calendar.MONTH),",
" from.get(Calendar.DAY_OF_MONTH));"
],
"header": "@@ -1006,9 +1017,11 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" cal.set(date.getYear() + 1900, date.getMonth(), date.getDate(),",
" 0, 0, 0); // normalized time: 00:00:00"
]
},
{
"added": [
" Calendar from = createCalendar(time);",
" from.get(Calendar.HOUR_OF_DAY),",
" from.get(Calendar.MINUTE),",
" from.get(Calendar.SECOND));"
],
"header": "@@ -1021,9 +1034,12 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" time.getHours(), time.getMinutes(), time.getSeconds());"
]
},
{
"added": [
" Calendar from = createCalendar(ts);",
" cal.set(from.get(Calendar.YEAR),",
" from.get(Calendar.MONTH),",
" from.get(Calendar.DAY_OF_MONTH),",
" from.get(Calendar.HOUR_OF_DAY),",
" from.get(Calendar.MINUTE),",
" from.get(Calendar.SECOND));"
],
"header": "@@ -1036,9 +1052,14 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" cal.set(ts.getYear() + 1900, ts.getMonth(), ts.getDate(),",
" ts.getHours(), ts.getMinutes(), ts.getSeconds());"
]
}
]
}
] |
derby-DERBY-5840-e18f54b3
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Clean up warnings in jdbcapi test suite, and some classes that the
jdbcapi tests depend on in the upgrade test suite.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1483202 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5840-e474e510
|
DERBY-5840: Use for-each loops in the network server code
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1363264 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
"\t\tfor (int manager : knownManagers)",
"\t\t\tint appLevel = appRequester.getManagerLevel(manager);",
"\t\t\tint serverLevel = server.getManagerLevel(manager);"
],
"header": "@@ -1815,15 +1815,11 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tint manager;",
"\t\tint appLevel;",
"\t\tint serverLevel;",
"\t\tfor (int i = 0; i < knownManagers.size(); i++)",
"\t\t\tmanager = ((Integer)knownManagers.get(i)).intValue();",
"\t\t\tappLevel = appRequester.getManagerLevel(manager);",
"\t\t\tserverLevel = server.getManagerLevel(manager);"
]
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [],
"header": "@@ -53,7 +53,6 @@ import java.sql.SQLException;",
"removed": [
"import java.util.Enumeration;"
]
},
{
"added": [
"\t \t\t\tfor (Session session : sessionTable.values())"
],
"header": "@@ -834,9 +833,8 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t \t\t\tfor (Enumeration e = sessionTable.elements(); e.hasMoreElements(); )",
"\t \t\t\t\tSession session = (Session) e.nextElement();"
]
},
{
"added": [
"\t \t\t\tfor (final DRDAConnThread threadi : threadList)"
],
"header": "@@ -848,11 +846,9 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t \t\t\tfor (int i = 0; i < threadList.size(); i++)",
"\t \t\t\t\t\tfinal DRDAConnThread threadi = (DRDAConnThread)threadList.get(i);",
"\t \t "
]
},
{
"added": [
"\t\t\t\t\t\t\tfor (Session s : runQueue) {"
],
"header": "@@ -984,8 +980,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\t\tfor (int i = 0; i < runQueue.size(); i++) {",
"\t\t\t\t\t\t\t\tSession s = (Session) runQueue.get(i);"
]
},
{
"added": [
" if (localAddresses.contains(inetAddr)) {",
" return;",
" }"
],
"header": "@@ -2601,13 +2596,9 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tfor(int i = 0; i < localAddresses.size(); i++)",
"\t\t{",
"\t\t\tif (inetAddr.equals((InetAddress)localAddresses.get(i)))",
"\t\t\t{",
"\t\t\t\treturn;",
"\t\t\t}",
"\t\t}"
]
},
{
"added": [
"\t\t\tfor (DRDAConnThread thread : threadList)"
],
"header": "@@ -3544,9 +3535,8 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\tfor (Enumeration e = threadList.elements(); e.hasMoreElements(); )",
"\t\t\t\tDRDAConnThread thread = (DRDAConnThread)e.nextElement();"
]
},
{
"added": [
"\t\t\t\tfor (Session session : sessionTable.values())"
],
"header": "@@ -3602,10 +3592,8 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\tfor (Enumeration e = sessionTable.elements(); e.hasMoreElements(); )",
" ",
"\t\t\t\t Session session = (Session) e.nextElement();"
]
},
{
"added": [
"\t\t\tSession session = sessionTable.get(sessionArg);"
],
"header": "@@ -3623,7 +3611,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\tSession session = (Session) sessionTable.get(new Integer(sessionArg));"
]
},
{
"added": [
"\t\t\t\tfor (Session session : sessionTable.values())"
],
"header": "@@ -3908,9 +3896,8 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\tfor (Enumeration e = sessionTable.elements(); e.hasMoreElements(); )",
"\t\t\t\t\tSession session = (Session) e.nextElement();"
]
},
{
"added": [
"\t\tfor (DRDAConnThread thread : threadList)",
"\t\t\tString sessionInfo = thread.buildRuntimeInfo(\"\", locallangUtil);"
],
"header": "@@ -4006,10 +3993,9 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tfor (int i = 0; i < threadList.size(); i++)",
"\t\t\tString sessionInfo = ((DRDAConnThread)",
"\t\t\t\t\t\t\t\t threadList.get(i)).buildRuntimeInfo(\"\",locallangUtil) ;"
]
},
{
"added": [
"\t\tfor (Session session : runQueue)",
"\t\t\t\ts += session.buildRuntimeInfo(\"\", locallangUtil);"
],
"header": "@@ -4017,9 +4003,9 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tfor (int i = 0; i < runQueue.size(); i++)",
"\t\t\t\ts += ((Session)runQueue.get(i)).buildRuntimeInfo(\"\", locallangUtil);"
]
},
{
"added": [
" for (DRDAConnThread thread : threadList) {",
" count += thread.getBytesRead();",
" for (DRDAConnThread thread : threadList) {",
" count += thread.getBytesWritten();",
" for (DRDAConnThread thread : threadList) {",
" if (thread.hasSession()) {"
],
"header": "@@ -4044,24 +4030,24 @@ public final class NetworkServerControlImpl {",
"removed": [
" for (int i = 0; i < threadList.size(); i++) {",
" count += ((DRDAConnThread)threadList.get(i)).getBytesRead();",
" for (int i = 0; i < threadList.size(); i++) {",
" count += ((DRDAConnThread)threadList.get(i)).getBytesWritten();",
" for (int i = 0; i < threadList.size(); i++) {",
" if (((DRDAConnThread)threadList.get(i)).hasSession()) {"
]
}
]
}
] |
derby-DERBY-5840-e76d29e4
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Remove SuppressWarnings annotation in DiskHashtable and use strongly
typed variables instead of an overloaded Object variable to prevent
the warnings.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1486780 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/store/access/DiskHashtable.java",
"hunks": [
{
"added": [
"import java.util.ArrayList;",
"import java.util.List;"
],
"header": "@@ -20,10 +20,11 @@",
"removed": [
"import java.util.Vector;"
]
},
{
"added": [
" DataValueDescriptor[] firstRow = null;",
" List<DataValueDescriptor[]> allRows = null;"
],
"header": "@@ -251,13 +252,13 @@ public class DiskHashtable",
"removed": [
" @SuppressWarnings(\"unchecked\")",
" Object retValue = null;"
]
},
{
"added": [
" DataValueDescriptor[] clonedRow =",
" BackingStoreHashtable.shallowCloneRow(row);",
"",
" firstRow = clonedRow;",
" // If there is more than one row, return a list of",
" if (allRows == null)",
" allRows = new ArrayList<DataValueDescriptor[]>(2);",
" allRows.add(firstRow);",
" allRows.add(clonedRow);"
],
"header": "@@ -286,32 +287,29 @@ public class DiskHashtable",
"removed": [
" retValue = BackingStoreHashtable.shallowCloneRow( row);",
" // if there is more than one row, return a vector of",
" Vector<Object> v;",
" if( rowCount == 2)",
" v = new Vector<Object>( 2);",
" v.add( retValue);",
" retValue = v;",
" }",
" else",
" {",
" v = (Vector<Object>) retValue;",
" v.add( BackingStoreHashtable.shallowCloneRow( row));"
]
},
{
"added": [
" return clonedRow;"
],
"header": "@@ -321,7 +319,7 @@ public class DiskHashtable",
"removed": [
" return retValue;"
]
}
]
}
] |
derby-DERBY-5840-f9a152bd
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Remove various @SuppressWarnings annotations and adjust the code so
that the compiler doesn't complain.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1485321 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/context/ContextService.java",
"hunks": [
{
"added": [
"import java.util.Stack;"
],
"header": "@@ -24,7 +24,7 @@ package org.apache.derby.iapi.services.context;",
"removed": [
"import java.util.Iterator;"
]
},
{
"added": [
" <LI> ContextManagerStack containing ContextManagers - the current",
" set to -1. This is because nesting is solely represented by"
],
"header": "@@ -62,11 +62,11 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\t<LI> java.util.Stack containing ContextManagers - the current",
" set to -1. This is beacause nesting is soley represented by"
]
},
{
"added": [
" Single thread for Connection execution."
],
"header": "@@ -94,7 +94,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
" Single thread for Connection exection."
]
},
{
"added": [
" return ((ContextManagerStack) list).peek();"
],
"header": "@@ -283,9 +283,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\tjava.util.Stack stack = (java.util.Stack) list;",
"\t\treturn (ContextManager) (stack.peek());",
""
]
},
{
"added": [
" ContextManagerStack stack = (ContextManagerStack) tcl.get();",
" // Remove the context manager at the top of the stack.",
" stack.pop();",
" ContextManager nextCM = stack.peek();",
" for (ContextManager stackCM : stack) {"
],
"header": "@@ -345,17 +343,17 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\tjava.util.Stack stack = (java.util.Stack) tcl.get();",
"\t\tObject oldCM = stack.pop();",
"\t\tContextManager nextCM = (ContextManager) stack.peek();",
"\t\tfor (int i = 0; i < stack.size(); i++) {",
"\t\t\tObject stackCM = stack.elementAt(i);"
]
},
{
"added": [],
"header": "@@ -389,7 +387,6 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
" @SuppressWarnings(\"unchecked\")"
]
},
{
"added": [
" ContextManagerStack stack;"
],
"header": "@@ -412,7 +409,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
" \t\tjava.util.Stack<ContextManager> stack;"
]
},
{
"added": [
" stack = new ContextManagerStack();"
],
"header": "@@ -432,7 +429,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\t\tstack = new java.util.Stack<ContextManager>();"
]
},
{
"added": [
" stack = (ContextManagerStack) list;"
],
"header": "@@ -449,7 +446,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\t\tstack = (java.util.Stack<ContextManager>) list;"
]
},
{
"added": [
" for (ContextManager cm : allContexts) {"
],
"header": "@@ -545,9 +542,7 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
"\t\t\tfor (Iterator<ContextManager> i = allContexts.iterator(); i.hasNext(); ) {",
"",
"\t\t\t\tContextManager cm = i.next();"
]
},
{
"added": [
" new PrivilegedAction<Void>() {",
" public Void run() {"
],
"header": "@@ -561,8 +556,8 @@ public final class ContextService //OLD extends Hashtable",
"removed": [
" new PrivilegedAction<Object>() {",
" public Object run() {"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/jmx/JMXManagementService.java",
"hunks": [
{
"added": [
" public synchronized <T> Object registerMBean(final T bean,",
" final Class<T> beanInterface,"
],
"header": "@@ -201,8 +201,8 @@ public final class JMXManagementService implements ManagementService, ModuleCont",
"removed": [
" public synchronized Object registerMBean(final Object bean,",
" final Class beanInterface,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/locks/LockSpace.java",
"hunks": [
{
"added": [
"import java.util.ArrayDeque;"
],
"header": "@@ -29,6 +29,7 @@ import org.apache.derby.iapi.util.Matchable;",
"removed": []
},
{
"added": [
" /** The maximum number of elements to cache in {@link #spareGroups}. */",
" private static final int MAX_CACHED_GROUPS = 3;",
"",
" /** Cached HashMaps for storing lock groups. */",
" private final ArrayDeque<HashMap<Lock, Object>> spareGroups =",
" new ArrayDeque<HashMap<Lock, Object>>(MAX_CACHED_GROUPS);"
],
"header": "@@ -56,7 +57,12 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\tprivate HashMap spareGroups[] = new HashMap[3];"
]
},
{
"added": [
" for (Lock lock : dl.keySet()) {",
" lset.unlock(lock, 0);"
],
"header": "@@ -143,8 +149,8 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tfor (Iterator list = dl.keySet().iterator(); list.hasNext(); ) {",
"\t\t\tlset.unlock((Lock) list.next(), 0);"
]
},
{
"added": [
" HashMap<Lock,Object> dl = spareGroups.poll();"
],
"header": "@@ -154,17 +160,8 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
" @SuppressWarnings(\"unchecked\")",
"\t\tHashMap[] sg = spareGroups;",
"\t\tHashMap<Lock,Object> dl = null;",
"\t\tfor (int i = 0; i < 3; i++) {",
"\t\t\tdl = (HashMap<Lock,Object>) sg[i];",
"\t\t\tif (dl != null) {",
"\t\t\t\tsg[i] = null;",
"\t\t\t\tbreak;",
"\t\t\t}",
"\t\t}"
]
},
{
"added": [
"",
" private void saveGroup(HashMap<Lock, Object> dl) {",
" if (spareGroups.size() < MAX_CACHED_GROUPS) {",
" spareGroups.offer(dl);",
" dl.clear();",
" }"
],
"header": "@@ -172,15 +169,12 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\tprivate void saveGroup(HashMap dl) {",
"\t\tHashMap[] sg = spareGroups;",
"\t\tfor (int i = 0; i < 3; i++) {",
"\t\t\tif (sg[i] == null) {",
"\t\t\t\tsg[i] = dl;",
"\t\t\t\tdl.clear();",
"\t\t\t\tbreak;",
"\t\t\t}",
"\t\t}"
]
},
{
"added": [
" for (Iterator<Lock> e = dl.keySet().iterator(); e.hasNext(); ) {",
" Lock lock = e.next();"
],
"header": "@@ -192,9 +186,8 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tfor (Iterator e = dl.keySet().iterator(); e.hasNext(); ) {",
"",
"\t\t\tLock lock = (Lock) e.next();"
]
},
{
"added": [
" for (Lock lock : from.keySet()) {"
],
"header": "@@ -246,9 +239,7 @@ final class LockSpace implements CompatibilitySpace {",
"removed": [
"\t\tfor (Iterator<Lock> e = from.keySet().iterator(); e.hasNext(); ) {",
"",
"\t\t\tLock lock = e.next();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/vti/ForeignTableVTI.java",
"hunks": [
{
"added": [],
"header": "@@ -120,7 +120,6 @@ import org.apache.derby.iapi.util.IdUtil;",
"removed": [
"@SuppressWarnings(\"deprecation\")"
]
}
]
},
{
"file": "java/engine/org/apache/derby/vti/VTITemplate.java",
"hunks": [
{
"added": [],
"header": "@@ -68,7 +68,6 @@ import java.util.Map;",
"removed": [
"@SuppressWarnings(\"deprecation\")"
]
},
{
"added": [
" @Deprecated"
],
"header": "@@ -87,6 +86,7 @@ public abstract class VTITemplate implements ResultSet",
"removed": []
},
{
"added": [
" @Deprecated",
" @Deprecated",
" @Deprecated"
],
"header": "@@ -109,15 +109,18 @@ public abstract class VTITemplate implements ResultSet",
"removed": []
}
]
}
] |
derby-DERBY-5840-fcc35800
|
DERBY-5840: Clean up compiler warnings introduced by using Java 5 language features
Remove the @SuppressWarnings("unchecked") annotation from
BackingStoreHashtable and introduce a specialized sub-class of
ArrayList to make the casts type safe.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1486782 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/store/access/BackingStoreHashtable.java",
"hunks": [
{
"added": [],
"header": "@@ -394,7 +394,6 @@ public class BackingStoreHashtable",
"removed": [
" @SuppressWarnings(\"unchecked\")"
]
},
{
"added": [
"",
" Object duplicate_value = hash_table.put(key, row);",
" if (duplicate_value == null)",
" RowList row_vec;",
" if (duplicate_value instanceof RowList)",
" row_vec = (RowList) duplicate_value;",
" row_vec = new RowList(2);",
" row_vec.add((DataValueDescriptor[]) duplicate_value);"
],
"header": "@@ -405,30 +404,31 @@ public class BackingStoreHashtable",
"removed": [
" Object duplicate_value = null;",
" if ((duplicate_value = hash_table.put(key, row)) == null)",
" List<Object> row_vec;",
" if (duplicate_value instanceof List)",
" row_vec = (List<Object>) duplicate_value;",
" row_vec = new ArrayList<Object>(2);",
" row_vec.add(duplicate_value);"
]
},
{
"added": [],
"header": "@@ -441,8 +441,6 @@ public class BackingStoreHashtable",
"removed": [
"",
" row = null;"
]
},
{
"added": [
"",
" /**",
" * List of {@code DataValueDescriptor[]} instances that represent rows.",
" * This class is used when the hash table contains multiple rows for the",
" * same hash key.",
" */",
" private static class RowList extends ArrayList<DataValueDescriptor[]> {",
"",
" private RowList(int initialCapacity) {",
" super(initialCapacity);",
" }",
"",
" // The class is mostly empty and provides no functionality in addition",
" // to what's provided by ArrayList<DataValueDescriptor[]>. The main",
" // purpose of the class is to allow type-safe casts from Object. These",
" // casts are needed because the hash table can store both DVD[] and",
" // List<DVD[]>, so its declared type is HashMap<Object, Object>.",
" // Because of type erasure, casts to ArrayList<DataValueDescriptor[]>",
" // will make the compiler generate unchecked conversion warnings.",
" // Casts to RowList, on the other hand, won't cause warnings, as there",
" // are no parameterized types and type erasure doesn't come into play.",
" }"
],
"header": "@@ -792,4 +790,26 @@ public class BackingStoreHashtable",
"removed": []
}
]
}
] |
derby-DERBY-5840-ffa2d1b2
|
DERBY-5840: Silence compiler warnings in the compatibility tests.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1356735 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5847-0972a574
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Clean up performance warnings:
- Use System.arraycopy() instead of manual copy
- Use StringBuilder instead of StringBuffer where synchronization is
not needed
- Don't use string concatenation in arguments to StringBuffer.append()
- In convertToHexString(), replace use of StringBuffer with
StringUtil.toHexString()
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1359635 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.util.StringUtil;"
],
"header": "@@ -64,6 +64,7 @@ import org.apache.derby.iapi.services.monitor.Monitor;",
"removed": []
},
{
"added": [
" System.arraycopy(database.crrtkn, 0,",
" part1, 0, part1.length);"
],
"header": "@@ -3376,8 +3377,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\tfor (int i = 0; i < part1.length; i++)",
"\t\t\t\t\t\tpart1[i] = database.crrtkn[i];"
]
},
{
"added": [
"\t\t\t\t\t\tStringBuilder marks = new StringBuilder();\t// construct parameter marks"
],
"header": "@@ -4524,7 +4525,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\t\tStringBuffer marks = new StringBuffer();\t// construct parameter marks"
]
},
{
"added": [
" StringBuilder sb = new StringBuilder();",
" sb.append(se.getLocalizedMessage());",
" while ((se = se.getNextException()) != null) {",
" sb.append(SQLERRMC_PREFORMATTED_MESSAGE_DELIMITER);",
" sb.append(\"SQLSTATE: \");",
" sb.append(se.getSQLState());",
" }"
],
"header": "@@ -6248,15 +6249,14 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tStringBuffer sb = new StringBuffer(); ",
"\t\tdo {",
"\t\t\tsb.append(se.getLocalizedMessage());",
"\t\t\tse = se.getNextException();",
"\t\t\tif (se != null)",
"\t\t\t\tsb.append(SQLERRMC_PREFORMATTED_MESSAGE_DELIMITER + ",
"\t\t\t\t\t\t\"SQLSTATE: \" + se.getSQLState());",
"\t\t} while (se != null);\t\t\t"
]
},
{
"added": [
"\t\t\t\tStringBuilder sb = new StringBuilder();",
" if (se != null) {",
" sb.append(SQLERRMC_TOKEN_DELIMITER);",
" sb.append(\"SQLSTATE: \").append(se.getSQLState());",
" }"
],
"header": "@@ -6288,12 +6288,13 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\tStringBuffer sb = new StringBuffer(); ",
"\t\t\t\tif (se != null)",
"\t\t\t\tsb.append(SQLERRMC_TOKEN_DELIMITER + ",
"\t\t\t\t\t\"SQLSTATE: \" + se.getSQLState());"
]
},
{
"added": [
" System.arraycopy(req, 0, required, 0, req.length);"
],
"header": "@@ -8203,8 +8204,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tfor (int i = 0; i < req.length; i++)",
"\t\t\trequired[i] = req[i];"
]
},
{
"added": [
" StringBuilder sb = new StringBuilder(\"Reading/setting EXTDTA: \");"
],
"header": "@@ -8582,7 +8582,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" StringBuffer sb = new StringBuffer(\"Reading/setting EXTDTA: \");"
]
},
{
"added": [
" return \"0x\" + StringUtil.toHexString(buf, 0, buf.length);"
],
"header": "@@ -8625,19 +8625,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tStringBuffer str = new StringBuffer();",
"\t\tstr.append(\"0x\");",
"\t\tString val;",
"\t\tint byteVal;",
"\t\tfor (int i = 0; i < buf.length; i++)",
"\t\t{",
"\t\t\tbyteVal = buf[i] & 0xff;",
"\t\t\tval = Integer.toHexString(byteVal);",
"\t\t\tif (val.length() < 2)",
"\t\t\t\tstr.append(\"0\");",
"\t\t\tstr.append(val);",
"\t\t}",
"\t\treturn str.toString();"
]
}
]
}
] |
derby-DERBY-5847-1562d537
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Replace use of obsolete collection class Vector with ArrayList.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1360133 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
"import java.util.List;"
],
"header": "@@ -45,9 +45,9 @@ import java.sql.Types;",
"removed": [
"import java.util.Vector;"
]
},
{
"added": [
" private List unknownManagers;",
" private List knownManagers;"
],
"header": "@@ -141,10 +141,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"\tprivate Vector unknownManagers;",
"\tprivate Vector knownManagers;",
"\tprivate Vector errorManagers;",
"\tprivate Vector errorManagersLevel;"
]
},
{
"added": [
"\t\tunknownManagers = new ArrayList();",
"\t\tknownManagers = new ArrayList();",
"\t\tArrayList errorManagers = new ArrayList();",
"\t\tArrayList errorManagersLevel = new ArrayList();"
],
"header": "@@ -1702,10 +1700,10 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tunknownManagers = new Vector();",
"\t\tknownManagers = new Vector();",
"\t\terrorManagers = new Vector();",
"\t\terrorManagersLevel = new Vector();"
]
}
]
}
] |
derby-DERBY-5847-296695c0
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Fix warnings:
- Remove if statement that was previously disabled by prepending
"false &&" to the condition. Silences "unreachable code" warning.
- Remove no-op bitwise shift operation.
- Rename local variable that hides field.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1360135 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
"",
" // The protocol wants us to send RDBUPDRM here, but we don't do",
" // that because it used to cause protocol errors. DERBY-5847 has",
" // some discussion about this issue."
],
"header": "@@ -4255,11 +4255,10 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\tif (false && (database.RDBUPDRM_sent == false) &&",
"\t\t\t\t! isProcedure)",
"\t\t\t{",
"\t\t\t\twriteRDBUPDRM();",
"\t\t\t}"
]
},
{
"added": [
"\t\t\t\t\toutlen[0] = ((precision <<8) | scale);"
],
"header": "@@ -7694,7 +7693,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\toutlen[0] = ((precision <<8) | (scale <<0));"
]
},
{
"added": [
"\t\tString dbname = parseRDBNAM();",
"\t\tif (database != null && database.getDatabaseName().equals(dbname)) {",
" }",
"\t\tDatabase d = session.getDatabase(dbname);",
"\t\tif (d == null) {",
" } else {",
" }"
],
"header": "@@ -8704,15 +8703,17 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tString rdbnam = parseRDBNAM();",
"\t\tif (database != null && database.getDatabaseName().equals(rdbnam))",
"\t\tDatabase d = session.getDatabase(rdbnam);",
"\t\tif (d == null)",
"\t\telse"
]
}
]
}
] |
derby-DERBY-5847-68a67abc
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Removed unnecessary return statements.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1359110 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [],
"header": "@@ -4278,8 +4278,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t ",
"\t\treturn;\t\t\t// we are done"
]
},
{
"added": [],
"header": "@@ -5439,8 +5437,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"",
"\t\treturn;"
]
},
{
"added": [],
"header": "@@ -5848,11 +5844,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"",
"\t\treturn;",
""
]
},
{
"added": [],
"header": "@@ -6467,7 +6460,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\treturn;"
]
},
{
"added": [],
"header": "@@ -6522,8 +6514,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t",
"\t\treturn;"
]
},
{
"added": [],
"header": "@@ -6628,7 +6618,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\treturn;"
]
},
{
"added": [],
"header": "@@ -8924,10 +8913,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"",
"\t\treturn;",
""
]
}
]
}
] |
derby-DERBY-5847-761351a0
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Remove assignment of values that are never used.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1359624 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [],
"header": "@@ -735,7 +735,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tint updateCount = 0;"
]
},
{
"added": [
"\t\t\t\t\t\tint updateCount = parseEXCSQLIMM();"
],
"header": "@@ -774,7 +773,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\t\tupdateCount = parseEXCSQLIMM();"
]
},
{
"added": [],
"header": "@@ -843,7 +842,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\tPreparedStatement ps = null;"
]
},
{
"added": [
"\t\t\t\t\t\t\tPreparedStatement ps = stmt.getPreparedStatement();"
],
"header": "@@ -860,7 +858,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\t\t\tps = stmt.getPreparedStatement();"
]
},
{
"added": [
" return getConnFromDatabaseName();"
],
"header": "@@ -1412,14 +1410,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tint retSecChkCode = 0;",
"",
"\t\tString realName = database.getDatabaseName(); //first strip off properties",
"\t\tint endOfName = realName.indexOf(';');",
"\t\tif (endOfName != -1)",
"\t\t\trealName = realName.substring(0, endOfName);",
"\t\tretSecChkCode = getConnFromDatabaseName();",
"\t\treturn retSecChkCode;"
]
},
{
"added": [
"\t\t\tint[] outovr_drdaType;"
],
"header": "@@ -2707,7 +2698,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\tint[] outovr_drdaType = null;"
]
},
{
"added": [],
"header": "@@ -3743,10 +3734,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tString typdefnam;",
"\t\tDRDAStatement stmt = null; "
]
},
{
"added": [
"\t\tDRDAStatement stmt = database.newDRDAStatement(pkgnamcsn);"
],
"header": "@@ -3785,7 +3774,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tstmt = database.newDRDAStatement(pkgnamcsn);"
]
},
{
"added": [],
"header": "@@ -5350,8 +5339,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tString sqlStmt = null;",
"\t\tint codePoint;"
]
},
{
"added": [
"\t\t\t\tint codePoint = reader.readLengthAndCodePoint(false);"
],
"header": "@@ -5361,7 +5348,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\tcodePoint = reader.readLengthAndCodePoint( false );"
]
},
{
"added": [
"\t\t\t\t\t\tString sqlStmt = parseEncodedString();"
],
"header": "@@ -5375,7 +5362,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\t\tsqlStmt = parseEncodedString();"
]
},
{
"added": [],
"header": "@@ -5834,7 +5821,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\tpkgnamcsn = null;"
]
},
{
"added": [
"\t\tString sqlerrmc;"
],
"header": "@@ -6224,7 +6210,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tString sqlerrmc = null;"
]
},
{
"added": [
"\t\tboolean hasdata;"
],
"header": "@@ -7079,7 +7065,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tboolean hasdata = false;"
]
},
{
"added": [],
"header": "@@ -7180,7 +7166,6 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\tObject val = null;"
]
},
{
"added": [
" Object val =",
" getObjectForWriteFdoca(rs, i, drdaType);"
],
"header": "@@ -7259,7 +7244,8 @@ class DRDAConnThread extends Thread {",
"removed": [
" val = getObjectForWriteFdoca(rs, i, drdaType);"
]
},
{
"added": [
" Object val = getObjectForWriteFdoca("
],
"header": "@@ -7280,7 +7266,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" val = getObjectForWriteFdoca("
]
},
{
"added": [
" Runtime rt = Runtime.getRuntime();",
" Date d = new Date();"
],
"header": "@@ -8620,11 +8606,9 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tRuntime rt = null;",
"\t\tDate d = null;",
"\t\trt = Runtime.getRuntime();",
"\t\td = new Date();"
]
},
{
"added": [
"\t\t\t\tSQLWarning warning = stmt.getWarnings();"
],
"header": "@@ -8846,13 +8830,12 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tSQLWarning warning = null;",
"\t\t\t\twarning = stmt.getWarnings();"
]
},
{
"added": [
"\t\t\t\tSQLWarning warning = rs.getWarnings();"
],
"header": "@@ -8861,7 +8844,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\twarning = rs.getWarnings();"
]
},
{
"added": [
"\t\t\t\tSQLWarning warning = conn.getWarnings();"
],
"header": "@@ -8871,7 +8854,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\twarning = conn.getWarnings();"
]
},
{
"added": [],
"header": "@@ -8946,7 +8929,6 @@ class DRDAConnThread extends Thread {",
"removed": [
" String dbName = null;"
]
},
{
"added": [
" String dbName = database.getShortDbName();"
],
"header": "@@ -8986,7 +8968,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" dbName = database.getShortDbName();"
]
},
{
"added": [
" int c;"
],
"header": "@@ -9102,7 +9084,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" int c = 0;"
]
}
]
}
] |
derby-DERBY-5847-b4af06bb
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
Silence warning about possible leak of reference to "this" from
constructor.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1360137 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [
"import java.util.concurrent.atomic.AtomicInteger;"
],
"header": "@@ -58,6 +58,7 @@ import java.util.Hashtable;",
"removed": []
},
{
"added": [
" /**",
" * Holds the sequence number to be assigned to the next thread that",
" * calls {@link #getUniqueThreadName(String)}.",
" */",
" private static final AtomicInteger nextThreadNumber = new AtomicInteger(1);",
" /**",
" * Get a thread name that is both meaningful and unique (primarily for",
" * debugging purposes).",
" *",
" * @param base the first part of the thread name (the meaningful part)",
" * @return a unique thread name that starts with {@code base} and is",
" * followed by an underscore and a unique sequence number",
" */",
" static String getUniqueThreadName(String base) {",
" return base + \"_\" + nextThreadNumber.getAndIncrement();",
" }"
],
"header": "@@ -1479,39 +1480,23 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t/**",
"\t * Set a thread name to be something that is both meaningful and unique (primarily",
"\t * for debugging purposes).",
"\t *",
" * The received thread's name is set to a new string of the form",
" * [newName + \"_n\"], where 'n' is a unique thread id originally generated",
" * by the jvm Thread constructor. If the default name of the thread has",
" * been changed before getting here, then nothing is done.",
" *",
"\t * @param thrd An instance of a Thread object that still has its default",
"\t * thread name (as generated by the jvm Thread constructor). This should",
"\t * always be of the form \"Thread-N\", where N is a unique thread id",
"\t * generated by the jvm. Ex. \"Thread-0\", \"Thread-1\", etc.",
"\t *",
"\t **/",
"\tpublic static void setUniqueThreadName(Thread thrd, String newName) {",
"",
"\t\t// First, pull off the unique thread id already found in thrd's default name;",
"\t\t// we do so by searching for the '-' character, and then counting everything",
"\t\t// after it as a N.",
"\t\tif (thrd.getName().indexOf(\"Thread-\") == -1) {",
"\t\t// default name has been changed; don't do anything.",
"\t\t\treturn;",
"\t\t}",
"\t\telse {",
"\t\t\tString oldName = thrd.getName();",
"\t\t\tthrd.setName(newName + \"_\" +",
"\t\t\t oldName.substring(oldName.indexOf(\"-\")+1, oldName.length()));",
"\t\t} // end else.",
"",
"\t\treturn;",
"\t}"
]
}
]
}
] |
derby-DERBY-5847-b690b7ae
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
DERBY-436: Clean up imports and static field references in DRDA classes
Changed in DRDAConnThread:
- Use class name to reference static fields
- Use direct references to constants in java.sql.ParameterMetaData
instead of JDBC30Translation
- Organize imports alphabetically
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1359559 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
"import java.io.IOException;",
"import java.io.InputStreamReader;"
],
"header": "@@ -22,11 +22,11 @@ package org.apache.derby.impl.drda;",
"removed": [
"import java.io.InputStreamReader;",
"import java.io.IOException;"
]
},
{
"added": [
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.jdbc.AuthenticationService;",
"import org.apache.derby.iapi.jdbc.EngineLOB;",
"import org.apache.derby.iapi.jdbc.EnginePreparedStatement;",
"import org.apache.derby.iapi.jdbc.EngineResultSet;"
],
"header": "@@ -48,13 +48,15 @@ import java.util.Date;",
"removed": [
"",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.reference.JDBC30Translation;"
]
},
{
"added": [],
"header": "@@ -62,13 +64,9 @@ import org.apache.derby.iapi.services.monitor.Monitor;",
"removed": [
"import org.apache.derby.iapi.jdbc.AuthenticationService;",
"import org.apache.derby.iapi.jdbc.EngineLOB;",
"import org.apache.derby.iapi.jdbc.EngineResultSet;",
"import org.apache.derby.iapi.jdbc.EnginePreparedStatement;"
]
},
{
"added": [
"\t\tsession.setState(Session.ATTEXC);"
],
"header": "@@ -1190,7 +1188,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsession.setState(session.ATTEXC);"
]
},
{
"added": [
"\t\t\t\tif (currentLevel == AppRequester.MGR_LEVEL_UNKNOWN)",
" {",
" }"
],
"header": "@@ -1728,8 +1726,10 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\tif (currentLevel == appRequester.MGR_LEVEL_UNKNOWN)"
]
},
{
"added": [
" writer.writeScalarString(CodePoint.EXTNAM,",
" NetworkServerControlImpl.att_extnam);",
" writer.writeScalarString(CodePoint.SRVCLSNM,",
" NetworkServerControlImpl.att_srvclsnm);",
" writer.writeScalarString(CodePoint.SRVNAM,",
" NetworkServerControlImpl.ATT_SRVNAM);",
" writer.writeScalarString(CodePoint.SRVRLSLV,",
" NetworkServerControlImpl.att_srvrlslv);"
],
"header": "@@ -1779,13 +1779,17 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\twriter.writeScalarString(CodePoint.EXTNAM, server.att_extnam);",
"\t\twriter.writeScalarString(CodePoint.SRVCLSNM, server.att_srvclsnm);",
"\t\twriter.writeScalarString(CodePoint.SRVNAM, server.ATT_SRVNAM);",
"\t\twriter.writeScalarString(CodePoint.SRVRLSLV, server.att_srvrlslv);"
]
},
{
"added": [
" session.setState(",
" (securityCheckCode == 0) ? Session.SECACC : Session.ATTEXC);"
],
"header": "@@ -2053,10 +2057,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tif (securityCheckCode == 0)",
"\t\t\tsession.setState(session.SECACC);",
"\t\telse",
"\t\t\tsession.setState(session.ATTEXC);"
]
},
{
"added": [
" if (securityCheckCode == 0) {",
" session.setState(Session.CHKSEC);",
" }"
],
"header": "@@ -3274,8 +3276,9 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tif (securityCheckCode == 0)",
"\t\t\tsession.setState(session.CHKSEC);"
]
},
{
"added": [
" if (appRequester.getClientType() != AppRequester.DNC_CLIENT) {"
],
"header": "@@ -3422,7 +3425,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" if (appRequester.getClientType() != appRequester.DNC_CLIENT) {"
]
},
{
"added": [
"\t\t\t\t\tif ((appRequester.getClientType() == AppRequester.DNC_CLIENT) &&"
],
"header": "@@ -3431,7 +3434,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\tif ((appRequester.getClientType() == appRequester.DNC_CLIENT) &&"
]
},
{
"added": [
" writer.writeScalarString(CodePoint.PRDID,",
" NetworkServerControlImpl.prdId);"
],
"header": "@@ -3550,7 +3553,8 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\twriter.writeScalarString(CodePoint.PRDID, server.prdId);"
]
},
{
"added": [
" if ((appRequester.getClientType() == AppRequester.DNC_CLIENT) &&"
],
"header": "@@ -3564,7 +3568,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" if ((appRequester.getClientType() == appRequester.DNC_CLIENT) &&"
]
},
{
"added": [
" writer.writeScalar2Bytes(CodePoint.CCSIDSBC,",
" NetworkServerControlImpl.CCSIDSBC);",
" writer.writeScalar2Bytes(CodePoint.CCSIDMBC,",
" NetworkServerControlImpl.CCSIDMBC);"
],
"header": "@@ -3580,8 +3584,10 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\twriter.writeScalar2Bytes(CodePoint.CCSIDSBC, server.CCSIDSBC);",
"\t\twriter.writeScalar2Bytes(CodePoint.CCSIDMBC, server.CCSIDMBC);"
]
},
{
"added": [
"\t\t\t\t\t\t\t\t\t!= ParameterMetaData.parameterModeOut)"
],
"header": "@@ -4585,7 +4591,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\t\t\t\t\t\t!= JDBC30Translation.PARAMETER_MODE_OUT )"
]
},
{
"added": [
" writer.writeBytes(NetworkServerControlImpl.prdIdBytes_);"
],
"header": "@@ -6110,7 +6116,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" writer.writeBytes(server.prdIdBytes_);"
]
},
{
"added": [
" writer.writeBytes(NetworkServerControlImpl.prdIdBytes_);"
],
"header": "@@ -6163,7 +6169,7 @@ class DRDAConnThread extends Thread {",
"removed": [
" writer.writeBytes(server.prdIdBytes_);"
]
},
{
"added": [
" boolean nullable = hasRs ?",
" (rsmeta.isNullable(i) == ResultSetMetaData.columnNullable) :",
" (pmeta.isNullable(i) == ParameterMetaData.parameterNullable);"
],
"header": "@@ -6821,8 +6827,9 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\tboolean nullable = (hasRs ? (rsmeta.isNullable(i) == rsmeta.columnNullable) :",
"\t\t\t\t\t\t\t\t\t\t\t\t (pmeta.isNullable(i) == JDBC30Translation.PARAMETER_NULLABLE));"
]
},
{
"added": [
" boolean nullable = rtnOutput ?",
" (rsmeta.isNullable(jdbcElemNum) == ResultSetMetaData.columnNullable) :",
" (pmeta.isNullable(jdbcElemNum) == ParameterMetaData.parameterNullable);"
],
"header": "@@ -7694,9 +7701,9 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tboolean nullable = rtnOutput ? (rsmeta.isNullable(jdbcElemNum) ==",
"\t\t\t\t\t\t\t\t\t\tResultSetMetaData.columnNullable) : ",
"\t\t\t(pmeta.isNullable(jdbcElemNum) == JDBC30Translation.PARAMETER_NULLABLE);"
]
},
{
"added": [
"\t\t\tif (mode == ParameterMetaData.parameterModeUnknown)",
" if (type != DRDAStatement.NOT_OUTPUT_PARAM) {",
" mode = ParameterMetaData.parameterModeInOut;",
" }"
],
"header": "@@ -7917,14 +7924,15 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\tif (mode == JDBC30Translation.PARAMETER_MODE_UNKNOWN)",
"\t\t\t\tif (type != DRDAStatement.NOT_OUTPUT_PARAM)",
"\t\t\t\t\tmode = JDBC30Translation.PARAMETER_MODE_IN_OUT;"
]
}
]
}
] |
derby-DERBY-5847-dc489432
|
DERBY-5847: Clean up IDE warnings in DRDAConnThread
NetBeans warns about synchronization on non-final objects. Since
the synchronization is only used to ensure that set operations are
visible in other threads, make the fields volatile instead of having
a separate synchronization object per field.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1360134 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
" /** Time slice for this thread. */",
" private volatile long timeSlice;",
" /** Whether or not to log connections. */",
" private volatile boolean logConnections;",
" /** End this thread. */",
" private volatile boolean close;"
],
"header": "@@ -123,14 +123,14 @@ class DRDAConnThread extends Thread {",
"removed": [
"\tprivate long timeSlice;\t\t\t\t// time slice for this thread",
"\tprivate Object timeSliceSync = new Object(); // sync object for updating time slice ",
"\tprivate boolean logConnections;\t\t// log connections to databases",
"\tprivate Object logConnectionsSync = new Object(); // sync object for log connect",
"\tprivate boolean close;\t\t\t\t// end this thread",
"\tprivate Object closeSync = new Object();\t// sync object for parent to close us down"
]
},
{
"added": [
" close = true;"
],
"header": "@@ -445,10 +445,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized (closeSync)",
"\t\t{",
"\t\t\tclose = true;",
"\t\t}"
]
},
{
"added": [
" logConnections = value;"
],
"header": "@@ -458,9 +455,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized(logConnectionsSync) {",
"\t\t\tlogConnections = value;",
"\t\t}"
]
},
{
"added": [
" timeSlice = value;"
],
"header": "@@ -469,9 +464,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized(timeSliceSync) {",
"\t\t\ttimeSlice = value;",
"\t\t}"
]
},
{
"added": [
" return close;"
],
"header": "@@ -8526,10 +8519,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized (closeSync)",
"\t\t{",
"\t\t\treturn close;",
"\t\t}"
]
},
{
"added": [
" return logConnections;"
],
"header": "@@ -8538,9 +8528,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized(logConnectionsSync) {",
"\t\t\treturn logConnections;",
"\t\t}"
]
},
{
"added": [
" return timeSlice;"
],
"header": "@@ -8549,9 +8537,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\tsynchronized(timeSliceSync) {",
"\t\t\treturn timeSlice;",
"\t\t}"
]
}
]
}
] |
derby-DERBY-5860-542c2b74
|
DERBY-5860: Remove unused methods in DDMReader and DDMWriter
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1362837 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/DDMReader.java",
"hunks": [
{
"added": [],
"header": "@@ -222,11 +222,6 @@ class DDMReader",
"removed": [
" // Get the current ccsidManager",
" protected CcsidManager getCurrentCcsidManager() {",
" return ccsidManager;",
" }",
" "
]
},
{
"added": [],
"header": "@@ -977,14 +972,6 @@ class DDMReader",
"removed": [
"\t",
"",
"\tbyte[] getExtData (boolean checkNullability) throws DRDAProtocolException",
"\t{",
"\t\treturn getExtData(ddmScalarLen, checkNullability);",
"\t}",
"",
"\t"
]
},
{
"added": [],
"header": "@@ -1352,18 +1339,6 @@ class DDMReader",
"removed": [
"\t/**",
"\t * Read boolean value",
"\t * @return\tvalue",
"\t *",
"\t * @exception DRDAProtocolException if a protocol error is detected",
"\t */",
"\tprotected boolean readBoolean () throws DRDAProtocolException",
"\t{",
"\t\tensureBLayerDataInBuffer (1, ADJUST_LENGTHS);",
"\t\treturn buffer[pos++] != 0;",
"\t}",
""
]
},
{
"added": [],
"header": "@@ -1458,18 +1433,6 @@ class DDMReader",
"removed": [
"\t/**",
"\t * Read string value in DDM data with default encoding",
"\t * @return value",
"\t *",
"\t * @exception DRDAProtocolException if a protocol error is detected",
"\t */",
"\tprotected String readStringData()",
"\t\tthrows DRDAProtocolException",
"\t{",
"\t\treturn readString((int)ddmScalarLen, NetworkServerControlImpl.DEFAULT_ENCODING);",
"\t}",
""
]
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/DDMWriter.java",
"hunks": [
{
"added": [],
"header": "@@ -675,43 +675,6 @@ class DDMWriter",
"removed": [
"",
"\t/**",
"\t * Write length and codepoint",
"\t *",
"\t * @param \tlength - length of object",
"\t * @param \tcodePoint - code point to write",
"\t */",
"\tprotected void startDdm (int length, int codePoint)",
"\t{",
"\t\tensureLength (4);",
"\t\tbuffer.putShort((short) length);",
"\t\tbuffer.putShort((short) codePoint);",
"\t}",
"",
"\t/**",
"\t * Write scalar byte array object includes length, codepoint and value",
"\t *",
"\t * @param \tcodePoint - code point to write",
"\t * @param\tbuf - value to write after code point",
"\t * @param\tlength - number of bytes to write",
"\t */",
"\tprotected void writeScalarBytes (int codePoint, byte[] buf, int length)",
"\t{",
"\t\tif (SanityManager.DEBUG)",
"\t\t{",
"\t\t\tif (buf == null && length > 0)",
"\t\t \tSanityManager.THROWASSERT(\"Buf is null\");",
"\t\t\tif (length > buf.length)",
"\t\t \tSanityManager.THROWASSERT(\"Not enough bytes in buffer\");",
"\t\t}",
"\t\tensureLength (length + 4);",
"\t\tbuffer.putShort((short) length);",
"\t\tbuffer.putShort((short) codePoint);",
"\t\tbuffer.put(buf, 0, length);",
"\t}",
"",
""
]
},
{
"added": [],
"header": "@@ -964,23 +927,6 @@ class DDMWriter",
"removed": [
"\t/**",
"\t * Write padded scalar string object value",
"\t * the string is converted into the appropriate codeset (EBCDIC)",
"\t *",
"\t * @param\tstring - string to be written",
"\t * @param \tpaddedLength - length to pad string to",
"\t */",
"\tprotected void writeScalarPaddedString (String string, int paddedLength)",
"\t{",
"\t\tint stringLength = ccsidManager.getByteLength(string);",
"",
"\t\tint fillLength = paddedLength -stringLength;",
"\t\tensureLength (paddedLength);",
"\t\tccsidManager.convertFromJavaString(string, buffer);",
"\t\tpadBytes(ccsidManager.space, fillLength);",
"\t}",
""
]
},
{
"added": [],
"header": "@@ -1043,29 +989,6 @@ class DDMWriter",
"removed": [
"\t/**",
"\t * Write scalar byte array object includes length, codepoint and value",
"\t *",
"\t * @param \tcodePoint - code point to write",
"\t * @param\tbuf - byte array to be written",
"\t * @param\tstart - starting point",
"\t * @param \tlength - length to write",
"\t */",
"\tprotected void writeScalarBytes (int codePoint, byte[] buf, int start, int length)",
"\t{",
"\t\tif (SanityManager.DEBUG)",
"\t\t{",
"\t\t\tif (buf == null && length > start)",
"\t\t \tSanityManager.THROWASSERT(\"Buf is null\");",
"\t\t\tif (length - start > buf.length)",
"\t\t\t\tSanityManager.THROWASSERT(\"Not enough bytes in buffer\");",
"\t\t}",
"\t\tint numBytes = length - start;",
"\t\tensureLength (numBytes + 4);",
"\t\tbuffer.putShort((short) (numBytes + 4));",
"\t\tbuffer.putShort((short) codePoint);",
"\t\tbuffer.put(buf, start, length);",
"\t}"
]
},
{
"added": [],
"header": "@@ -1801,39 +1724,6 @@ class DDMWriter",
"removed": [
"\t/***",
"\t * Prepend zeros to numeric string",
"\t *",
"\t * @param s string",
"\t * @param precision - length of padded string",
" \t *",
"\t * @return zero padded string",
"\t */",
"\tpublic static String zeroPadString(String s, int precision)",
"\t{",
"",
"\t\tif (s == null)",
"\t\t\treturn s;",
"",
"\t\tint slen = s.length();",
"\t\tif (precision == slen)",
"\t\t\treturn s;",
"\t\telse if (precision > slen)",
"\t\t{",
"\t\t\tchar[] ca = new char[precision - slen];",
"\t\t\tArrays.fill(ca,0,precision - slen,'0');",
"\t\t\treturn new String(ca) + s;",
"\t\t}",
"\t\telse",
"\t\t{",
"\t\t\t// Shouldn't happen but just in case ",
"\t\t\t// truncate",
"\t\t\treturn s.substring(0,precision);",
"\t\t}",
"",
"\t}",
"",
" "
]
},
{
"added": [],
"header": "@@ -1870,14 +1760,6 @@ class DDMWriter",
"removed": [
"\tprotected String toDebugString(String indent)",
"\t{",
"\t\tString s = indent + \"***** DDMWriter toDebugString ******\\n\";",
"\t\tint len = (buffer != null) ? buffer.capacity() : 0;",
"\t\ts += indent + \"byte buffer length = \" + len + \"\\n\";",
"\t\treturn s;",
"\t}",
""
]
}
]
}
] |
derby-DERBY-5864-8c854a90
|
DERBY-5864: Cannot load derbynet._Suite on some J2ME platforms
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1363508 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/Derby.java",
"hunks": [
{
"added": [
" // DERBY-5864: The network server is not supported on J2ME.",
" if (JDBC.vmSupportsJSR169()) {",
" return false;",
" }",
""
],
"header": "@@ -53,6 +53,11 @@ public class Derby {",
"removed": []
},
{
"added": [
" if (JDBC.vmSupportsJSR169()) {",
" }",
"",
" // classes folder - assume all is available.",
" if (!SecurityManagerSetup.isJars) {",
" return true;",
" }",
"",
" return hasCorrectJar(\"/derbyclient.jar\",",
" \"org.apache.derby.jdbc.ClientDataSource\");"
],
"header": "@@ -77,19 +82,20 @@ public class Derby {",
"removed": [
" // classes folder - assume all is available.",
" if (!SecurityManagerSetup.isJars)",
" return true;",
"",
" if (!JDBC.vmSupportsJSR169()) {",
" return hasCorrectJar(\"/derbyclient.jar\",",
" \"org.apache.derby.jdbc.ClientDataSource\");",
" }",
" else"
]
}
]
}
] |
derby-DERBY-5866-531b4694
|
DERBY-5866: Triggers fire out of order
In order to avoid ambiguities around switch from daylight saving time
to standard time, and other time zone changes, store the trigger
creation timestamps in Coordinated Universal Time (UTC) instead of the
local time zone.
Only use UTC if the database has been upgraded to 10.11 format, so
that the change won't cause problems on downgrade.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1555703 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/SYSTRIGGERSRowFactory.java",
"hunks": [
{
"added": [
"import java.util.Calendar;",
"import java.util.TimeZone;"
],
"header": "@@ -50,6 +50,8 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": []
},
{
"added": [
" /** TimeZone object representing Coordinated Universal Time. */",
" private final static TimeZone UTC = TimeZone.getTimeZone(\"UTC\");",
""
],
"header": "@@ -110,6 +112,9 @@ public class SYSTRIGGERSRowFactory extends CatalogRowFactory",
"removed": []
},
{
"added": [
" SQLTimestamp creationTimestamp = (createTime == null)",
" ? new SQLTimestamp(null)",
" : new SQLTimestamp(createTime, getCalendarForCreationTimestamp());",
" row.setColumn(4, creationTimestamp);"
],
"header": "@@ -230,7 +235,10 @@ public class SYSTRIGGERSRowFactory extends CatalogRowFactory",
"removed": [
"\t\trow.setColumn(4, new SQLTimestamp(createTime));"
]
},
{
"added": [
" /**",
" * Get a calendar instance with the correct time zone for storing and",
" * retrieving creation timestamps. Creation timestamps are stored in UTC",
" * to avoid ambiguities around the change from daylight saving time to",
" * standard time, or other time zone changes. If the data dictionary",
" * version is less than 10.11, however, the timestamps are stored in the",
" * local time zone.",
" *",
" * @return a calendar instance that can be used for storing and retrieving",
" * trigger creation timestamps",
" * @throws StandardException if an error occurs",
" */",
" private Calendar getCalendarForCreationTimestamp()",
" throws StandardException {",
" if (dataDictionary.checkVersion(",
" DataDictionary.DD_VERSION_DERBY_10_11, null)) {",
" return Calendar.getInstance(UTC);",
" } else {",
" return Calendar.getInstance();",
" }",
" }"
],
"header": "@@ -283,6 +291,27 @@ public class SYSTRIGGERSRowFactory extends CatalogRowFactory",
"removed": []
}
]
}
] |
derby-DERBY-5866-6bd38476
|
DERBY-5866: Triggers fire out of order
Make sure the creation timestamp of a newly created trigger is higher
than the timestamps of the existing triggers on the same table. If it
is not higher, the triggers may fire in the wrong order. If the
current timestamp is not higher than the timestamp of the previous
trigger defined on the table, the new trigger now gets a creation
timestamp that is one millisecond higher than the creation timestamp
of the previous trigger.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1555702 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/execute/CreateTriggerConstantAction.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.property.PropertyUtil;"
],
"header": "@@ -21,6 +21,7 @@",
"removed": []
},
{
"added": [
"import org.apache.derby.iapi.sql.dictionary.TriggerDescriptorList;"
],
"header": "@@ -33,6 +34,7 @@ import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;",
"removed": []
},
{
"added": [],
"header": "@@ -76,7 +78,6 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction",
"removed": [
"\tprivate Timestamp\t\t\t\tcreationTimestamp;"
]
},
{
"added": [],
"header": "@@ -100,8 +101,6 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction",
"removed": [
"\t * @param creationTimestamp\twhen was this trigger created? if null, will be",
"\t *\t\t\t\t\t\tset to the time that executeConstantAction() is invoked"
]
},
{
"added": [],
"header": "@@ -128,7 +127,6 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction",
"removed": [
"\t\tTimestamp\t\t\tcreationTimestamp,"
]
},
{
"added": [],
"header": "@@ -153,7 +151,6 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction",
"removed": [
"\t\tthis.creationTimestamp = creationTimestamp;"
]
},
{
"added": [
" makeCreationTimestamp(dd),"
],
"header": "@@ -316,7 +313,7 @@ class CreateTriggerConstantAction extends DDLSingleTableConstantAction",
"removed": [
"\t\t\t\t\t\t\t\t\tcreationTimestamp == null ? new Timestamp(System.currentTimeMillis()) : creationTimestamp,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/GenericConstantActionFactory.java",
"hunks": [
{
"added": [],
"header": "@@ -1007,8 +1007,6 @@ public class GenericConstantActionFactory",
"removed": [
"\t * @param creationTimestamp\twhen was this trigger created? if null, will be",
"\t *\t\t\t\t\t\tset to the time that executeConstantAction() is invoked"
]
},
{
"added": [],
"header": "@@ -1035,7 +1033,6 @@ public class GenericConstantActionFactory",
"removed": [
"\t\tTimestamp\t\t\tcreationTimestamp,"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/TimeZoneTestSetup.java",
"hunks": [
{
"added": [
" public static void setDefault(final TimeZone tz) {",
" new PrivilegedAction<Void>() {",
" public Void run() {"
],
"header": "@@ -70,13 +70,13 @@ public class TimeZoneTestSetup extends BaseTestSetup {",
"removed": [
" private void setDefault(final TimeZone tz) throws SecurityException{",
" new PrivilegedAction<Object>() {",
" public Object run() throws SecurityException {"
]
}
]
}
] |
derby-DERBY-5866-8d0da4fe
|
DERBY-5866( testFiringConstraintOrder(org.apache.derbyTesting.functionTests.tests.lang.TriggerTest)junit.framework.AssertionFailedError: matching triggers need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW)
As per Knut's recommendation, moving cleanup of TRIGGER_INFO back to tearDown(). Otherwise, the info from the last test case in TriggerTest won't be released until the JVM terminates. I don't expect it to take up a huge amount of memory, but with the big number of tests in suites.All unreleased data structures could accumulate and cause OOME.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523821 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5866-b9b6cd81
|
DERBY-5866( testFiringConstraintOrder(org.apache.derbyTesting.functionTests.tests.lang.TriggerTest) junit.framework.AssertionFailedError:matching triggers need to be fired in order creation:1,NO CASCADE BEFORE,DELETE,ROW )
Move the cleanup code from tearDown() to setup() so that if a test fixture fails, we will have the left over wombat database with the schema and data used by the failing fixture for further debugging.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1523501 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5868-5ef7a0d9
|
DERBY-5868: Move java.sql.Wrapper implementations to base classes on the client
Moved isWrapperFor() and unwrap() implementations to base classes to
reduce duplication of code.
Also moved some other methods that were duplicated in PreparedStatement40
and CallableStatement40 to their common base class PreparedStatement.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1364042 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/CallableStatement40.java",
"hunks": [
{
"added": [],
"header": "@@ -34,8 +34,6 @@ import java.sql.SQLXML;",
"removed": [
"import org.apache.derby.client.am.SqlException;",
"import org.apache.derby.client.am.ClientMessageId;"
]
},
{
"added": [
" * These are added here because we can't inherit PreparedStatement40. *",
" * Since the methods reference classes that did not exist prior to *",
" * JDBC 4.0, we cannot implement them in PreparedStatement, so we *",
" * duplicate them here. *"
],
"header": "@@ -173,40 +171,16 @@ public class CallableStatement40 extends org.apache.derby.client.am.CallableStat",
"removed": [
" * These are added here because we can't inherit *",
" * PreparedStatement40.java. Instead of moving the non-implemented *",
" * classes to PreparedStatement.java, we duplicate them here. *",
" public void setNString(int index, String value) throws SQLException {",
" throw SQLExceptionFactory.notImplemented (\"setNString (int, String)\");",
" }",
" ",
" public void setNCharacterStream(int parameterIndex, Reader value)",
" throws SQLException {",
" throw SQLExceptionFactory.notImplemented(\"setNCharacterStream\" +",
" \"(int,Reader)\");",
" }",
" public void setNCharacterStream(int index, Reader value, long length) throws SQLException {",
" throw SQLExceptionFactory.notImplemented (\"setNCharacterStream \" +",
" \"(int,Reader,long)\");",
" }",
" ",
" ",
" public void setNClob(int parameterIndex, Reader reader)",
" throws SQLException {",
" throw SQLExceptionFactory.notImplemented(\"setNClob(int,Reader)\");",
" }",
" public void setNClob(int parameterIndex, Reader reader, long length)",
" throws SQLException {",
" throw SQLExceptionFactory.notImplemented (\"setNClob (int, \" +",
" \"Reader, long)\");",
" }",
" "
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalCallableStatement40.java",
"hunks": [
{
"added": [],
"header": "@@ -28,11 +28,8 @@ import java.sql.NClob;",
"removed": [
"",
"import org.apache.derby.shared.common.reference.SQLState;",
""
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalPreparedStatement40.java",
"hunks": [
{
"added": [],
"header": "@@ -22,16 +22,12 @@ package org.apache.derby.client.am;",
"removed": [
"",
"",
"import org.apache.derby.shared.common.reference.SQLState;",
""
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/LogicalStatementEntity.java",
"hunks": [
{
"added": [
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -21,10 +21,9 @@",
"removed": [
"",
"import org.apache.derby.iapi.reference.SQLState;"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ParameterMetaData.java",
"hunks": [
{
"added": [
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -22,6 +22,7 @@",
"removed": []
}
]
},
{
"file": "java/client/org/apache/derby/client/am/PreparedStatement.java",
"hunks": [
{
"added": [],
"header": "@@ -21,10 +21,6 @@",
"removed": [
"import org.apache.derby.shared.common.reference.JDBC40Translation;",
"import org.apache.derby.shared.common.reference.SQLState;",
"import org.apache.derby.shared.common.sanity.SanityManager;",
""
]
},
{
"added": [
"import org.apache.derby.shared.common.reference.JDBC40Translation;",
"import org.apache.derby.shared.common.reference.SQLState;",
"import org.apache.derby.shared.common.sanity.SanityManager;"
],
"header": "@@ -36,6 +32,9 @@ import java.util.Arrays;",
"removed": []
},
{
"added": [
" // JDBC 4.0 methods"
],
"header": "@@ -2541,7 +2540,7 @@ public class PreparedStatement extends Statement",
"removed": [
" //jdbc 4.0 methods"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/PreparedStatement40.java",
"hunks": [
{
"added": [
"import java.sql.RowId;"
],
"header": "@@ -21,16 +21,11 @@",
"removed": [
"import java.sql.RowId;",
"import java.io.Reader;",
"import java.io.InputStream;",
"import org.apache.derby.client.am.SqlException;",
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.shared.common.reference.SQLState;"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Statement.java",
"hunks": [
{
"added": [
" public boolean isWrapperFor(Class<?> iface) throws SQLException {"
],
"header": "@@ -529,7 +529,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" public boolean isWrapperFor(Class iface) throws SQLException {"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java",
"hunks": [
{
"added": [
"import java.sql.SQLException;",
"import org.apache.derby.client.am.Agent;",
"import org.apache.derby.client.am.Cursor;",
"import org.apache.derby.client.am.LogWriter;",
"import org.apache.derby.client.am.LogicalConnection;",
"import org.apache.derby.client.am.LogicalConnection40;",
"import org.apache.derby.client.am.PreparedStatement;",
"import org.apache.derby.client.am.PreparedStatement40;",
"import org.apache.derby.client.am.StatementCacheInteractor;",
" * Implements the ClientJDBCObjectFactory interface and returns the JDBC 4.0",
" * specific classes. If specific classes are not needed for JDBC 4.0, the calls",
" * are delegated to ClientJDBCObjectFactoryImpl by inheritance.",
"public class ClientJDBCObjectFactoryImpl40 extends ClientJDBCObjectFactoryImpl {"
],
"header": "@@ -21,49 +21,40 @@",
"removed": [
"import org.apache.derby.client.am.ColumnMetaData;",
"import org.apache.derby.client.am.ColumnMetaData40;",
"import org.apache.derby.client.am.ClientJDBCObjectFactory;",
"import org.apache.derby.client.am.LogicalConnection;",
"import org.apache.derby.client.am.LogicalConnection40;",
"import org.apache.derby.client.am.PreparedStatement;",
"import org.apache.derby.client.am.PreparedStatement40;",
"import org.apache.derby.client.am.ParameterMetaData;",
"import org.apache.derby.client.am.ParameterMetaData40;",
"import org.apache.derby.client.am.LogWriter;",
"import org.apache.derby.client.am.Agent;",
"import org.apache.derby.client.am.Statement;",
"import org.apache.derby.client.am.Statement40;",
"import org.apache.derby.client.am.StatementCacheInteractor;",
"import org.apache.derby.client.am.Cursor;",
"import org.apache.derby.client.net.NetLogWriter;",
"import org.apache.derby.jdbc.ClientDataSource;",
"import java.sql.SQLException;",
"",
" * Implements the ClientJDBCObjectFactory interface",
" * and returns the JDBC4.0 specific classes",
"public class ClientJDBCObjectFactoryImpl40 implements ClientJDBCObjectFactory{"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource40.java",
"hunks": [
{
"added": [],
"header": "@@ -21,10 +21,8 @@",
"removed": [
"import java.sql.SQLException;",
"import javax.sql.DataSource;"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientDataSource.java",
"hunks": [
{
"added": [
"import org.apache.derby.client.am.ClientMessageId;",
"import org.apache.derby.shared.common.reference.SQLState;"
],
"header": "@@ -24,10 +24,11 @@ package org.apache.derby.jdbc;",
"removed": [
""
]
},
{
"added": [
" * JDBC 3.0 or JDBC 4.0, that is, on the following Java Virtual Machines:",
" * <LI> JDBC 4.0 - Java SE 6",
" * <LI> JDBC 3.0 - J2SE 5.0"
],
"header": "@@ -36,11 +37,11 @@ import org.apache.derby.client.net.NetLogWriter;",
"removed": [
" * JDBC3.0 or JDBC2.0, that is, on the following Java Virtual Machines:",
" * <LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0",
" * <LI> JDBC 2.0 - Java 2 - JDK 1.2,1.3"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientDataSource40.java",
"hunks": [
{
"added": [],
"header": "@@ -21,10 +21,8 @@",
"removed": [
"import java.sql.SQLException;",
"import javax.sql.DataSource;"
]
},
{
"added": [
" * JDBC level 4.1 (or higher). Use the corresponding ClientDataSource,",
" * ClientConnectionPoolDataSource, and ClientXADataSource classes if",
" *\t<LI> JDBC 4.0 - Java SE 6",
" *\t<LI> JDBC 3.0 - J2SE 5.0"
],
"header": "@@ -36,13 +34,13 @@ import org.apache.derby.shared.common.reference.SQLState;",
"removed": [
" * JDBC level 4.0 (or higher). Use the corresponding ClientDataSource, ClientConnectionPoolDataSource, and",
" * ClientXADataSource classes if ",
" *\t<LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0",
" *\t<LI> JDBC 2.0 - Java 2 - JDK 1.2,1.3"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientXADataSource.java",
"hunks": [
{
"added": [
"import org.apache.derby.client.net.NetLogWriter;",
" * This is Derby's network XADataSource for use with JDBC 3.0 and JDBC 4.0."
],
"header": "@@ -24,15 +24,13 @@ package org.apache.derby.jdbc;",
"removed": [
"",
"import org.apache.derby.client.net.NetLogWriter;",
"",
" * This is Derby's network XADataSource for use with JDBC3.0 and JDBC2.0."
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientXADataSource40.java",
"hunks": [
{
"added": [
" * This is Derby's network XADataSource for use with JDBC 4.1.",
" * Use ClientXADataSource40 if your application runs at JDBC level 4.1 (or",
" * higher). Use ClientXADataSource",
" * <LI> JDBC 4.0 - Java SE 6",
" * <LI> JDBC 3.0 - J2SE 5.0"
],
"header": "@@ -21,31 +21,26 @@",
"removed": [
"import java.sql.SQLException;",
"import javax.sql.DataSource;",
"import javax.sql.XAConnection;",
"import org.apache.derby.client.ClientXAConnection40;",
"import org.apache.derby.client.net.NetLogWriter;",
" * This is Derby's network XADataSource for use with JDBC4.0.",
" * Use ClientXADataSource40 if your application runs at JDBC level 4.0 (or higher).",
" * Use ClientXADataSource",
" * <LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0",
" * <LI> JDBC 2.0 - Java 2 - JDK 1.2,1.3"
]
}
]
}
] |
derby-DERBY-5872-2ff02ef7
|
DERBY-5872: Inconsistency between isWrapperFor() and unwrap() in logical statements
Make LogicalStatementEntity's isWrapperFor() only check the interfaces
implemented by the logical statement. This makes it consistent with the
unwrap() method, and also consistent with how isWrapperFor() works in
LogicalConnection40 and LogicalDatabaseMetaData40.
Add test cases for the new behaviour in PreparedStatementTest and
CallableStatementTest.
Enable ClosedObjectTest for logical statements.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1364524 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5873-40207815
|
DERBY-5873: Avoid unnecessary allocation of Number instances in client/server
Use BigDecimal's valueOf() factory methods instead of explicit constructor
calls where possible.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1372405 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/CrossConverters.java",
"hunks": [
{
"added": [
" // Convert to Double via String to avoid changing the precision,",
" // which may happen if we cast float to double."
],
"header": "@@ -388,6 +388,8 @@ final class CrossConverters {",
"removed": []
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/DDMReader.java",
"hunks": [
{
"added": [
" if (precision <= 18) {",
" if (signum < 0) {",
" value = -value;",
" }",
" return BigDecimal.valueOf(value, scale);"
],
"header": "@@ -870,37 +870,15 @@ class DDMReader",
"removed": [
" if (precision <= 9) {",
" // can be handled by int without overflow.",
" int value = packedNybblesToInt(buffer, pos, 0, length*2-1);",
"",
" // convert value to a byte array of magnitude.",
" byte[] magnitude = new byte[4];",
" magnitude[0] = (byte)(value >>> 24);",
" magnitude[1] = (byte)(value >>> 16);",
" magnitude[2] = (byte)(value >>> 8);",
" magnitude[3] = (byte)(value);",
"",
" pos += length;",
" return new java.math.BigDecimal (new java.math.BigInteger(signum, magnitude), scale);",
" }",
" else if (precision <= 18) {",
"",
" // convert value to a byte array of magnitude.",
" byte[] magnitude = new byte[8];",
" magnitude[0] = (byte)(value >>> 56);",
" magnitude[1] = (byte)(value >>> 48);",
" magnitude[2] = (byte)(value >>> 40);",
" magnitude[3] = (byte)(value >>> 32);",
" magnitude[4] = (byte)(value >>> 24);",
" magnitude[5] = (byte)(value >>> 16);",
" magnitude[6] = (byte)(value >>> 8);",
" magnitude[7] = (byte)(value);",
" return new java.math.BigDecimal (new java.math.BigInteger(signum, magnitude), scale);"
]
}
]
}
] |
derby-DERBY-5873-66527ec1
|
DERBY-5873: Avoid unnecessary allocation of Number instances in client/server
Replace explicit calls to constructors for java.lang.Number sub-classes and
java.lang.Boolean with valueOf() calls or with auto-boxing.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1365468 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/Blob.java",
"hunks": [
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), pos);",
" pos);",
" length);"
],
"header": "@@ -186,18 +186,17 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), ",
" new Long(pos));",
" new Long(pos));",
" new Integer(length));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), start);"
],
"header": "@@ -290,8 +289,7 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), ",
" new Long(start));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), start);"
],
"header": "@@ -333,8 +331,7 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), ",
" new Long(start));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), pos);"
],
"header": "@@ -435,7 +432,7 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), new Long(pos));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), pos);",
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), pos);",
" new ClientMessageId(SQLState.BLOB_INVALID_OFFSET), offset);",
" new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH), len);",
" new ClientMessageId(SQLState.BLOB_LENGTH_TOO_LONG), len);"
],
"header": "@@ -446,33 +443,29 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), new Long(pos));",
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE),",
" new Long(pos));",
" new ClientMessageId(SQLState.BLOB_INVALID_OFFSET), ",
" new Integer(offset));",
" new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH),",
" new Integer(len));",
" new ClientMessageId(SQLState.BLOB_LENGTH_TOO_LONG),",
" new Integer(len));"
]
},
{
"added": [
" pos);"
],
"header": "@@ -524,7 +517,7 @@ public class Blob extends Lob implements java.sql.Blob {",
"removed": [
" new Long(pos));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/CallableStatement.java",
"hunks": [
{
"added": [
" if (returnArg instanceof Integer)",
" returnArg = ((Integer) returnArg).shortValue();"
],
"header": "@@ -1198,9 +1198,9 @@ public class CallableStatement extends PreparedStatement",
"removed": [
" if ( (returnArg != null) && (returnArg instanceof Integer) )",
" returnArg = new Short( ((Integer) returnArg).shortValue() );"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Clob.java",
"hunks": [
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), pos);",
" length);",
" pos);"
],
"header": "@@ -274,20 +274,19 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION),",
" new Long(pos));",
" new Integer(length));",
" new Long(pos));"
]
},
{
"added": [
" start);"
],
"header": "@@ -438,7 +437,7 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new Long(start));"
]
},
{
"added": [
" start, \"start\", \"Clob.position()\");"
],
"header": "@@ -461,7 +460,7 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new Long(start), \"start\", \"Clob.position()\");"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), start);"
],
"header": "@@ -498,8 +497,7 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION),",
" new Long(start));"
]
},
{
"added": [
" start, \"start\", \"Clob.position()\");"
],
"header": "@@ -525,7 +523,7 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new Long(start), \"start\", \"Clob.position()\");"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION), pos);",
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE), pos);"
],
"header": "@@ -616,13 +614,11 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_BAD_POSITION),",
" new Long(pos));",
" new ClientMessageId(SQLState.BLOB_POSITION_TOO_LARGE),",
" new Long(pos));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BLOB_INVALID_OFFSET), offset);",
" new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH), len);",
" offset, len, str);"
],
"header": "@@ -637,21 +633,19 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new ClientMessageId(SQLState.BLOB_INVALID_OFFSET),",
" new Integer(offset));",
" new ClientMessageId(SQLState.BLOB_NONPOSITIVE_LENGTH),",
" new Integer(len));",
" new Integer(offset), new Integer(len), str);"
]
},
{
"added": [
" len);",
" len);"
],
"header": "@@ -771,13 +765,13 @@ public class Clob extends Lob implements java.sql.Clob {",
"removed": [
" new Long(len));",
" new Long(len));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/CrossConverters.java",
"hunks": [
{
"added": [
" return Short.valueOf(numVal);",
" return Integer.valueOf(numVal);",
" return Long.valueOf(numVal);",
" return Float.valueOf(numVal);",
" return Double.valueOf(numVal);"
],
"header": "@@ -107,19 +107,19 @@ final class CrossConverters {",
"removed": [
" return new Short(numVal);",
" return new Integer(numVal);",
" return new Long(numVal);",
" return new Float(numVal);",
" return new Double(numVal);"
]
},
{
"added": [
" return Short.valueOf(source);",
" return Integer.valueOf(source);",
" return Long.valueOf(source);",
" return Float.valueOf(source);",
" return Double.valueOf(source);"
],
"header": "@@ -151,19 +151,19 @@ final class CrossConverters {",
"removed": [
" return new Short(source);",
" return new Integer(source);",
" return new Long(source);",
" return new Float(source);",
" return new Double(source);"
]
},
{
"added": [
" return Short.valueOf((short) source);",
" return Integer.valueOf(source);",
" return Long.valueOf(source);",
" return Float.valueOf(source);",
" return Double.valueOf(source);"
],
"header": "@@ -194,19 +194,19 @@ final class CrossConverters {",
"removed": [
" return new Short((short) source);",
" return new Integer(source);",
" return new Long(source);",
" return new Float(source);",
" return new Double(source);"
]
},
{
"added": [
" return Short.valueOf((short) source);"
],
"header": "@@ -289,7 +289,7 @@ final class CrossConverters {",
"removed": [
" return new Short((short) source);"
]
},
{
"added": [
" return Integer.valueOf((int) source);",
" return Long.valueOf(source);",
" return Float.valueOf(source);",
" return Double.valueOf(source);"
],
"header": "@@ -297,16 +297,16 @@ final class CrossConverters {",
"removed": [
" return new Integer((int) source);",
" return new Long(source);",
" return new Float(source);",
" return new Double(source);"
]
},
{
"added": [
" return Short.valueOf((short) source);"
],
"header": "@@ -337,7 +337,7 @@ final class CrossConverters {",
"removed": [
" return new Short((short) source);"
]
},
{
"added": [
" return Integer.valueOf((int) source);"
],
"header": "@@ -345,7 +345,7 @@ final class CrossConverters {",
"removed": [
" return new Integer((int) source);"
]
},
{
"added": [
" return Long.valueOf((long) source);"
],
"header": "@@ -353,7 +353,7 @@ final class CrossConverters {",
"removed": [
" return new Long((long) source);"
]
},
{
"added": [
" return Float.valueOf(source);"
],
"header": "@@ -371,7 +371,7 @@ final class CrossConverters {",
"removed": [
" return new Float(source);"
]
},
{
"added": [
" return Double.valueOf(String.valueOf(source));"
],
"header": "@@ -388,7 +388,7 @@ final class CrossConverters {",
"removed": [
" return new Double(String.valueOf(source));"
]
},
{
"added": [
" return Short.valueOf((short) source);"
],
"header": "@@ -421,7 +421,7 @@ final class CrossConverters {",
"removed": [
" return new Short((short) source);"
]
},
{
"added": [
" return Integer.valueOf((int) source);"
],
"header": "@@ -429,7 +429,7 @@ final class CrossConverters {",
"removed": [
" return new Integer((int) source);"
]
},
{
"added": [
" return Long.valueOf((long) source);"
],
"header": "@@ -437,7 +437,7 @@ final class CrossConverters {",
"removed": [
" return new Long((long) source);"
]
},
{
"added": [
" return Float.valueOf((float) source);"
],
"header": "@@ -445,7 +445,7 @@ final class CrossConverters {",
"removed": [
" return new Float((float) source);"
]
},
{
"added": [
" return Double.valueOf(source);"
],
"header": "@@ -463,7 +463,7 @@ final class CrossConverters {",
"removed": [
" return new Double(source);"
]
},
{
"added": [
" return Short.valueOf(source.shortValue());"
],
"header": "@@ -494,7 +494,7 @@ final class CrossConverters {",
"removed": [
" return new Short(source.shortValue());"
]
},
{
"added": [
" return Integer.valueOf(source.intValue());"
],
"header": "@@ -502,7 +502,7 @@ final class CrossConverters {",
"removed": [
" return new Integer(source.intValue());"
]
},
{
"added": [
" return Long.valueOf(source.longValue());"
],
"header": "@@ -510,7 +510,7 @@ final class CrossConverters {",
"removed": [
" return new Long(source.longValue());"
]
},
{
"added": [
" return Float.valueOf(source.floatValue());"
],
"header": "@@ -518,7 +518,7 @@ final class CrossConverters {",
"removed": [
" return new Float(source.floatValue());"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/DateTime.java",
"hunks": [
{
"added": [
" year, \"9999\");"
],
"header": "@@ -269,7 +269,7 @@ public class DateTime {",
"removed": [
" new Integer(year), \"9999\");"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/EncryptionManager.java",
"hunks": [
{
"added": [
" 8, key.length);"
],
"header": "@@ -251,7 +251,7 @@ public class EncryptionManager {",
"removed": [
" new Integer(8), new Integer(key.length)); "
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/PreparedStatement.java",
"hunks": [
{
"added": [
" parameterIndex);"
],
"header": "@@ -461,7 +461,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new Integer(parameterIndex));"
]
},
{
"added": [
" setInput(parameterIndex, Short.valueOf(x));"
],
"header": "@@ -525,7 +525,7 @@ public class PreparedStatement extends Statement",
"removed": [
" setInput(parameterIndex, new Short(x));"
]
},
{
"added": [
" setInput(parameterIndex, x);"
],
"header": "@@ -566,7 +566,7 @@ public class PreparedStatement extends Statement",
"removed": [
" setInput(parameterIndex, new Short(x));"
]
},
{
"added": [
" setInput(parameterIndex, x);"
],
"header": "@@ -600,7 +600,7 @@ public class PreparedStatement extends Statement",
"removed": [
" setInput(parameterIndex, new Integer(x));"
]
},
{
"added": [
" setInput(parameterIndex, x);"
],
"header": "@@ -635,7 +635,7 @@ public class PreparedStatement extends Statement",
"removed": [
" setInput(parameterIndex, new Long(x));"
]
},
{
"added": [
" setInput(parameterIndex, x);"
],
"header": "@@ -658,7 +658,7 @@ public class PreparedStatement extends Statement",
"removed": [
" setInput(parameterIndex, new Float(x));"
]
},
{
"added": [
" agent_.logWriter_.traceEntry(this, \"setBinaryStream\",",
" parameterIndex, \"<input stream>\", Long.valueOf(length));"
],
"header": "@@ -957,7 +957,8 @@ public class PreparedStatement extends Statement",
"removed": [
" agent_.logWriter_.traceEntry(this, \"setBinaryStream\", parameterIndex, \"<input stream>\", new Long(length));"
]
},
{
"added": [
" parameterIndex, \"<input stream>\", Long.valueOf(length));"
],
"header": "@@ -1025,7 +1026,7 @@ public class PreparedStatement extends Statement",
"removed": [
" parameterIndex, \"<input stream>\", new Long(length));"
]
},
{
"added": [
" length,",
" Integer.MAX_VALUE"
],
"header": "@@ -1073,8 +1074,8 @@ public class PreparedStatement extends Statement",
"removed": [
" new Long(length),",
" new Integer(Integer.MAX_VALUE)"
]
},
{
"added": [
" agent_.logWriter_.traceEntry(this, \"setCharacterStream\",",
" parameterIndex, x, Long.valueOf(length));"
],
"header": "@@ -1224,7 +1225,8 @@ public class PreparedStatement extends Statement",
"removed": [
" agent_.logWriter_.traceEntry(this, \"setCharacterStream\", parameterIndex, x, new Long(length));"
]
},
{
"added": [
" resultSetHoldability_);"
],
"header": "@@ -2185,7 +2187,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new Integer(resultSetHoldability_));"
]
},
{
"added": [
" 65534, updateCounts);"
],
"header": "@@ -2223,7 +2225,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new Integer(65534), updateCounts);"
]
},
{
"added": [
" parameterIndex, parameterMetaData_.columns_);"
],
"header": "@@ -2413,8 +2415,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new Integer(parameterIndex), ",
" new Integer(parameterMetaData_.columns_));"
]
},
{
"added": [
" new ClientMessageId(SQLState.BAD_SCALE_VALUE), scale);"
],
"header": "@@ -2432,8 +2433,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new ClientMessageId(SQLState.BAD_SCALE_VALUE),",
" new Integer(scale));"
]
},
{
"added": [
" parameterIndex, reader, Long.valueOf(length));"
],
"header": "@@ -2651,7 +2651,7 @@ public class PreparedStatement extends Statement",
"removed": [
" parameterIndex, reader, new Long(length));"
]
},
{
"added": [
" length, Integer.MAX_VALUE).getSQLException();"
],
"header": "@@ -2661,7 +2661,7 @@ public class PreparedStatement extends Statement",
"removed": [
" new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/ResultSet.java",
"hunks": [
{
"added": [
" statement_.resultSetType_, resultSetType_));"
],
"header": "@@ -250,8 +250,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Integer(statement_.resultSetType_),",
" new Integer(resultSetType_)));"
]
},
{
"added": [
" row));"
],
"header": "@@ -2359,7 +2358,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Long(row)));"
]
},
{
"added": [
" direction);"
],
"header": "@@ -2658,7 +2657,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Integer(direction));"
]
},
{
"added": [
" rows).getSQLException();"
],
"header": "@@ -2694,7 +2693,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Integer(rows)).getSQLException();"
]
},
{
"added": [
" column);"
],
"header": "@@ -2827,7 +2826,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Integer(column));"
]
},
{
"added": [
" column, resultSetMetaData_.columns_);"
],
"header": "@@ -4771,7 +4770,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Integer(column), new Integer(resultSetMetaData_.columns_));"
]
},
{
"added": [
" length, Integer.MAX_VALUE).getSQLException();"
],
"header": "@@ -5673,7 +5672,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();"
]
},
{
"added": [
" length, Integer.MAX_VALUE).getSQLException();"
],
"header": "@@ -5737,7 +5736,7 @@ public abstract class ResultSet implements java.sql.ResultSet,",
"removed": [
" new Long(length), new Integer(Integer.MAX_VALUE)).getSQLException();"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Statement.java",
"hunks": [
{
"added": [
" type, \"type\", \"createStatement()\");"
],
"header": "@@ -383,7 +383,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(type), \"type\", \"createStatement()\");"
]
},
{
"added": [
" concurrency, \"concurrency\", \"createStatement()\");"
],
"header": "@@ -394,8 +394,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(concurrency), \"concurrency\",",
" \"createStatement()\");"
]
},
{
"added": [
" holdability, \"holdability\", \"createStatement()\");"
],
"header": "@@ -406,8 +405,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(holdability), \"holdability\",",
" \"createStatement()\");"
]
},
{
"added": [
" autoGeneratedKeys, \"autoGeneratedKeys\", \"createStatement\");"
],
"header": "@@ -418,8 +416,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(autoGeneratedKeys),",
" \"autoGeneratedKeys\", \"createStatement\");"
]
},
{
"added": [
" max);"
],
"header": "@@ -692,7 +689,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(max));"
]
},
{
"added": [
" maxRows);"
],
"header": "@@ -729,7 +726,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(maxRows));"
]
},
{
"added": [
" seconds);"
],
"header": "@@ -782,7 +779,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(seconds));"
]
},
{
"added": [
" direction);"
],
"header": "@@ -988,7 +985,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(direction));"
]
},
{
"added": [
" rows).getSQLException();"
],
"header": "@@ -1025,7 +1022,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(rows)).getSQLException();"
]
},
{
"added": [
" resultSetHoldability_);"
],
"header": "@@ -2179,7 +2176,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(resultSetHoldability_));"
]
},
{
"added": [
" autoGeneratedKeys_, \"autoGeneratedKeys\","
],
"header": "@@ -2933,7 +2930,7 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" new Integer(autoGeneratedKeys_), \"autoGeneratedKeys\","
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetConnection.java",
"hunks": [
{
"added": [
" securityMechanism);"
],
"header": "@@ -433,7 +433,7 @@ public class NetConnection extends org.apache.derby.client.am.Connection {",
"removed": [
" new Integer(securityMechanism));"
]
},
{
"added": [
" securityMechanism);"
],
"header": "@@ -556,7 +556,7 @@ public class NetConnection extends org.apache.derby.client.am.Connection {",
"removed": [
" new Integer(securityMechanism));"
]
},
{
"added": [
" usridLength, NetConfiguration.USRID_MAXSIZE);"
],
"header": "@@ -1086,8 +1086,7 @@ public class NetConnection extends org.apache.derby.client.am.Connection {",
"removed": [
" new Integer(usridLength), ",
" new Integer(NetConfiguration.USRID_MAXSIZE));"
]
},
{
"added": [
" passwordLength, NetConfiguration.PASSWORD_MAXSIZE);"
],
"header": "@@ -1096,8 +1095,7 @@ public class NetConnection extends org.apache.derby.client.am.Connection {",
"removed": [
" new Integer(passwordLength),",
" new Integer(NetConfiguration.PASSWORD_MAXSIZE));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetCursor.java",
"hunks": [
{
"added": [
" extdtaPositions_.put(i + 1, currentPosition++);"
],
"header": "@@ -512,7 +512,7 @@ public class NetCursor extends org.apache.derby.client.am.Cursor {",
"removed": [
" extdtaPositions_.put(new Integer(i + 1), new Integer(currentPosition++));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetStatementReply.java",
"hunks": [
{
"added": [
" scldtaLen));"
],
"header": "@@ -1593,7 +1593,7 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" new Integer(scldtaLen)));"
]
},
{
"added": [
" scldtaLen));"
],
"header": "@@ -1607,7 +1607,7 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" new Integer(scldtaLen)));"
]
},
{
"added": [
" scldtaLen));"
],
"header": "@@ -1620,7 +1620,7 @@ public class NetStatementReply extends NetPackageReply implements StatementReply",
"removed": [
" new Integer(scldtaLen)));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/NetStatementRequest.java",
"hunks": [
{
"added": [
" protocolTypesAndLengths[i][0], numVars, i);"
],
"header": "@@ -907,8 +907,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" new Integer(protocolTypesAndLengths[i][0]),",
" new Integer(numVars), new Integer(i));"
]
},
{
"added": [
" i);"
],
"header": "@@ -1170,7 +1169,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" new Integer(i));"
]
},
{
"added": [
" inputRow[i] = Short.valueOf("
],
"header": "@@ -1239,7 +1238,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" inputRow[i] = new Short("
]
},
{
"added": [
" jdbcType);"
],
"header": "@@ -1535,7 +1534,7 @@ public class NetStatementRequest extends NetPackageRequest implements StatementR",
"removed": [
" new Integer(jdbcType));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/Reply.java",
"hunks": [
{
"added": [
" minimumBytesNeeded, totalBytesRead));"
],
"header": "@@ -196,8 +196,7 @@ public class Reply {",
"removed": [
" new Integer(minimumBytesNeeded),",
" new Integer(totalBytesRead)));"
]
},
{
"added": [
" syntaxErrorCode));"
],
"header": "@@ -953,7 +952,7 @@ public class Reply {",
"removed": [
" new Integer(syntaxErrorCode)));"
]
},
{
"added": [
" actualCodePoint, expectedCodePoint));"
],
"header": "@@ -1075,8 +1074,7 @@ public class Reply {",
"removed": [
" new Integer(actualCodePoint), ",
" new Integer(expectedCodePoint)));"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/net/Request.java",
"hunks": [
{
"added": [
" netAgent_.accumulateReadException(",
" new SqlException(",
" netAgent_.logWriter_,",
" new ClientMessageId(SQLState.NET_EXCEPTION_ON_READ),",
" parameterIndex, e.getMessage(), e));"
],
"header": "@@ -323,12 +323,11 @@ public class Request {",
"removed": [
"\t\t\t\t\tnetAgent_.accumulateReadException(new SqlException(",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t netAgent_.logWriter_,",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ClientMessageId(SQLState.NET_EXCEPTION_ON_READ),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new Integer(parameterIndex),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t e.getMessage(),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t e));"
]
},
{
"added": [
" netAgent_.accumulateReadException(",
" new SqlException(netAgent_.logWriter_,",
" new ClientMessageId(SQLState.NET_PREMATURE_EOS),",
" parameterIndex));"
],
"header": "@@ -337,9 +336,10 @@ public class Request {",
"removed": [
"\t\t\t\t\tnetAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ClientMessageId(SQLState.NET_PREMATURE_EOS),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new Integer(parameterIndex)));"
]
},
{
"added": [
" netAgent_.accumulateReadException(new SqlException(",
" netAgent_.logWriter_,",
" new ClientMessageId(",
" SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),",
" parameterIndex));",
" netAgent_.accumulateReadException(new SqlException(",
" netAgent_.logWriter_,",
" new ClientMessageId(",
" SQLState.NET_EXCEPTION_ON_STREAMLEN_VERIFICATION),",
" parameterIndex, e.getMessage(), e));"
],
"header": "@@ -356,19 +356,19 @@ public class Request {",
"removed": [
"\t\t\t\tnetAgent_.accumulateReadException(new SqlException(netAgent_.logWriter_,",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ClientMessageId(SQLState.NET_INPUTSTREAM_LENGTH_TOO_SMALL),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new Integer(parameterIndex)));",
"\t\t\tnetAgent_.accumulateReadException(new SqlException(",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t netAgent_.logWriter_,",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new ClientMessageId(",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t SQLState.NET_EXCEPTION_ON_STREAMLEN_VERIFICATION),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t new Integer(parameterIndex),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t e.getMessage(),",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t e));"
]
},
{
"added": [
" parameterIndex, e.getMessage(), e);"
],
"header": "@@ -470,9 +470,7 @@ public class Request {",
"removed": [
" new Integer(parameterIndex),",
" e.getMessage(),",
" e);"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientConnectionPoolDataSource.java",
"hunks": [
{
"added": [
" MessageId.CONN_NEGATIVE_MAXSTATEMENTS, maxStatements));"
],
"header": "@@ -142,8 +142,7 @@ public class ClientConnectionPoolDataSource extends ClientDataSource",
"removed": [
" MessageId.CONN_NEGATIVE_MAXSTATEMENTS,",
" new Integer(maxStatements)));"
]
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/DRDAConnThread.java",
"hunks": [
{
"added": [
" knownManagers.add(manager);"
],
"header": "@@ -1721,7 +1721,7 @@ class DRDAConnThread extends Thread {",
"removed": [
"\t\t\t\tknownManagers.add(new Integer(manager));"
]
}
]
},
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [
" String[] args = {",
" on ? \"DRDA_ON.I\" : \"DRDA_OFF.I\",",
" Integer.toString(connNum),",
" };"
],
"header": "@@ -1302,9 +1302,10 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\tString[] args = new String[2];",
"\t\t\targs[0] = on ? \"DRDA_ON.I\" : \"DRDA_OFF.I\";",
"\t\t\targs[1] = new Integer(connNum).toString();"
]
},
{
"added": [
" consolePropertyMessage(\"DRDA_MaxThreadsChange.I\",",
" String.valueOf(newval));"
],
"header": "@@ -1411,8 +1412,8 @@ public final class NetworkServerControlImpl {",
"removed": [
" consolePropertyMessage(\"DRDA_MaxThreadsChange.I\", new Integer(",
" newval).toString());"
]
},
{
"added": [
" String.valueOf(newval));"
],
"header": "@@ -1438,7 +1439,7 @@ public final class NetworkServerControlImpl {",
"removed": [
" new Integer(newval).toString());"
]
},
{
"added": [
" sessionTable.remove(sessionid);"
],
"header": "@@ -1500,7 +1501,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tsessionTable.remove(new Integer(sessionid));"
]
},
{
"added": [
" if (version <= 0 || version > MAX_ALLOWED_PROTOCOL_VERSION) {",
" throw new Throwable(langUtil.getTextMessage(",
" \"DRDA_UnknownProtocol.S\", version));",
" }"
],
"header": "@@ -1631,8 +1632,10 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\tif (version <= 0 || version > MAX_ALLOWED_PROTOCOL_VERSION)",
"\t\t\t\tthrow new Throwable(langUtil.getTextMessage(\"DRDA_UnknownProtocol.S\", new Integer(version).toString()));"
]
},
{
"added": [
"\t\t\t\t\t\t\t\t\t new String [] {Integer.toString(sessionArg)}));"
],
"header": "@@ -1700,7 +1703,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\t\t\t\t new String [] {new Integer(sessionArg).toString()}));"
]
},
{
"added": [
" String.valueOf(newval));"
],
"header": "@@ -1747,7 +1750,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\tnew Integer(newval).toString());"
]
},
{
"added": [
" String.valueOf(newval));"
],
"header": "@@ -1760,7 +1763,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\tnew Integer(newval).toString());"
]
},
{
"added": [
"\t\t\t\t\t{hostArg, Integer.toString(portNumber)});"
],
"header": "@@ -2239,7 +2242,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t{hostArg, (new Integer(portNumber)).toString()});"
]
},
{
"added": [
"\t\t\t\t\t\t{Integer.toString(max), \"maxthreads\"});"
],
"header": "@@ -2264,7 +2267,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\t{new Integer(max).toString(), \"maxthreads\"});"
]
},
{
"added": [
"\t\t\t\t\t\t{Integer.toString(timeslice), \"timeslice\"});"
],
"header": "@@ -2283,7 +2286,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\t{new Integer(timeslice).toString(), \"timeslice\"});"
]
},
{
"added": [
" new String [] {",
" hostArg,",
" Integer.toString(portNumber),",
" e1.getMessage()",
" });"
],
"header": "@@ -2572,9 +2575,11 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\t\t\t\t\t\t new String [] {hostArg, ",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t (new Integer(portNumber)).toString(), ",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t e1.getMessage()});"
]
},
{
"added": [
" val = Integer.parseInt(propVal);"
],
"header": "@@ -3211,7 +3216,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t val = (new Integer(propVal)).intValue();"
]
},
{
"added": [
"\t\t\t\t{Integer.toString(value), \"timeslice\"});"
],
"header": "@@ -3651,7 +3656,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t{new Integer(value).toString(), \"timeslice\"});"
]
},
{
"added": [
"\t\t\t\t{Integer.toString(value), \"maxthreads\"});"
],
"header": "@@ -3711,7 +3716,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t{new Integer(value).toString(), \"maxthreads\"});"
]
},
{
"added": [
"\t\tretval.put(Property.DRDA_PROP_PORTNUMBER, Integer.toString(portNumber));",
"\t\tretval.put(Property.DRDA_PROP_KEEPALIVE, Boolean.toString(keepAlive));",
"\t\tretval.put(Property.DRDA_PROP_TRACEALL, Boolean.toString(getTraceAll()));",
"\t\tretval.put(Property.DRDA_PROP_MINTHREADS, Integer.toString(getMinThreads()));",
"\t\tretval.put(Property.DRDA_PROP_MAXTHREADS, Integer.toString(getMaxThreads()));",
"\t\tretval.put(Property.DRDA_PROP_TIMESLICE, Integer.toString(getTimeSlice()));",
"\t\tretval.put(Property.DRDA_PROP_TIMESLICE, Integer.toString(getTimeSlice()));",
"\t\tretval.put(Property.DRDA_PROP_LOGCONNECTIONS, Boolean.toString(getLogConnections()));"
],
"header": "@@ -3860,20 +3865,20 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tretval.put(Property.DRDA_PROP_PORTNUMBER, new Integer(portNumber).toString());",
"\t\tretval.put(Property.DRDA_PROP_KEEPALIVE, new Boolean(keepAlive).toString());",
"\t\tretval.put(Property.DRDA_PROP_TRACEALL, new Boolean(getTraceAll()).toString());",
"\t\tretval.put(Property.DRDA_PROP_MINTHREADS, new Integer(getMinThreads()).toString());",
"\t\tretval.put(Property.DRDA_PROP_MAXTHREADS, new Integer(getMaxThreads()).toString());",
"\t\tretval.put(Property.DRDA_PROP_TIMESLICE, new Integer(getTimeSlice()).toString());",
"\t\tretval.put(Property.DRDA_PROP_TIMESLICE, new Integer(getTimeSlice()).toString());",
"\t\tretval.put(Property.DRDA_PROP_LOGCONNECTIONS, new Boolean(getLogConnections()).toString());"
]
},
{
"added": [
" sessionTable.put(connectionNumber, session);"
],
"header": "@@ -3933,7 +3938,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\tsessionTable.put(new Integer(connectionNumber), session);"
]
}
]
}
] |
derby-DERBY-5874-6f660672
|
DERBY-5874: Remove JDBC 3 constants from client.am.Statement
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1365173 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/Statement.java",
"hunks": [
{
"added": [],
"header": "@@ -28,21 +28,6 @@ import org.apache.derby.shared.common.sanity.SanityManager;",
"removed": [
" // JDBC 3 constant indicating that the current ResultSet object",
" // should be closed when calling getMoreResults.",
" // Constant value matches that defined by JDBC 3 java.sql.Statement.CLOSE_CURRENT_RESULT",
" public final static int CLOSE_CURRENT_RESULT = 1;",
"",
" // JDBC 3 constant indicating that the current ResultSet object",
" // should not be closed when calling getMoreResults.",
" // Constant value matches that defined by JDBC 3 java.sql.Statement.KEEP_CURRENT_RESULT",
" public final static int KEEP_CURRENT_RESULT = 2;",
"",
" // JDBC 3 constant indicating that all ResultSet objects that",
" // have previously been kept open should be closed when calling getMoreResults.",
" // Constant value matches that defined by JDBC 3 java.sql.Statement.CLOSE_ALL_RESULTS",
" public final static int CLOSE_ALL_RESULTS = 3;",
""
]
}
]
}
] |
derby-DERBY-5877-f44e479b
|
DERBY-5877: Prune the brokered class tree
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1365465 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement.java",
"hunks": [
{
"added": [
" * JDBC 3 brokered CallableStatement",
"public class BrokeredCallableStatement extends BrokeredPreparedStatement",
" super(control, sql, null);",
" // JDBC 2.0 methods",
""
],
"header": "@@ -29,16 +29,18 @@ import java.util.Map;",
"removed": [
"\tJDBC 2 brokered CallableStatement",
"public abstract class BrokeredCallableStatement extends BrokeredPreparedStatement",
"\t\tsuper(control,sql);"
]
},
{
"added": [
" @Override"
],
"header": "@@ -60,6 +62,7 @@ public abstract class BrokeredCallableStatement extends BrokeredPreparedStatemen",
"removed": []
},
{
"added": [
" // JDBC 3.0 methods",
"",
" public final void setURL(String parameterName, java.net.URL value) throws SQLException {",
" getCallableStatement().setURL(parameterName, value);",
" }",
"",
" public final void setNull(String parameterName, int type) throws SQLException {",
" getCallableStatement().setNull(parameterName, type);",
" }",
"",
" public final void setBoolean(String parameterName, boolean value) throws SQLException {",
" getCallableStatement().setBoolean(parameterName, value);",
" }",
"",
" public final void setByte(String parameterName, byte value) throws SQLException {",
" getCallableStatement().setByte(parameterName, value);",
" }",
"",
" public final void setShort(String parameterName, short value) throws SQLException {",
" getCallableStatement().setShort(parameterName, value);",
" }",
"",
" public final void setInt(String parameterName, int value) throws SQLException {",
" getCallableStatement().setInt(parameterName, value);",
" }",
"",
" public final void setLong(String parameterName, long value) throws SQLException {",
" getCallableStatement().setLong(parameterName, value);",
" }",
"",
" public final void setFloat(String parameterName, float value) throws SQLException {",
" getCallableStatement().setFloat(parameterName, value);",
" }",
"",
" public final void setDouble(String parameterName, double value) throws SQLException {",
" getCallableStatement().setDouble(parameterName, value);",
" }",
"",
" public final void setBigDecimal(String parameterName, BigDecimal value) throws SQLException {",
" getCallableStatement().setBigDecimal(parameterName, value);",
" }",
"",
" public final void setString(String parameterName, String value) throws SQLException {",
" getCallableStatement().setString(parameterName, value);",
" }",
"",
" public final void setBytes(String parameterName, byte[] value) throws SQLException {",
" getCallableStatement().setBytes(parameterName, value);",
" }",
"",
" public final void setDate(String parameterName, Date value) throws SQLException {",
" getCallableStatement().setDate(parameterName, value);",
" }",
"",
" public final void setTime(String parameterName, Time value) throws SQLException {",
" getCallableStatement().setTime(parameterName, value);",
" }",
"",
" public final void setTimestamp(String parameterName, Timestamp value) throws SQLException {",
" getCallableStatement().setTimestamp(parameterName, value);",
" }",
"",
" public final void setAsciiStream(String parameterName, java.io.InputStream value, int length) throws SQLException {",
" getCallableStatement().setAsciiStream(parameterName, value, length);",
" }",
"",
" public final void setBinaryStream(String parameterName, java.io.InputStream value, int length) throws SQLException {",
" getCallableStatement().setBinaryStream(parameterName, value, length);",
" }",
"",
" public final void setObject(String parameterName, Object value, int a, int b) throws SQLException {",
" getCallableStatement().setObject(parameterName, value, a, b);",
" }",
"",
" public final void setObject(String parameterName, Object value, int a) throws SQLException {",
" getCallableStatement().setObject(parameterName, value, a);",
" }",
"",
" public final void setObject(String parameterName, Object value) throws SQLException {",
" getCallableStatement().setObject(parameterName, value);",
" }",
"",
" public final void setCharacterStream(String parameterName, java.io.Reader value, int length) throws SQLException {",
" getCallableStatement().setCharacterStream(parameterName, value, length);",
" }",
"",
" public final void setDate(String parameterName, Date value, Calendar cal) throws SQLException {",
" getCallableStatement().setDate(parameterName, value, cal);",
" }",
"",
" public final void setTime(String parameterName, Time value, Calendar cal) throws SQLException {",
" getCallableStatement().setTime(parameterName, value, cal);",
" }",
"",
" public final void setTimestamp(String parameterName, Timestamp value, Calendar cal) throws SQLException {",
" getCallableStatement().setTimestamp(parameterName, value, cal);",
" }",
"",
" public final void setNull(String parameterName, int a, String b) throws SQLException {",
" getCallableStatement().setNull(parameterName, a, b);",
" }",
"",
" public final String getString(String parameterName) throws SQLException {",
" return getCallableStatement().getString(parameterName);",
" }",
"",
" public final boolean getBoolean(String parameterName) throws SQLException {",
" return getCallableStatement().getBoolean(parameterName);",
" }",
"",
" public final byte getByte(String parameterName) throws SQLException {",
" return getCallableStatement().getByte(parameterName);",
" }",
"",
" public final short getShort(String parameterName) throws SQLException {",
" return getCallableStatement().getShort(parameterName);",
" }",
"",
" public final int getInt(String parameterName) throws SQLException {",
" return getCallableStatement().getInt(parameterName);",
" }",
"",
" public final long getLong(String parameterName) throws SQLException {",
" return getCallableStatement().getLong(parameterName);",
" }",
"",
" public final float getFloat(String parameterName) throws SQLException {",
" return getCallableStatement().getFloat(parameterName);",
" }",
"",
" public final double getDouble(String parameterName) throws SQLException {",
" return getCallableStatement().getDouble(parameterName);",
" }",
"",
" public final byte[] getBytes(String parameterName) throws SQLException {",
" return getCallableStatement().getBytes(parameterName);",
" }",
"",
" public final Date getDate(String parameterName) throws SQLException {",
" return getCallableStatement().getDate(parameterName);",
" }",
"",
" public final Time getTime(String parameterName) throws SQLException {",
" return getCallableStatement().getTime(parameterName);",
" }",
"",
" public final Timestamp getTimestamp(String parameterName) throws SQLException {",
" return getCallableStatement().getTimestamp(parameterName);",
" }",
"",
" public final Object getObject(String parameterName) throws SQLException {",
" return getCallableStatement().getObject(parameterName);",
" }",
"",
" public final BigDecimal getBigDecimal(String parameterName) throws SQLException {",
" return getCallableStatement().getBigDecimal(parameterName);",
" }",
"",
" public final Object getObject(String parameterName, Map<String, Class<?>> map) throws SQLException {",
" return getCallableStatement().getObject(parameterName, map);",
" }",
"",
" public final Ref getRef(String parameterName) throws SQLException {",
" return getCallableStatement().getRef(parameterName);",
" }",
"",
" public final Blob getBlob(String parameterName) throws SQLException {",
" return getCallableStatement().getBlob(parameterName);",
" }",
"",
" public final Clob getClob(String parameterName) throws SQLException {",
" return getCallableStatement().getClob(parameterName);",
" }",
"",
" public final Array getArray(String parameterName) throws SQLException {",
" return getCallableStatement().getArray(parameterName);",
" }",
"",
" public final Date getDate(String parameterName, Calendar cal) throws SQLException {",
" return getCallableStatement().getDate(parameterName, cal);",
" }",
"",
" public final Time getTime(String parameterName, Calendar cal) throws SQLException {",
" return getCallableStatement().getTime(parameterName, cal);",
" }",
"",
" public final Timestamp getTimestamp(String parameterName, Calendar cal) throws SQLException {",
" return getCallableStatement().getTimestamp(parameterName, cal);",
" }",
"",
" public final java.net.URL getURL(String parameterName) throws SQLException {",
" return getCallableStatement().getURL(parameterName);",
" }",
"",
" public final java.net.URL getURL(int i) throws SQLException {",
" return getCallableStatement().getURL(i);",
" }",
"",
" public final void registerOutParameter(String a, int b) throws SQLException {",
" getCallableStatement().registerOutParameter(a, b);",
" }",
"",
" public final void registerOutParameter(String a, int b, int c) throws SQLException {",
" getCallableStatement().registerOutParameter(a, b, c);",
" }",
"",
" public final void registerOutParameter(String a, int b, String c) throws SQLException {",
" getCallableStatement().registerOutParameter(a, b, c);",
" }",
""
],
"header": "@@ -215,6 +218,216 @@ public abstract class BrokeredCallableStatement extends BrokeredPreparedStatemen",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -237,6 +450,7 @@ public abstract class BrokeredCallableStatement extends BrokeredPreparedStatemen",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredConnection.java",
"hunks": [
{
"added": [
"import java.sql.Connection;",
"import java.sql.PreparedStatement;",
"import java.sql.ResultSet;",
"import java.sql.Savepoint;",
"import java.sql.Statement;"
],
"header": "@@ -21,15 +21,15 @@",
"removed": [
"import java.sql.Connection;",
"import java.sql.ResultSet;",
"import java.sql.Statement;",
"import java.sql.PreparedStatement;",
""
]
},
{
"added": [
"public class BrokeredConnection implements EngineConnection"
],
"header": "@@ -37,7 +37,7 @@ import org.apache.derby.shared.common.reference.SQLState;",
"removed": [
"public abstract class BrokeredConnection implements EngineConnection"
]
},
{
"added": [
" // JDBC 2.0 methods",
""
],
"header": "@@ -72,6 +72,8 @@ public abstract class BrokeredConnection implements EngineConnection",
"removed": []
},
{
"added": [
" // JDBC 3.0 methods",
"",
" public final Statement createStatement(int resultSetType,",
" int resultSetConcurrency,",
" int resultSetHoldability)",
" throws SQLException {",
" try {",
" resultSetHoldability =",
" statementHoldabilityCheck(resultSetHoldability);",
" return control.wrapStatement(",
" getRealConnection().createStatement(resultSetType,",
" resultSetConcurrency, resultSetHoldability));",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final CallableStatement prepareCall(String sql,",
" int resultSetType,",
" int resultSetConcurrency,",
" int resultSetHoldability)",
" throws SQLException {",
" try {",
" resultSetHoldability =",
" statementHoldabilityCheck(resultSetHoldability);",
" return control.wrapStatement(",
" getRealConnection().prepareCall(sql, resultSetType,",
" resultSetConcurrency, resultSetHoldability), sql);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final Savepoint setSavepoint()",
" throws SQLException {",
" try {",
" control.checkSavepoint();",
" return getRealConnection().setSavepoint();",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final Savepoint setSavepoint(String name)",
" throws SQLException {",
" try {",
" control.checkSavepoint();",
" return getRealConnection().setSavepoint(name);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final void rollback(Savepoint savepoint)",
" throws SQLException {",
" try {",
" control.checkRollback();",
" getRealConnection().rollback(savepoint);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final void releaseSavepoint(Savepoint savepoint)",
" throws SQLException {",
" try {",
" getRealConnection().releaseSavepoint(savepoint);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final void setHoldability(int holdability)",
" throws SQLException {",
" try {",
" holdability = control.checkHoldCursors(holdability, false);",
" getRealConnection().setHoldability(holdability);",
" stateHoldability = holdability;",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final PreparedStatement prepareStatement(",
" String sql,",
" int autoGeneratedKeys)",
" throws SQLException {",
" try {",
" return control.wrapStatement(getRealConnection().prepareStatement(",
" sql, autoGeneratedKeys), sql, autoGeneratedKeys);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final PreparedStatement prepareStatement(",
" String sql,",
" int[] columnIndexes)",
" throws SQLException {",
" try {",
" return control.wrapStatement(getRealConnection().prepareStatement(",
" sql, columnIndexes), sql, columnIndexes);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
" public final PreparedStatement prepareStatement(",
" String sql,",
" String[] columnNames)",
" throws SQLException {",
" try {",
" return control.wrapStatement(getRealConnection().prepareStatement(",
" sql, columnNames), sql, columnNames);",
" } catch (SQLException se) {",
" notifyException(se);",
" throw se;",
" }",
" }",
"",
""
],
"header": "@@ -362,6 +364,136 @@ public abstract class BrokeredConnection implements EngineConnection",
"removed": []
},
{
"added": [
"",
" public BrokeredPreparedStatement newBrokeredStatement(",
" BrokeredStatementControl statementControl, String sql,",
" Object generatedKeys) throws SQLException {",
" return new BrokeredPreparedStatement(",
" statementControl, sql, generatedKeys);",
" }",
"",
" public BrokeredCallableStatement newBrokeredStatement(",
" BrokeredStatementControl statementControl, String sql)",
" throws SQLException {",
" return new BrokeredCallableStatement(statementControl, sql);",
" }"
],
"header": "@@ -446,12 +578,19 @@ public abstract class BrokeredConnection implements EngineConnection",
"removed": [
"\tpublic abstract BrokeredPreparedStatement",
" newBrokeredStatement(BrokeredStatementControl statementControl,",
" String sql, Object generatedKeys) throws SQLException;",
"\tpublic abstract BrokeredCallableStatement",
" newBrokeredStatement(BrokeredStatementControl statementControl,",
" String sql) throws SQLException;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java",
"hunks": [
{
"added": [
"import java.sql.*;",
"import java.util.Calendar;",
"\tJDBC 3 brokered PreparedStatement. Forwards calls off to a real prepared statement",
"public class BrokeredPreparedStatement extends BrokeredStatement"
],
"header": "@@ -23,16 +23,15 @@ package org.apache.derby.iapi.jdbc;",
"removed": [
"import java.util.Calendar;",
"",
"import java.sql.*;",
"\tJDBC 2 brokered PreparedStatement. Forwards calls off to a real prepared statement",
"public abstract class BrokeredPreparedStatement extends BrokeredStatement"
]
},
{
"added": [
" /**",
" * An Integer, an int array or a String array that specifies generated",
" * key columns, or null if there are no generated key columns.",
" */",
" private final Object generatedKeys;",
"",
" public BrokeredPreparedStatement(BrokeredStatementControl control,",
" String sql, Object generatedKeys) throws SQLException",
" this.generatedKeys = generatedKeys;"
],
"header": "@@ -41,10 +40,18 @@ public abstract class BrokeredPreparedStatement extends BrokeredStatement",
"removed": [
" public BrokeredPreparedStatement(BrokeredStatementControl control, String sql) throws SQLException"
]
},
{
"added": [
" @Override"
],
"header": "@@ -73,6 +80,7 @@ public abstract class BrokeredPreparedStatement extends BrokeredStatement",
"removed": []
},
{
"added": [
" // JDBC 3.0 methods",
"",
" public final void setURL(int i, URL x) throws SQLException {",
" getPreparedStatement().setURL(i, x);",
" }",
"",
" public final ParameterMetaData getParameterMetaData() throws SQLException {",
" return getPreparedStatement().getParameterMetaData();",
" }",
""
],
"header": "@@ -516,6 +524,16 @@ public abstract class BrokeredPreparedStatement extends BrokeredStatement",
"removed": []
},
{
"added": [
" @Override"
],
"header": "@@ -534,6 +552,7 @@ public abstract class BrokeredPreparedStatement extends BrokeredStatement",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver30.java",
"hunks": [
{
"added": [
"import java.util.Properties;",
"import org.apache.derby.iapi.jdbc.BrokeredConnection;",
"import org.apache.derby.iapi.jdbc.BrokeredConnectionControl;",
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"import org.apache.derby.impl.jdbc.*;"
],
"header": "@@ -21,26 +21,15 @@",
"removed": [
"import org.apache.derby.impl.jdbc.EmbedConnection;",
"",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"",
"import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.jdbc.BrokeredConnection;",
"import org.apache.derby.iapi.jdbc.BrokeredConnection30;",
"import org.apache.derby.iapi.jdbc.BrokeredConnectionControl;",
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"",
"import org.apache.derby.impl.jdbc.*;",
"",
"/** -- jdbc 2.0. extension -- */",
"",
"import java.util.Properties;"
]
},
{
"added": [
" return new BrokeredConnection(control);"
],
"header": "@@ -124,8 +113,7 @@ public class Driver30 extends Driver20 {",
"removed": [
"",
"\t\treturn new BrokeredConnection30(control);"
]
}
]
}
] |
derby-DERBY-5878-0919fda2
|
DERBY-5878: Add ability to add comments for translators to the message descriptors in messages.xml.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1367230 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/build/org/apache/derbyBuild/MessageBuilder.java",
"hunks": [
{
"added": [
" String[] comments = getOptionalSubElements( message, \"comment\" );",
" String[] args = getOptionalSubElements( message, \"arg\" );"
],
"header": "@@ -560,7 +560,8 @@ public class MessageBuilder extends Task",
"removed": [
" String[] args = getArgs( message );"
]
},
{
"added": [
" ",
" if ( comments.length != 0 )",
" {",
" for ( int i = 0; i < comments.length; i++ )",
" {",
" propertiesPW.println( \"# \" + comments[ i ] );",
" }",
" propertiesPW.println( \"#\" );",
" }",
" "
],
"header": "@@ -586,6 +587,16 @@ public class MessageBuilder extends Task",
"removed": []
}
]
}
] |
derby-DERBY-5878-7e9a11de
|
DERBY-5878: Add message argument names, as comments, to message file generated by MessageBuilder.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1365552 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/build/org/apache/derbyBuild/MessageBuilder.java",
"hunks": [
{
"added": [],
"header": "@@ -572,7 +572,6 @@ public class MessageBuilder extends Task",
"removed": [
""
]
},
{
"added": [
"",
" propertiesPW.println( \"\" );",
" if ( args.length != 0 )",
" {",
" propertiesPW.println( \"# Arguments:\" );",
" propertiesPW.println( \"#\" );",
" for ( int i = 0; i < args.length; i++ )",
" {",
" propertiesPW.println( \"# \" + args[ i ] );",
" }",
" propertiesPW.println( \"#\" );",
" }"
],
"header": "@@ -585,7 +584,18 @@ public class MessageBuilder extends Task",
"removed": [
" "
]
}
]
}
] |
derby-DERBY-5879-5c29a4d2
|
DERBY-5879: Add comments for translators to some error messages, fix some string concatenation problems.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1367985 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java",
"hunks": [
{
"added": [
" String messageID;",
" String[] args = null;",
" ",
" {",
" if ( on ) { messageID = \"DRDA_TraceChangeAllOn.I\"; }",
" else { messageID = \"DRDA_TraceChangeAllOff.I\"; }",
" }",
" if ( on ) { messageID = \"DRDA_TraceChangeOneOn.I\"; }",
" else { messageID = \"DRDA_TraceChangeOneOff.I\"; }",
"",
" args = new String[] { Integer.toString(connNum) };",
" ",
" ",
" consolePropertyMessage( messageID, args );"
],
"header": "@@ -1298,16 +1298,24 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\tconsolePropertyMessage(\"DRDA_TraceChangeAll.I\", on ? \"DRDA_ON.I\" : \"DRDA_OFF.I\");",
" String[] args = {",
" on ? \"DRDA_ON.I\" : \"DRDA_OFF.I\",",
" Integer.toString(connNum),",
" };",
"\t\t\tconsolePropertyMessage(\"DRDA_TraceChangeOne.I\", args);"
]
},
{
"added": [
" logConnectionsChange( log );"
],
"header": "@@ -1727,8 +1735,7 @@ public final class NetworkServerControlImpl {",
"removed": [
"\t\t\t\t\tconsolePropertyMessage(\"DRDA_LogConnectionsChange.I\",",
"\t\t\t\t\t\t(log ? \"DRDA_ON.I\" : \"DRDA_OFF.I\"));"
]
},
{
"added": [
"",
" /** Record a change to the connection logging mode */",
" private void logConnectionsChange( boolean on )",
" throws Exception",
" {",
" String[] args = null;",
" String messageID;",
"",
" if ( on ) { messageID = \"DRDA_LogConnectionsChangeOn.I\"; }",
" else { messageID = \"DRDA_LogConnectionsChangeOff.I\"; }",
"",
" consolePropertyMessage( messageID, args );",
" }",
" "
],
"header": "@@ -1778,6 +1785,20 @@ public final class NetworkServerControlImpl {",
"removed": []
}
]
},
{
"file": "java/tools/org/apache/derby/impl/tools/ij/ijException.java",
"hunks": [
{
"added": [],
"header": "@@ -53,7 +53,6 @@ public class ijException extends RuntimeException {",
"removed": [
"\tprivate final static String NotJDBC20 = \"IJ_IsOnlySuppIn\";"
]
}
]
}
] |
derby-DERBY-5880-46e89a99
|
DERBY-5880: Move java.sql.Wrapper implementations to base classes in embedded driver
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1372403 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java",
"hunks": [
{
"added": [],
"header": "@@ -175,33 +175,6 @@ public class BrokeredCallableStatement40 extends BrokeredCallableStatement",
"removed": [
" /**",
" * Sets the designated parameter to the given input stream.",
" *",
" * @param parameterIndex the first parameter is 1, the second is 2, ...",
" * @param x the java input stream which contains the binary parameter value",
" * @throws SQLException if a database access error occurs or this method is",
" * called on a closed <code>PreparedStatement</code>",
" */",
" public final void setBinaryStream(int parameterIndex, InputStream x)",
" throws SQLException {",
" getCallableStatement().setBinaryStream(parameterIndex, x);",
" }",
"",
" /**",
" * Sets the designated parameter to the given <code>Reader</code> object.",
" *",
" * @param parameterIndex the first parameter is 1, the second is 2, ...",
" * @param reader the <code>java.io.Reader</code> object that contains the",
" * Unicode data",
" * @throws SQLException if a database access error occurs or this method is",
" * called on a closed <code>PreparedStatement</code>",
" */",
" public final void setCharacterStream(int parameterIndex, Reader reader)",
" throws SQLException {",
" getCallableStatement().setCharacterStream(parameterIndex, reader);",
" }",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java",
"hunks": [
{
"added": [
" // JDBC 4.0 java.sql.Wrapper interface methods",
""
],
"header": "@@ -526,6 +526,8 @@ public class BrokeredStatement implements EngineStatement",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java",
"hunks": [
{
"added": [],
"header": "@@ -28,13 +28,11 @@ import java.sql.Blob;",
"removed": [
"import java.sql.ParameterMetaData;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedParameterMetaData30.java",
"hunks": [
{
"added": [
"import java.sql.ParameterMetaData;",
"import java.sql.SQLException;",
"import org.apache.derby.iapi.reference.SQLState;",
" * This class implements the ParameterMetaData interface from JDBC 3.0 and 4.0."
],
"header": "@@ -21,13 +21,14 @@",
"removed": [
"import java.sql.ParameterMetaData;",
"",
" * This class implements the ParameterMetaData interface from JDBC3.0"
]
},
{
"added": [
" <LI> JDBC 4.0 - extra methods from java.sql.Wrapper introduced in JDBC 4.0"
],
"header": "@@ -35,6 +36,7 @@ import java.sql.ParameterMetaData;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource.java",
"hunks": [
{
"added": [
"\timplementation for JDBC 3.0 and JDBC 4.0."
],
"header": "@@ -22,14 +22,11 @@",
"removed": [
"",
"/* -- New jdbc 20 extension types --- */",
"import javax.sql.ConnectionPoolDataSource;",
"\timplementation for the JDBC3.0 environment."
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java",
"hunks": [
{
"added": [
" implementation for JDBC 4.1 (and higher) environments.",
" Use EmbeddedConnectionPoolDataSource40 if your application runs at JDBC",
" level 4.1 (or higher).",
" <LI> JDBC 3.0 - J2SE 5.0 </LI>",
" <LI> JDBC 4.0 - Java SE 6 </LI>"
],
"header": "@@ -20,31 +20,28 @@",
"removed": [
"import java.sql.SQLException;",
"import javax.sql.DataSource;",
"import javax.sql.PooledConnection;",
"",
"import org.apache.derby.iapi.reference.SQLState;",
"\timplementation for JDBC 4.0 (and higher) environments.",
"\tUse EmbeddedConnectionPoolDataSource40 if your application runs at JDBC level 4.0 (or higher).",
"\t<LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java",
"hunks": [
{
"added": [
"import java.io.PrintWriter;",
" EmbeddedDataSource is Derby's DataSource implementation for JDBC 3.0",
" and JDBC 4.0."
],
"header": "@@ -21,32 +21,20 @@",
"removed": [
"import org.apache.derby.iapi.reference.Attribute;",
"",
"",
"import java.io.PrintWriter;",
"",
"/* -- New jdbc 20 extension types --- */",
"import javax.sql.DataSource;",
"",
"",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"\t",
"\tEmbeddedDataSource is Derby's DataSource implementation for JDBC3.0.",
"\t"
]
},
{
"added": [
" <LI> JDBC 3.0 - J2SE 5.0 </LI>",
" <LI> JDBC 4.0 - Java SE 6 </LI>"
],
"header": "@@ -55,7 +43,8 @@ import org.apache.derby.impl.jdbc.Util;",
"removed": [
"\t<LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource40.java",
"hunks": [
{
"added": [
"\tEmbeddedDataSource40 is Derby's DataSource implementation for JDBC 4.1.",
" Use EmbeddedDataSource40 if your application runs at JDBC level 4.1",
" (or higher).",
" <LI> JDBC 3.0 - J2SE 5.0 </LI>",
" <LI> JDBC 4.0 - Java SE 6 </LI>"
],
"header": "@@ -21,30 +21,26 @@",
"removed": [
"import java.sql.SQLException;",
"import javax.sql.DataSource;",
"",
"import org.apache.derby.iapi.reference.SQLState;",
"\t",
"\tEmbeddedDataSource40 is Derby's DataSource implementation for JDBC 4.0 (and higher).",
"\t",
"\tUse EmbeddedDataSource40 if your application runs at JDBC level 4.0 (or higher).",
"\t<LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java",
"hunks": [
{
"added": [
"import java.sql.SQLException;",
"import javax.sql.XAConnection;",
"import org.apache.derby.iapi.db.Database;",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"import org.apache.derby.iapi.reference.Property;",
" EmbeddedXADataSource is Derby's XADataSource implementation for JDBC 3.0",
" and JDBC 4.0."
],
"header": "@@ -21,31 +21,20 @@",
"removed": [
"",
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"import org.apache.derby.iapi.db.Database;",
"",
"import org.apache.derby.iapi.reference.Property;",
"",
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"",
"import java.sql.SQLException;",
"import java.sql.Connection;",
"import java.sql.Driver;",
"",
"",
"/** -- jdbc 2.0. extension -- */",
"import javax.sql.XADataSource;",
"import javax.sql.XAConnection;",
"",
"\tEmbeddedXADataSource is Derby's XADataSource implementation for JDBC3.0.",
"\t"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java",
"hunks": [
{
"added": [
" EmbeddedXADataSource40 is Derby's XADataSource implementation for",
" JDBC 4.1 (and higher).",
" Use EmbeddedXADataSource40 if your application runs at JDBC level 4.1",
" (or higher).",
" <LI> JDBC 3.0 - J2SE 5.0 </LI>",
" <LI> JDBC 4.0 - Java SE 6 </LI>"
],
"header": "@@ -21,32 +21,26 @@",
"removed": [
"import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"",
"import java.sql.SQLException;",
"import javax.sql.DataSource;",
"import javax.sql.XAConnection;",
"import javax.sql.XADataSource;",
"",
"import org.apache.derby.iapi.reference.SQLState;",
"\tEmbeddedXADataSource40 is Derby's XADataSource implementation for JDBC 4.0 (and higher).",
"\t",
"\tUse EmbeddedXADataSource40 if your application runs at JDBC level 4.0 (or higher).",
"\t<LI> JDBC 3.0 - Java 2 - JDK 1.4, J2SE 5.0"
]
}
]
}
] |
derby-DERBY-5885-870f7cd3
|
DERBY-5885: Re-order message args to correspond with argument numbers.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1367150 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/XML.java",
"hunks": [
{
"added": [
" SQLState.LANG_XML_QUERY_ERROR,"
],
"header": "@@ -830,7 +830,7 @@ public class XML",
"removed": [
" SQLState.LANG_XML_QUERY_ERROR, xe,"
]
}
]
},
{
"file": "java/shared/org/apache/derby/shared/common/reference/SQLState.java",
"hunks": [
{
"added": [],
"header": "@@ -390,7 +390,6 @@ public interface SQLState {",
"removed": [
"\tString LOG_TRUNC_LWM_NULL = \"XSLB4.S\";"
]
},
{
"added": [
"\tString LANG_NON_BOOLEAN_WHERE_CLAUSE = \"42X19.S.1\";",
"\tString LANG_UNTYPED_PARAMETER_IN_WHERE_CLAUSE = \"42X19.S.2\";"
],
"header": "@@ -838,7 +837,8 @@ public interface SQLState {",
"removed": [
"\tString LANG_NON_BOOLEAN_WHERE_CLAUSE = \"42X19\";"
]
},
{
"added": [],
"header": "@@ -1018,8 +1018,6 @@ public interface SQLState {",
"removed": [
"\tString LANG_JAVACC_SYNTAX\t\t\t\t\t\t\t\t\t\t = \"42Y98.U\";",
"\tString LANG_JAVACC_LEXICAL_ERROR\t\t\t\t\t\t\t\t = \"42Y99.U\";"
]
},
{
"added": [],
"header": "@@ -1109,7 +1107,6 @@ public interface SQLState {",
"removed": [
" String LANG_VTI_BLOB_CLOB_UNSUPPORTED = \"42Z9B\";"
]
},
{
"added": [],
"header": "@@ -1491,7 +1488,6 @@ public interface SQLState {",
"removed": [
"\tString DEP_UNABLE_TO_RESTORE = \"XD003.S\";"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/JDBC.java",
"hunks": [
{
"added": [
" if ( !actual.containsAll(expected) )",
" {",
" expected.removeAll( actual );",
" BaseTestCase.println",
" ( \"These expected rows don't appear in the actual result: \" + expected );",
" Assert.fail( \"Missing rows in ResultSet\" );",
" }"
],
"header": "@@ -1387,8 +1387,13 @@ public class JDBC {",
"removed": [
" Assert.assertTrue(\"Missing rows in ResultSet\",",
" actual.containsAll(expected));"
]
}
]
}
] |
derby-DERBY-5889-761ebfb6
|
DERBY-5889: tests.compatibility._Suite has AccessControlException errors on Windows
Relaxed the criteria casuing the test to be disabled on Windows such that it
will only be disabled if at least one of the releases is located on an UNC path.
Patch file: derby-5889-1b-disable_test_relaxed.diff
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1394250 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5894-6d4d95d4
|
DERBY-5894: NPE in OnlineBackupTest1 while backing up in stubFileToRemoveAfterCheckPoint
Stop using the shared run() method from RAFContainer.backupContainer(),
as it is not safe to use without synchronization (which is why the
NullPointerException happened).
Also, use doPrivileged() only to execute those parts of the code that
need to run with privileges, as most of the code called from
backupContainer() does not need privileges.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1422845 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/store/raw/data/RAFContainer.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.util.ReuseFactory;"
],
"header": "@@ -28,6 +28,7 @@ import org.apache.derby.iapi.services.io.FormatIdUtil;",
"removed": []
},
{
"added": [
"import java.security.PrivilegedAction;"
],
"header": "@@ -44,6 +45,7 @@ import java.io.File;",
"removed": []
},
{
"added": [],
"header": "@@ -72,7 +74,6 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
"\tprivate static final int BACKUP_CONTAINER_ACTION = 6;"
]
},
{
"added": [],
"header": "@@ -81,8 +82,6 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
"\tprivate String actionBackupLocation;",
"\tprivate BaseContainerHandle actionContainerHandle;"
]
},
{
"added": [
" /**",
" * Copy the contents of a {@code StorageFile} to a {@code java.io.File}.",
" *",
" * @param from the file to copy from",
" * @param to the file to copy to",
" * @throws StandardException if the copying failed",
" */",
" private void copyFile(final StorageFile from, final File to)",
" throws StandardException {",
" Boolean success = (Boolean) AccessController.doPrivileged(",
" new PrivilegedAction() {",
" public Object run() {",
" return ReuseFactory.getBoolean(FileUtil.copyFile(",
" dataFactory.getStorageFactory(), from, to));",
" }",
" });",
"",
" if (!success.booleanValue()) {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_ERROR_COPYING_FILE,",
" from, to);",
" }",
" }",
"",
" /**",
" * Remove a file.",
" * @param file the file to remove",
" * @throws StandardException if the file could not be removed",
" */",
" private void removeFile(final File file) throws StandardException {",
" Boolean success = (Boolean) AccessController.doPrivileged(",
" new PrivilegedAction() {",
" public Object run() {",
" return ReuseFactory.getBoolean(",
" !file.exists() || file.delete());",
" }",
" });",
"",
" if (!success.booleanValue()) {",
" throw StandardException.newException(",
" SQLState.UNABLE_TO_DELETE_FILE, file);",
" }",
" }",
""
],
"header": "@@ -815,6 +814,50 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": []
},
{
"added": [],
"header": "@@ -965,36 +1008,6 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
"",
"",
"",
"\t\t",
" /**",
" * Backup the container.",
" * ",
" * @param handle the container handle.",
" * @param backupLocation location of the backup container. ",
" * @exception StandardException Standard Derby error policy ",
" */",
"\tprotected void backupContainer(BaseContainerHandle handle,\tString backupLocation)",
"\t throws StandardException ",
"\t{",
"\t\tactionContainerHandle = handle;",
" actionBackupLocation = backupLocation;",
" actionCode = BACKUP_CONTAINER_ACTION;",
" try",
" {",
" AccessController.doPrivileged(this);",
" }",
" catch( PrivilegedActionException pae){ throw (StandardException) pae.getException();}",
" finally",
" {",
" actionContainerHandle = null;",
" actionBackupLocation = null;",
" }",
"\t}",
"",
""
]
},
{
"added": [
" protected void backupContainer(BaseContainerHandle handle,",
" String backupLocation)"
],
"header": "@@ -1032,8 +1045,8 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" private void privBackupContainer(BaseContainerHandle handle,\t",
" String backupLocation)"
]
},
{
"added": [
" StorageFile file = getFileName((ContainerKey)getIdentity(),",
" copyFile(file, backupFile);"
],
"header": "@@ -1067,18 +1080,12 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" StorageFile file = privGetFileName((ContainerKey)getIdentity(), ",
"\t\t\t\t\tif(!FileUtil.copyFile(dataFactory.getStorageFactory(), ",
" file, backupFile))",
" {",
" throw StandardException.newException(",
" SQLState.RAWSTORE_ERROR_COPYING_FILE,",
" file, backupFile);",
" }"
]
},
{
"added": [
" getFileName(",
" backupRaf = getRandomAccessFile(backupFile);"
],
"header": "@@ -1094,12 +1101,11 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" privGetFileName(",
" backupRaf = new RandomAccessFile(backupFile, \"rw\");",
" FileUtil.limitAccessToOwner(backupFile);"
]
},
{
"added": [
" removeFile(backupFile);"
],
"header": "@@ -1194,13 +1200,7 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" if(backupFile.exists()) ",
" {",
" if (!backupFile.delete())",
" throw StandardException.newException(",
" SQLState.UNABLE_TO_DELETE_FILE, ",
" backupFile);",
" }"
]
},
{
"added": [
" newRaf = getRandomAccessFile(newFile);"
],
"header": "@@ -1239,7 +1239,7 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" newRaf = privGetRandomAccessFile(newFile);"
]
},
{
"added": [
" /**",
" * Get a RandomAccessFile for accessing a file in read-write mode.",
" * @param file the file to access",
" * @return a RandomAccessFile",
" * @throws FileNotFoundException if {@code file} cannot be opened in",
" * read-write mode",
" */",
" private RandomAccessFile getRandomAccessFile(final File file)",
" throws FileNotFoundException {",
" try {",
" return (RandomAccessFile) AccessController.doPrivileged(",
" new PrivilegedExceptionAction() {",
" public Object run() throws FileNotFoundException {",
" boolean preExisting = file.exists();",
" RandomAccessFile raf = new RandomAccessFile(file, \"rw\");",
" if (!preExisting) {",
" FileUtil.limitAccessToOwner(file);",
" }",
" return raf;",
" }",
" });",
" } catch (PrivilegedActionException pae) {",
" throw (FileNotFoundException) pae.getCause();",
" }",
" }",
" synchronized StorageRandomAccessFile getRandomAccessFile(StorageFile file)"
],
"header": "@@ -1305,8 +1305,33 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
" synchronized StorageRandomAccessFile privGetRandomAccessFile(StorageFile file)"
]
},
{
"added": [],
"header": "@@ -1664,11 +1689,6 @@ class RAFContainer extends FileContainer implements PrivilegedExceptionAction",
"removed": [
"\t\t ",
"\t\t case BACKUP_CONTAINER_ACTION: {",
"\t\t\t privBackupContainer(actionContainerHandle, actionBackupLocation);",
"\t\t\t return null;",
"\t\t } // end of case BACKUP_CONTAINER_ACTION"
]
}
]
}
] |
derby-DERBY-5896-7f6e8aad
|
DERBY-5896: Change java/drda source code to use spaces instead of tabs and clean up tab creep in java/client
Align with tab stops in java/client.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1372841 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/ClientXAConnection40.java",
"hunks": [
{
"added": [
" * @param listener the component which implements the"
],
"header": "@@ -63,7 +63,7 @@ public class ClientXAConnection40 extends ClientXAConnection {",
"removed": [
" * @param listener the component which implements the"
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Connection.java",
"hunks": [
{
"added": [
" * Return true if the physical connection is still open.",
" * Might be logically closed but available for reuse."
],
"header": "@@ -900,8 +900,8 @@ public abstract class Connection",
"removed": [
" * Return true if the physical connection is still open.",
" * Might be logically closed but available for reuse."
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/EncryptionManager.java",
"hunks": [
{
"added": [
" @param data byte array",
" @param offset starting byte (zero based) to convert.",
" @param length number of bytes to convert."
],
"header": "@@ -639,9 +639,9 @@ public class EncryptionManager {",
"removed": [
" @param data byte array",
" @param offset starting byte (zero based) to convert.",
" @param length number of bytes to convert."
]
}
]
},
{
"file": "java/client/org/apache/derby/client/am/Types.java",
"hunks": [
{
"added": [
" //public final static int TINYINT = java.sql.Types.TINYINT; // -6;"
],
"header": "@@ -32,7 +32,7 @@ public class Types {",
"removed": [
" //public final static int TINYINT = java.sql.Types.TINYINT; // -6;"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/ClientXADataSource40.java",
"hunks": [
{
"added": [
" * interface is typically registered with a JNDI service provider."
],
"header": "@@ -33,7 +33,7 @@ import org.apache.derby.shared.common.reference.SQLState;",
"removed": [
" * interface is typically registered with a JNDI service provider. "
]
}
]
}
] |
derby-DERBY-5897-82949123
|
DERBY-5897: Broken handling of paths with special characters in compatibility/VersionCombinationConfigurator
Fixes URL to File conversion by going via URI and using the new File(URI) ctor.
As an example, URLs containing '%20' for spaces will now result in valid files.
Patch file: derby-5897-1a-url_handling.diff (with formatting modifications)
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1372345 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/DerbyDistribution.java",
"hunks": [
{
"added": [
" BaseTestCase.println(\"missing jar: \" + REQUIRED_JARS[i]);"
],
"header": "@@ -201,6 +201,7 @@ public class DerbyDistribution",
"removed": []
}
]
}
] |
derby-DERBY-5898-989d36ed
|
DERBY-5898; add ibm18 class to functionTests.harness
adding an ibm18 class svn-copied from ibm17, then only replaced the 7s with 8s.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1371382 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/functionTests/harness/ibm18.java",
"hunks": [
{
"added": [
"/*",
"",
" Derby - Class org.apache.derbyTesting.functionTests.harness.ibm18",
"",
" Licensed to the Apache Software Foundation (ASF) under one or more",
" contributor license agreements. See the NOTICE file distributed with",
" this work for additional information regarding copyright ownership.",
" The ASF licenses this file to You under the Apache License, Version 2.0",
" (the \"License\"); you may not use this file except in compliance with",
" the License. You may obtain a copy of the License at",
"",
" http://www.apache.org/licenses/LICENSE-2.0",
"",
" Unless required by applicable law or agreed to in writing, software",
" distributed under the License is distributed on an \"AS IS\" BASIS,",
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" See the License for the specific language governing permissions and",
" limitations under the License.",
"",
" */",
"",
"package org.apache.derbyTesting.functionTests.harness;",
"",
"import java.util.Vector;",
"import java.util.StringTokenizer;",
"",
"/**",
" <p>This class is for IBM's jdk 1.8.",
"",
" */",
"public class ibm18 extends jvm {",
"",
"\tpublic String getName(){return \"ibm18\";}",
" public ibm18(boolean noasyncgc, boolean verbosegc, boolean noclassgc,",
" long ss, long oss, long ms, long mx, String classpath, String prof,",
" boolean verify, boolean noverify, boolean nojit, Vector D) {",
" super(noasyncgc,verbosegc,noclassgc,ss,oss,ms,mx,classpath,prof,",
"\t\tverify,noverify,nojit,D);",
" }",
" // more typical use:",
" public ibm18(String classpath, Vector D) {",
" super(classpath,D);",
" }",
" // more typical use:",
" public ibm18(long ms, long mx, String classpath, Vector D) {",
" super(ms,mx,classpath,D);",
" }",
" // actual use",
" public ibm18() { }",
"",
" // return the command line to invoke this VM. The caller then adds",
" // the class and program arguments.",
" public Vector getCommandLine()",
" {",
" StringBuffer sb = new StringBuffer();",
" Vector v = super.getCommandLine();",
" appendOtherFlags(sb);",
" String s = sb.toString();",
" StringTokenizer st = new StringTokenizer(s);",
" while (st.hasMoreTokens())",
" {",
" v.addElement(st.nextToken());",
" }",
" return v;",
"\t}",
"",
"\tpublic void appendOtherFlags(StringBuffer sb)",
"\t{",
" if (noasyncgc) warn(\"ibm18 does not support noasyncgc\");",
" if (verbosegc) sb.append(\" -verbose:gc\");",
" if (noclassgc) sb.append(\" -Xnoclassgc\");",
" if (ss>=0) warn(\"ibm18 does not support ss\");",
" if (oss>=0) warn(\"ibm18 does not support oss\");",
" if (ms>=0) {",
" sb.append(\" -ms\");",
" sb.append(ms);",
" }",
" if (mx>=0) {",
" sb.append(\" -mx\");",
" sb.append(mx);",
" }",
" if (classpath!=null) {",
" sb.append(\" -classpath \");",
" sb.append(classpath);",
" }",
" if (prof!=null) warn(\"ibm18 does not support prof\");",
" if (verify) warn(\"ibm18 does not support verify\");",
" if (noverify) warn(\"ibm18 does not support noverify\");",
" if (nojit) sb.append(\" -Djava.compiler=NONE\");",
" if (D != null)",
" for (int i=0; i<D.size();i++) {",
"\t sb.append(\" -D\");",
"\t sb.append((String)(D.elementAt(i)));",
" }",
" }",
"\tpublic String getDintro() { return \"-D\"; }",
"}",
""
],
"header": "@@ -0,0 +1,98 @@",
"removed": []
}
]
}
] |
derby-DERBY-5908-69cf7498
|
DERBY-5908: Fix incorrect URLs for network shares. Patch contributed by Kristian Waagan
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1537862 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/drda/NetworkServerControl.java",
"hunks": [
{
"added": [
"import java.security.CodeSource;",
"import java.security.ProtectionDomain;"
],
"header": "@@ -26,7 +26,9 @@ import java.net.Inet6Address;",
"removed": []
},
{
"added": [
" if (securityManager.equals(System.getSecurityManager())) {",
" String successMessage = server.localizeMessage(",
" \"DRDA_SecurityInstalled.I\", null);",
" server.consoleMessage(successMessage, true);",
" }"
],
"header": "@@ -690,12 +692,12 @@ public class NetworkServerControl{",
"removed": [
" //",
" //",
" String successMessage = server.localizeMessage( \"DRDA_SecurityInstalled.I\", null );",
" ",
" server.consoleMessage( successMessage, true );"
]
},
{
"added": [
" // Note: This method is expected to run only when no security manager",
" // has been installed, hence no use of privileged blocks.",
" ProtectionDomain pd = NetworkServerControl.class.getProtectionDomain();",
" CodeSource cs = pd.getCodeSource();",
" if (cs == null) {",
" return null;",
" }",
" URL url = cs.getLocation();",
" if (url == null) {",
" return null;",
" }",
" // Replace in \"file://some\", but not in \"file:///some\".",
" String extForm = url.toExternalForm().replaceFirst(",
" \"^file://([^/].*)\", \"file:////$1\");",
" int idx = extForm.indexOf(DERBYNET_JAR);"
],
"header": "@@ -782,8 +784,21 @@ public class NetworkServerControl{",
"removed": [
" String derbyNetURL = NetworkServerControl.class.getProtectionDomain().getCodeSource().getLocation().toExternalForm();",
" int idx = derbyNetURL.indexOf( DERBYNET_JAR );"
]
},
{
"added": [
" String directoryPrefix = extForm.substring(0, idx);"
],
"header": "@@ -800,7 +815,7 @@ public class NetworkServerControl{",
"removed": [
" String directoryPrefix = derbyNetURL.substring( 0, idx );"
]
}
]
}
] |
derby-DERBY-5911-d35198db
|
DERBY-5911 WHERE condition getting pushed into sub-query with FETCH
Patch "derby5911b", which changes logic in ProjectRestrictNode#pushExpressions to avoid pushing WHERE conditions into SELECTs that uses windowing and/or FETCH FIRST/OFFSET clauses. This fixes the bug in this issue.
Adds new test cases in OrderByAndOffsetFetchInSubqueries.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1384035 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5912-ad188f44
|
DERBY-5912; testIsValidImplemented fails for NetworkServer in some slow running machines/configurations
This commits the following changes:
- changes the timeout in ConnectionMethodsTest from isValid(1) to isValid(200) and adds a comment
- updates the comment in ConnectionTest so it refers to ConnectionMethodsTest
- has commented out sleep code in DRDAConnThread that can be uncommented to test this
- adds a fixture, testIsValidWithTimeout, that is disabled by having an 'x' in front of it, to ConnectionTest.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1381731 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5913-c8563f47
|
DERBY-5913: Remove unused classes [GS]et*Action in client.am
Removed unused classes.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1379390 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/SetAccessibleAction.java",
"hunks": [
{
"added": [],
"header": "@@ -1,49 +0,0 @@",
"removed": [
"/*",
"",
" Derby - Class org.apache.derby.client.am.SetAccessibleAction",
"",
" Licensed to the Apache Software Foundation (ASF) under one or more",
" contributor license agreements. See the NOTICE file distributed with",
" this work for additional information regarding copyright ownership.",
" The ASF licenses this file to You under the Apache License, Version 2.0",
" (the \"License\"); you may not use this file except in compliance with",
" the License. You may obtain a copy of the License at",
"",
" http://www.apache.org/licenses/LICENSE-2.0",
"",
" Unless required by applicable law or agreed to in writing, software",
" distributed under the License is distributed on an \"AS IS\" BASIS,",
" WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.",
" See the License for the specific language governing permissions and",
" limitations under the License.",
"",
"*/",
"",
"package org.apache.derby.client.am;",
"",
"// Java 2 PrivilegedExceptionAction encapsulation of the action to set accessible flag of an object",
"",
"public class SetAccessibleAction implements java.security.PrivilegedExceptionAction {",
" private boolean accessible_ = false;",
"",
" // provides information about, and dynamic access to, a single field of a class or an interface",
" private java.lang.reflect.Field field_ = null;",
"",
" public SetAccessibleAction(java.lang.reflect.Field field, boolean accessible) {",
" field_ = field;",
" accessible_ = accessible;",
" }",
"",
" public Object run() {",
" field_.setAccessible(accessible_);",
" return null;",
" }",
"",
" public void setAccessible(boolean accessible) {",
" accessible_ = accessible;",
" }",
"",
" public void setField(java.lang.reflect.Field field) {",
" field_ = field;",
" }",
"}"
]
}
]
}
] |
derby-DERBY-5916-9f844273
|
DERBY-5916 (java.lang.NullPointerException org.apache.derby.impl.store.raw.data.BaseDataFileFactory.stop() connecting to network server)
Check for the nullability of storageFactory before using it in shutdown code
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1394883 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java",
"hunks": [
{
"added": [
"\t\t\tif (storageFactory != null)",
"\t\t\t\tstorageFactory.shutdown();"
],
"header": "@@ -526,7 +526,8 @@ public class BaseDataFileFactory",
"removed": [
" storageFactory.shutdown();"
]
},
{
"added": [
" if( storageFactory != null) ",
" actionCode = REMOVE_STUBS_ACTION;",
" try",
" {",
" AccessController.doPrivileged( this);",
" }",
" catch (PrivilegedActionException pae)",
" {",
" // removeStubs does not throw an exception",
" } "
],
"header": "@@ -1583,15 +1584,18 @@ public class BaseDataFileFactory",
"removed": [
" actionCode = REMOVE_STUBS_ACTION;",
" try",
" AccessController.doPrivileged( this);",
" catch (PrivilegedActionException pae)",
" {",
" // removeStubs does not throw an exception",
" } "
]
}
]
}
] |
derby-DERBY-5917-8f0d45d8
|
DERBY-5917: NoClassDefFoundErrors when running tests without derbynet.jar and derbyclient.jar
Stop using client classes in XATransactionTest and CacheSessionDataTest
when running with the embedded driver.
Skip compatibility tests when client or server is not available.
Skip test case for server command in derbyrunjartest if the server
is not available.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1382791 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/XATestUtil.java",
"hunks": [
{
"added": [
"import java.util.Arrays;"
],
"header": "@@ -26,6 +26,7 @@ import java.sql.Connection;",
"removed": []
},
{
"added": [
" public static Xid getXid(int formatId, int b1, int b2) {",
" byte[] globalId = new byte[Xid.MAXGTRIDSIZE];",
" byte[] branchId = new byte[Xid.MAXBQUALSIZE];",
"",
" for (int i = 0; i < globalId.length; i++) {",
" globalId[i] = (byte) (b1 + i);",
" }",
"",
" for (int i = 0; i < branchId.length; i++) {",
" branchId[i] = (byte) (b2 + i);",
" }",
"",
" return getXid(formatId, globalId, branchId);",
" }",
"",
" public static Xid getXid(int formatId, byte[] globalId, byte[] branchId) {",
" return new utilXid(formatId, globalId, branchId);"
],
"header": "@@ -35,8 +36,23 @@ public class XATestUtil {",
"removed": [
" public static Xid getXid(int xid, int b1, int b2) {",
" return new utilXid(xid, b1, b2);"
]
},
{
"added": [
" utilXid(int format_id, byte[] global_id, byte[] branch_id) {",
" this.format_id = format_id;",
" this.global_id = global_id;",
" this.branch_id = branch_id;"
],
"header": "@@ -133,18 +149,10 @@ class utilXid implements Xid, Serializable {",
"removed": [
" utilXid(int xid, int b1, int b2) {",
" format_id = xid;",
" global_id = new byte[Xid.MAXGTRIDSIZE];",
" branch_id = new byte[Xid.MAXBQUALSIZE];",
"",
" for (int i = 0; i < global_id.length; i++) {",
" global_id[i] = (byte) (b1 + i);",
" }",
"",
" for (int i = 0; i < branch_id.length; i++) {",
" branch_id[i] = (byte) (b2 + i);",
" }"
]
},
{
"added": [
"",
" public boolean equals(Object obj) {",
" boolean ret = false;",
"",
" if (obj instanceof utilXid) {",
" utilXid that = (utilXid) obj;",
" ret = this.format_id == that.format_id &&",
" Arrays.equals(this.global_id, that.global_id) &&",
" Arrays.equals(this.branch_id, that.branch_id);",
" }",
"",
" return ret;",
" }",
"",
" public int hashCode() {",
" int hash = 7;",
" hash = 41 * hash + this.format_id;",
" hash = 41 * hash + Arrays.hashCode(this.global_id);",
" hash = 41 * hash + Arrays.hashCode(this.branch_id);",
" return hash;",
" }"
],
"header": "@@ -177,4 +185,25 @@ class utilXid implements Xid, Serializable {",
"removed": []
}
]
}
] |
derby-DERBY-5917-fd0edf9d
|
DERBY-5917: NoClassDefFoundErrors when running tests without derbynet.jar and derbyclient.jar
Avoid attempts to load client classes when the client driver is not there.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1382032 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/TestConfiguration.java",
"hunks": [
{
"added": [
" {",
" return clientServerDecorator(bareClientServerSuite(testClass));"
],
"header": "@@ -495,10 +495,8 @@ public final class TestConfiguration {",
"removed": [
" { ",
" TestSuite suite = new TestSuite(testClass,",
" suiteName(testClass)+\":client\");",
" return clientServerDecorator(suite);"
]
},
{
"added": [
" return clientServerDecoratorWithAlternativePort(",
" bareClientServerSuite(testClass));"
],
"header": "@@ -508,9 +506,8 @@ public final class TestConfiguration {",
"removed": [
" TestSuite suite = new TestSuite(testClass, suiteName(testClass)",
" + \":client\");",
" return clientServerDecoratorWithAlternativePort(suite);"
]
},
{
"added": [
" // Will not start server and does not stop it when done.",
" return defaultExistingServerDecorator(bareClientServerSuite(testClass));"
],
"header": "@@ -520,9 +517,8 @@ public final class TestConfiguration {",
"removed": [
" TestSuite suite = new TestSuite(testClass,",
" suiteName(testClass)+\":client\");",
" return defaultExistingServerDecorator(suite); // Will not start server and does not stop it when done!."
]
},
{
"added": [
" return existingServerDecorator(bareClientServerSuite(testClass),",
" hostName, portNumber);",
" return existingServerDecorator(bareClientServerSuite(testClass),",
" hostName, portNumber, dbPath);"
],
"header": "@@ -536,18 +532,16 @@ public final class TestConfiguration {",
"removed": [
" TestSuite suite = new TestSuite(testClass,",
" suiteName(testClass)+\":client\");",
" return existingServerDecorator(suite, hostName, portNumber); ",
" TestSuite suite = new TestSuite(testClass,",
" suiteName(testClass)+\":client\");",
" return existingServerDecorator(suite, hostName, portNumber, dbPath); "
]
},
{
"added": [
" if (!supportsClientServer()) {",
" }"
],
"header": "@@ -626,9 +620,9 @@ public final class TestConfiguration {",
"removed": [
" if (!(Derby.hasClient() && Derby.hasServer())",
" || JDBC.vmSupportsJSR169())"
]
},
{
"added": [
" if (!supportsClientServer()) {",
" }"
],
"header": "@@ -646,9 +640,9 @@ public final class TestConfiguration {",
"removed": [
" if (!(Derby.hasClient() && Derby.hasServer())",
" || JDBC.vmSupportsJSR169())"
]
},
{
"added": [
" if (!supportsClientServer()) {",
" }"
],
"header": "@@ -664,9 +658,9 @@ public final class TestConfiguration {",
"removed": [
" if (!(Derby.hasClient() && Derby.hasServer())",
" || JDBC.vmSupportsJSR169())"
]
},
{
"added": [
" if (!supportsClientServer()) {",
" }",
""
],
"header": "@@ -681,9 +675,10 @@ public final class TestConfiguration {",
"removed": [
" if (!(Derby.hasClient() && Derby.hasServer())",
" || JDBC.vmSupportsJSR169())"
]
},
{
"added": [
" /**",
" * Check if client and server testing is supported in the test environment.",
" */",
" private static boolean supportsClientServer() {",
" return JDBC.vmSupportsJDBC3() && Derby.hasClient() && Derby.hasServer();",
" }",
"",
" /**",
" * Create a suite of test cases to run in a client/server environment. The",
" * returned test suite is not decorated with a ServerSetup.",
" *",
" * @param testClass the class from which to extract the test cases",
" * @return a test suite with all the test cases in {@code testClass}, or",
" * an empty test suite if client/server is not supported in the test",
" * environment",
" */",
" private static Test bareClientServerSuite(Class testClass) {",
" TestSuite suite = new TestSuite(suiteName(testClass) + \":client\");",
" if (supportsClientServer()) {",
" suite.addTestSuite(testClass);",
" }",
" return suite;",
" }",
""
],
"header": "@@ -694,6 +689,30 @@ public final class TestConfiguration {",
"removed": []
}
]
}
] |
derby-DERBY-592-b7e5031d
|
DERBY-475 DERBY-592 Expand the builtin function table to handle zero parameter
functions and add the functions PI and LOG10 as builting and JDBC escaped functions.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@374471 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/catalog/SystemProcedures.java",
"hunks": [
{
"added": [
"\t",
"\t<P>",
"\tAlso used for builtin-routines, such as SYSFUN functions, when direct calls",
"\tinto Java libraries cannot be made."
],
"header": "@@ -54,6 +54,10 @@ import org.apache.derby.iapi.sql.conn.ConnectionUtil;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/catalog/DataDictionaryImpl.java",
"hunks": [
{
"added": [
"\t* in the SYSFUN schema. These functions are resolved to directly",
"\t* if no schema name is given, e.g.",
"\t* ",
"\t* <code>",
"\t* SELECT COS(angle) FROM ROOM_WALLS",
"\t* </code>",
"\t* ",
"\t* Adding a function here is suitable when the function defintion",
"\t* can have a single return type and fixed parameter types.",
"\t* ",
"\t* Functions that need to have a return type based upon the",
"\t* input type(s) are not supported here. Typically those are",
"\t* added into the parser and methods added into the DataValueDescriptor interface.",
"\t* Examples are character based functions whose return type",
"\t* length is based upon the passed in type, e.g. passed a CHAR(10)",
"\t* returns a CHAR(10).",
"\t* ",
"\t* ",
"\t* This simple table assumes zero or a single parameter",
"\t*[4] = parameter type (single parameter) or null for no parameters."
],
"header": "@@ -190,14 +190,32 @@ public final class\tDataDictionaryImpl",
"removed": [
"\t* in the SYSFUN schema. This simple table assumes a single parameter",
"\t*[4] = parameter type (single parameter)"
]
},
{
"added": [
"\t\t\t{\"PI\", \"DOUBLE\", \"org.apache.derby.catalog.SystemProcedures\", \"PI()\", null},",
"\t\t\t{\"LOG10\", \"DOUBLE\", \"org.apache.derby.catalog.SystemProcedures\", \"LOG10(double)\", \"DOUBLE\"},"
],
"header": "@@ -207,10 +225,12 @@ public final class\tDataDictionaryImpl",
"removed": []
}
]
}
] |
derby-DERBY-5927-aea21f6f
|
DERBY-5927: Add utility methods to query state of URL attributes in EmbedConnection
Added static utility methods for improved readability.
Patch file: derby-5927-1b-isset_istrue.diff
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1386480 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"hunks": [
{
"added": [
" boolean shutdown = isTrue(info, Attribute.SHUTDOWN_ATTR);"
],
"header": "@@ -246,7 +246,7 @@ public class EmbedConnection implements EngineConnection",
"removed": [
"\t\t\tboolean shutdown = Boolean.valueOf(info.getProperty(Attribute.SHUTDOWN_ATTR)).booleanValue();"
]
},
{
"added": [
" if (isTrue(p, Attribute.CREATE_ATTR)) {",
" }",
" if (isSet(p, Attribute.CREATE_FROM)) {",
" }",
" if (isSet(p, Attribute.RESTORE_FROM)) {",
" }",
" if (isSet(p, Attribute.ROLL_FORWARD_RECOVERY_FROM)) {",
" }",
" if (restoreCount > 1) {",
" }"
],
"header": "@@ -686,19 +686,24 @@ public class EmbedConnection implements EngineConnection",
"removed": [
"\t\tif (Boolean.valueOf(p.getProperty(Attribute.CREATE_ATTR)).booleanValue())",
"\t\tif (p.getProperty(Attribute.CREATE_FROM) != null)",
"\t\tif (p.getProperty(Attribute.RESTORE_FROM) != null)",
"\t\tif (p.getProperty(Attribute.ROLL_FORWARD_RECOVERY_FROM)!=null)",
"\t\tif(restoreCount > 1)"
]
},
{
"added": [
" return isTrue(p, Attribute.DROP_ATTR);"
],
"header": "@@ -747,8 +752,7 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" return (Boolean.valueOf(",
" p.getProperty(Attribute.DROP_ATTR)).booleanValue());"
]
},
{
"added": [
" return (isTrue(p, Attribute.DATA_ENCRYPTION) ||",
" isSet(p, Attribute.NEW_BOOT_PASSWORD) ||",
" isSet(p, Attribute.NEW_CRYPTO_EXTERNAL_KEY));"
],
"header": "@@ -760,10 +764,9 @@ public class EmbedConnection implements EngineConnection",
"removed": [
"\t\treturn ((Boolean.valueOf(",
"\t\t\t\t\t p.getProperty(Attribute.DATA_ENCRYPTION)).booleanValue()) ||",
"\t\t\t\t(p.getProperty(Attribute.NEW_BOOT_PASSWORD) != null) ||",
"\t\t\t\t(p.getProperty(Attribute.NEW_CRYPTO_EXTERNAL_KEY) != null));"
]
},
{
"added": [
" private boolean isHardUpgradeBoot(Properties p) {",
" return isTrue(p, Attribute.UPGRADE_ATTR);",
" return isTrue(p, Attribute.REPLICATION_START_SLAVE);",
" return isTrue(p, Attribute.REPLICATION_START_MASTER);"
],
"header": "@@ -773,22 +776,16 @@ public class EmbedConnection implements EngineConnection",
"removed": [
"\tprivate boolean isHardUpgradeBoot(Properties p)",
"\t{",
"\t\treturn Boolean.valueOf(",
"\t\t\tp.getProperty(Attribute.UPGRADE_ATTR)).booleanValue();",
" return ((Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_START_SLAVE)).",
" booleanValue()));",
" return ((Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_START_MASTER)).",
" booleanValue()));"
]
},
{
"added": [
" return isTrue(p, Attribute.REPLICATION_FAILOVER);",
" return isTrue(p, Attribute.REPLICATION_STOP_MASTER);"
],
"header": "@@ -799,15 +796,11 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" return ((Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_FAILOVER)).",
" booleanValue()));",
" return ((Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_STOP_MASTER)).",
" booleanValue()));"
]
},
{
"added": [
" return isTrue(p, Attribute.REPLICATION_STOP_SLAVE);"
],
"header": "@@ -819,9 +812,7 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" return Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_STOP_SLAVE)).",
" booleanValue();"
]
},
{
"added": [
" return isTrue(p, Attribute.REPLICATION_INTERNAL_SHUTDOWN_SLAVE);",
" }",
"",
" /** Tells if the attribute/property has been set. */",
" private static boolean isSet(Properties p, String attribute) {",
" return p.getProperty(attribute) != null;",
" }",
"",
" /** Tells if the attribute/property has the value {@code true}. */",
" private static boolean isTrue(Properties p, String attribute) {",
" return Boolean.valueOf(p.getProperty(attribute)).booleanValue();"
],
"header": "@@ -837,9 +828,17 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" return Boolean.valueOf(",
" p.getProperty(Attribute.REPLICATION_INTERNAL_SHUTDOWN_SLAVE)).",
" booleanValue();"
]
}
]
}
] |
derby-DERBY-5933-d7f41dde
|
DERBY-5933 SQL sorting error
Patch "d5933-remap+test", which fixes a problem in column reference
remapping in connection with flattening of a left outer join with a
base table. See the Javadoc for the new test case
JoinTest#testDerby_5933 for details.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1390205 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5935-6790718a
|
DERBY-5935: Remove unused code for factory classes in the reflection service
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1390342 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/services/reflect/DatabaseClasses.java",
"hunks": [
{
"added": [
"import java.io.ObjectStreamClass;",
"import java.util.Properties;",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.io.FileUtil;",
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"import org.apache.derby.iapi.services.loader.ClassInspector;",
"import org.apache.derby.iapi.services.loader.GeneratedClass;",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;",
"import org.apache.derby.iapi.util.ByteArray;"
],
"header": "@@ -21,45 +21,28 @@",
"removed": [
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"",
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"import org.apache.derby.iapi.services.loader.GeneratedClass;",
"import org.apache.derby.iapi.services.loader.ClassInspector;",
"",
"import org.apache.derby.iapi.services.monitor.ModuleControl;",
"import org.apache.derby.iapi.services.monitor.ModuleSupportable;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"",
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.services.property.PropertyUtil;",
"",
"import org.apache.derby.iapi.services.stream.HeaderPrintWriter;",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"",
"import org.apache.derby.iapi.services.compiler.*;",
"import java.lang.reflect.Modifier;",
"import org.apache.derby.iapi.sql.compile.CodeGeneration;",
"",
"import org.apache.derby.iapi.util.ByteArray;",
"import org.apache.derby.iapi.services.io.FileUtil;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.reference.Property;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.reference.ClassName;",
"",
"import java.util.Properties;",
"import java.util.Hashtable;",
"",
"import java.io.ObjectStreamClass;",
"import java.io.Serializable;"
]
},
{
"added": [],
"header": "@@ -88,7 +71,6 @@ abstract class DatabaseClasses",
"removed": [
"\tprivate JavaFactory\t\tjavaFactory;"
]
},
{
"added": [],
"header": "@@ -125,8 +107,6 @@ abstract class DatabaseClasses",
"removed": [
"",
"\t\tjavaFactory = (JavaFactory) org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(org.apache.derby.iapi.reference.Module.JavaFactory);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/reflect/ReflectGeneratedClass.java",
"hunks": [
{
"added": [],
"header": "@@ -28,8 +28,6 @@ import org.apache.derby.iapi.services.loader.ClassFactory;",
"removed": [
"import org.apache.derby.iapi.services.context.Context;",
""
]
},
{
"added": [],
"header": "@@ -38,10 +36,6 @@ public final class ReflectGeneratedClass extends LoadedGeneratedClass {",
"removed": [
"",
"\tprivate final Class\tfactoryClass;",
"\tprivate GCInstanceFactory factory;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/reflect/ReflectLoaderJava2.java",
"hunks": [
{
"added": [
" return new ReflectGeneratedClass(cf, jvmClass);"
],
"header": "@@ -62,23 +62,6 @@ final class ReflectLoaderJava2 extends ClassLoader {",
"removed": [
"\t\t/*",
"\t\t\tDJD - not enabling this yet, need more memory testing, may only",
"\t\t\tcreate a factory instance when a number of instances are created.",
"\t\t\tThis would avoid a factory instance for DDL",
"",
"\t\t// now generate a factory class that loads instances",
"\t\tint lastDot = name.lastIndexOf('.');",
"\t\tString factoryName = name.substring(lastDot + 1, name.length()).concat(\"_F\");",
"",
"\t\tclassData = cf.buildSpecificFactory(name, factoryName);",
"\t\tClass factoryClass = defineClass(CodeGeneration.GENERATED_PACKAGE_PREFIX.concat(factoryName),",
"\t\t\tclassData.getArray(), classData.getOffset(), classData.getLength());",
"\t\tresolveClass(factoryClass);",
"\t\t",
"\t\t */",
"\t\tClass factoryClass = null;",
"",
"\t\treturn new ReflectGeneratedClass(cf, jvmClass, factoryClass);"
]
}
]
}
] |
derby-DERBY-5937-f978b1f8
|
DERBY-5937: File handle is leaked when a Slave replication is shutdown with failover=true
Use DataSource in the test to prevent internal deadlock in DriverManager
when running the test on Java 5. This also allows the test to run on
JSR-169 platforms.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1395482 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5940-7379752e
|
DERBY-5940: Disable securityMechanism=8 in NSSecurityMechanismTest on ARM platforms
Disabled strong password substitution tests on ARM platforms. The check is
simply based on the value of "os.arch", which must be "ARM" for the tests
to be disabled.
Patch file: derby-5940-1a-disable_secMec8_on_ARM.diff
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1392819 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5944-ac112f79
|
DERBY-5944: The hard-coded PlanExporter help message should be internationalized
This patch was contributed by Yun Fang ( fangyuncn at gmail dot com )
This change replaces the literal string text in PlanExporter.java with
references to Derby messages.
The change also contributes both the English message text and the corresponding
Chinese message text.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1727230 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/tools/org/apache/derby/tools/PlanExporter.java",
"hunks": [
{
"added": [
"",
"import org.apache.derby.iapi.tools.i18n.LocalizedResource;"
],
"header": "@@ -29,6 +29,8 @@ import java.io.Writer;",
"removed": []
},
{
"added": [
" ",
" private static final LocalizedResource LOC_RES = LocalizedResource.getInstance();"
],
"header": "@@ -43,6 +45,8 @@ public class PlanExporter {",
"removed": []
},
{
"added": [
" \t\tSystem.out.println(LOC_RES.getTextMessage(\"PE_NoStatisticsCaptured\"));",
" \tSystem.out.println(LOC_RES.getTextMessage(\"PE_ErrorSchemaNotExist\"));"
],
"header": "@@ -179,25 +183,11 @@ public class PlanExporter {",
"removed": [
" \t\tSystem.out.println(",
" \t\t\t\t\"====================================================\\n\" +",
" \t\t\t\t\"--- An Error Occured: No Statistics has Captured ---\\n\" +",
" \t\t\t\t\"-- Possible reasons: --\\n\" +",
" \t\t\t\t\"-- 1) The statement executed is a DDL statement. --\\n\" +",
" \t\t\t\t\"-- Statistics will not capture for DDL statements --\\n\" +",
" \t\t\t\t\"-- by the Derby. --\\n\" +",
" \t\t\t\t\"-- 2) The statement ID entered is incorrect. --\\n\" +",
" \t\t\t\t\"-- 3) Schema specified does not exist. --\\n\" +",
" \t\t\t\t\"====================================================\\n\"",
" \t\t);",
" \tSystem.out.println(",
" \t\t\t\t\"====================================================\\n\" +",
" \t\t\t\t\"--- An Error Occured: ---\\n\" +",
" \t\t\t\t\"------- Specified Schema does not exist. -------\\n\" +",
" \t\t\t\t\"======================================================\");"
]
},
{
"added": [
" System.out.println(LOC_RES.getTextMessage(\"PE_HelpText\"));"
],
"header": "@@ -283,28 +273,7 @@ public class PlanExporter {",
"removed": [
" System.out.println",
" (",
" \"================================================\\n\" +",
" \"-------------- PlanExporter Tool ---------------\\n\" +",
" \"-- You can pass 5 arguments (minimum), or --\\n\" +",
" \"-- 7 arguments or 8 arguments or --\\n\" +",
" \"----------- 9 arguments (maximum) ------------\\n\" +",
" \"-- separated by a space. --\\n\" +",
" \"---------------Mandatory Arguments--------------\\n\" +",
" \"1) database URL --------------------------------\\n\" +",
" \"2) database schema -----------------------------\\n\" +",
" \"3) statement ID (36 characters) ----------------\\n\" +",
" \"---------------Optional Arguments---------------\\n\" +",
" \"-----------Choose at least one option-----------\\n\" +",
" \"a) -xml {pathToXML} or -html {pathToHTML} ------\\n\" +",
" \"b) -xml {pathToXML} -html {pathToHTML} ---------\\n\" +",
" \"c) -xsl {pathToXSL} -html {pathToHTML} ---------\\n\" +",
" \"d) -xml {pathToXML} -xsl {pathToXSL} -----------\\n\" +",
" \" -html {pathToHTML} -----------------------\\n\" +",
" \"e) -adv -xml {pathToXML} -xsl {pathToXSL} ------\\n\" +",
" \"================================================\\n\"",
" );"
]
}
]
}
] |
derby-DERBY-5947-03937751
|
DERBY-5947: Factor out common code from generated classes
Remove three generated fields and six corresponding accessor methods
with a single field (an instance of a class with three fields) and one
getter method.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1399139 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/compiler/ClassBuilder.java",
"hunks": [
{
"added": [
" * <p>",
" * If the modifiers include static, the returned method builder is for",
" * a class or interface initialization method. Otherwise, the builder is",
" * for an instance initialization method.",
" * <p>"
],
"header": "@@ -166,6 +166,11 @@ public interface ClassBuilder {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java",
"hunks": [
{
"added": [
" /**",
" * Push the contents of the static field onto the stack.",
" * <pre>",
" * Stack ... =>",
" * ...,field_value",
" * </pre>",
" *",
" * @param field a static field",
" */",
" public void getStaticField(LocalField field);",
""
],
"header": "@@ -161,6 +161,17 @@ public interface MethodBuilder {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/bytecode/BCClass.java",
"hunks": [
{
"added": [
"import java.io.IOException;",
"import java.lang.reflect.Modifier;",
"import java.security.AccessController;",
"import org.apache.derby.iapi.services.classfile.ClassFormatOutput;",
"import org.apache.derby.iapi.services.classfile.ClassHolder;",
"import org.apache.derby.iapi.services.classfile.ClassMember;",
"import org.apache.derby.iapi.services.compiler.LocalField;",
"import org.apache.derby.iapi.services.compiler.MethodBuilder;",
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"import org.apache.derby.iapi.util.ByteArray;"
],
"header": "@@ -21,33 +21,20 @@",
"removed": [
"import org.apache.derby.iapi.services.compiler.ClassBuilder;",
"import org.apache.derby.iapi.services.compiler.MethodBuilder;",
"import org.apache.derby.iapi.services.compiler.LocalField;",
"",
"import org.apache.derby.iapi.services.classfile.ClassHolder;",
"import org.apache.derby.iapi.services.classfile.ClassMember;",
"import org.apache.derby.iapi.services.classfile.ClassFormatOutput;",
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"",
"",
"import org.apache.derby.iapi.util.ByteArray;",
"import org.apache.derby.iapi.services.classfile.VMOpcode;",
"",
"import java.lang.reflect.Modifier;",
"import java.security.AccessController;",
"",
"import org.apache.derby.iapi.services.classfile.VMDescriptor;",
"",
"import org.apache.derby.impl.services.bytecode.GClass;",
"",
"import java.io.IOException;"
]
},
{
"added": [
" * <p>",
" * If the modifiers include static, the returned method builder is for",
" * a class or interface initialization method. Otherwise, the builder is",
" * for an instance initialization method.",
" * <p>"
],
"header": "@@ -276,6 +263,11 @@ class BCClass extends GClass {",
"removed": []
},
{
"added": [
" String method = Modifier.isStatic(modifiers) ? \"<clinit>\" : \"<init>\";",
" return new BCMethod(this, \"void\", method, modifiers, null, factory);"
],
"header": "@@ -285,13 +277,8 @@ class BCClass extends GClass {",
"removed": [
"",
"\t\tBCMethod m = new BCMethod(this, \"void\", \"<init>\", ",
"\t\t\t\t\t\t\t\t\tmodifiers,",
"\t\t\t\t\t\t\t\t\t(String []) null,",
"\t\t\t\t\t\t\t\t\tfactory);",
"",
"\t\treturn m;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/bytecode/BCMethod.java",
"hunks": [
{
"added": [
" overflowMethodCheck();"
],
"header": "@@ -675,8 +675,7 @@ class BCMethod implements MethodBuilder {",
"removed": [
"\t\t\tif (stackDepth == 0)",
"\t\t\t\toverflowMethodCheck();"
]
},
{
"added": [
" overflowMethodCheck();"
],
"header": "@@ -736,8 +735,7 @@ class BCMethod implements MethodBuilder {",
"removed": [
"\t\t\tif (stackDepth == 0)",
"\t\t\t\toverflowMethodCheck();"
]
},
{
"added": [
" public void getStaticField(LocalField field) {",
" BCLocalField lf = (BCLocalField) field;",
" myCode.addInstrU2(VMOpcode.GETSTATIC, lf.cpi);",
" growStack(lf.type);",
" }",
""
],
"header": "@@ -887,6 +885,12 @@ class BCMethod implements MethodBuilder {",
"removed": []
},
{
"added": [
" overflowMethodCheck();",
" public void setStaticField(LocalField field) {",
" BCLocalField lf = (BCLocalField) field;",
" myCode.addInstrU2(VMOpcode.PUTSTATIC, lf.cpi);",
" popStack();",
" overflowMethodCheck();",
" }",
""
],
"header": "@@ -918,14 +922,17 @@ class BCMethod implements MethodBuilder {",
"removed": [
"\t\tType lt = lf.type;",
"",
"",
"\t\tif (stackDepth == 0)",
"\t\t\toverflowMethodCheck();"
]
},
{
"added": [],
"header": "@@ -947,8 +954,6 @@ class BCMethod implements MethodBuilder {",
"removed": [
"\t\tType lt = lf.type;",
""
]
},
{
"added": [
" overflowMethodCheck();"
],
"header": "@@ -1072,8 +1077,7 @@ class BCMethod implements MethodBuilder {",
"removed": [
"\t\tif (stackDepth == 0)",
"\t\t\toverflowMethodCheck();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java",
"hunks": [
{
"added": [
" protected MethodBuilder staticInitializer;"
],
"header": "@@ -102,6 +102,7 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface",
"removed": []
},
{
"added": [
" MethodBuilder getStaticInitializer() {",
" if (staticInitializer == null) {",
" staticInitializer = cb.newConstructorBuilder(Modifier.STATIC);",
" }",
" return staticInitializer;",
" }",
""
],
"header": "@@ -198,6 +199,13 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java",
"hunks": [
{
"added": [
"import java.util.List;"
],
"header": "@@ -27,6 +27,7 @@ import java.sql.SQLWarning;",
"removed": []
},
{
"added": [
" /**",
" * This class holds row count statistics for a query.",
" */",
" protected static class RowCountStats {",
" /**",
" * Stale plan check interval tells how often the row counts should be",
" * checked. Cached here so that we don't need to query the database",
" * properties on each execution.",
" */",
" private int stalePlanCheckInterval;",
" /** The number of times this query has been executed. */",
" private int executionCount;",
" /** List with row count estimates for each table in the query. */",
" private final List rowCounts;",
"",
" public RowCountStats() {",
" rowCounts = new ArrayList();",
" }",
" }",
"",
" /**",
" * Get the object holding row count statistics for this activation.",
" *",
" * It may return {@code null} if row count statistics are not maintained",
" * for the activation. In that case, {@link #shouldWeCheckRowCounts()}",
" * must return {@code false}.",
" */",
" protected abstract RowCountStats getRowCountStats();",
""
],
"header": "@@ -870,6 +871,35 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": []
},
{
"added": [
" final RowCountStats stats = getRowCountStats();",
" synchronized (stats)",
" final List rowCountCheckVector = stats.rowCounts;"
],
"header": "@@ -889,15 +919,10 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\t\t\t\tsynchronized (getPreparedStatement())",
"\t\t\t\t\tVector rowCountCheckVector = getRowCountCheckVector();",
"",
"\t\t\t\t\tif (rowCountCheckVector == null) {",
"\t\t\t\t\t\trowCountCheckVector = new Vector();",
"\t\t\t\t\t\tsetRowCountCheckVector(rowCountCheckVector);",
"\t\t\t\t\t}",
""
]
},
{
"added": [
" (Long) rowCountCheckVector.get(resultSetNumber);",
" int newSize = resultSetNumber + 1;",
" while (rowCountCheckVector.size() < newSize) {",
" rowCountCheckVector.add(null);",
" }"
],
"header": "@@ -906,11 +931,14 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\t\t\t\t\t\t\t(Long) rowCountCheckVector.elementAt(resultSetNumber);",
"\t\t\t\t\t\trowCountCheckVector.setSize(resultSetNumber + 1);"
]
},
{
"added": [
" rowCountCheckVector.set(",
" resultSetNumber, new Long(currentRowCount));"
],
"header": "@@ -1001,11 +1029,8 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\t\t\t\t\t\tfirstRowCount = new Long(currentRowCount);",
"\t\t\t\t\t\trowCountCheckVector.setElementAt(",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\tfirstRowCount,",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\tresultSetNumber",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t);"
]
},
{
"added": [
" checkRowCounts = shouldWeCheckRowCounts();"
],
"header": "@@ -1028,7 +1053,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\t\tshouldWeCheckRowCounts();"
]
},
{
"added": [
" /**",
" * Find out if it's time to check the row counts of the tables involved",
" * in this query.",
" * @return true if the row counts should be checked, false otherwise",
" */",
"\tprotected boolean shouldWeCheckRowCounts() throws StandardException",
" final RowCountStats stats = getRowCountStats();",
"",
" int executionCount = ++stats.executionCount;"
],
"header": "@@ -1160,15 +1185,22 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\tprivate void shouldWeCheckRowCounts() throws StandardException",
"\t\tint executionCount = getExecutionCount() + 1;"
]
},
{
"added": [
" return true;",
" return false;",
" int stalePlanCheckInterval = stats.stalePlanCheckInterval;"
],
"header": "@@ -1181,16 +1213,16 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
"\t\t\tcheckRowCounts = true;",
"\t\t\tcheckRowCounts = false;",
"\t\t\tint stalePlanCheckInterval = getStalePlanCheckInterval();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/ConstantActionActivation.java",
"hunks": [
{
"added": [
" /**",
" * Always return false since constant actions don't need recompilation",
" * when the row counts change.",
" */",
" protected boolean shouldWeCheckRowCounts() {",
" return false;",
" }",
"",
" /**",
" * Always return null since constant actions never check row counts.",
" */",
" protected RowCountStats getRowCountStats() {",
" return null;",
" }"
],
"header": "@@ -42,15 +42,20 @@ import java.util.Vector;",
"removed": [
"",
"\tpublic int getExecutionCount() { return 0;}",
"\tpublic void setExecutionCount(int count) {}",
"",
"\tpublic Vector getRowCountCheckVector() {return null;}",
"\tpublic void setRowCountCheckVector(Vector v) {}",
"",
"\tpublic int getStalePlanCheckInterval() { return Integer.MAX_VALUE; }",
"\tpublic void setStalePlanCheckInterval(int count) {}"
]
}
]
}
] |
derby-DERBY-5947-d11ed089
|
DERBY-5947: Factor out common code from generated classes
Moved more code to BaseActivation.execute(). Specifically, code to
initialize BaseActivation's resultSet field and marking the root of
the result set tree as the top-level result set.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1400023 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java",
"hunks": [
{
"added": [],
"header": "@@ -94,7 +94,6 @@ class ActivationClassBuilder\textends\tExpressionClassBuilder",
"removed": [
"\t\texecuteMethod = beginExecuteMethod();"
]
},
{
"added": [],
"header": "@@ -162,49 +161,6 @@ class ActivationClassBuilder\textends\tExpressionClassBuilder",
"removed": [
"\t/**",
"\t * By the time this is done, it has generated the following code",
"\t * <pre>",
"\t *\t\tprotected ResultSet doExecute() throws StandardException {",
"\t *\t\t\t// statements must be added here",
"\t *\t\t}",
"\t * }",
"\t * </pre>",
"\t *",
"\t * @exception StandardException thrown on failure",
"\t */",
"\tprivate\tMethodBuilder\tbeginExecuteMethod()",
"\t\tthrows StandardException",
"\t{",
"\t\t// create a reset method that does nothing.",
"\t\t// REVISIT: this might better belong in the Activation",
"\t\t// superclasses ?? not clear yet what it needs to do.",
"",
"\t\t// don't yet need a reset method here. when we do,",
"\t\t// it will need to call super.reset() as well as",
"\t\t// whatever it does.",
"\t\t// mb = cb.newMethodBuilder(",
"\t\t// \tModifier.PUBLIC, \"void\", \"reset\");",
"\t\t// mb.addStatement(javaFac.newStatement(",
"\t\t//\t\tjavaFac.newSpecialMethodCall(",
"\t\t//\t\t\tthisExpression(),",
"\t\t//\t\t\tBaseActivation.CLASS_NAME,",
"\t\t//\t\t\t\"reset\", \"void\")));",
"\t\t// mb.addStatement(javaFac.newReturnStatement());",
"\t\t// mb.complete(); // there is nothing else.",
"",
"",
"\t\t// This method is an implementation of the abstract method",
"\t\t// BaseActivation - ResultSet doExecute()",
"",
"\t\t// create an empty execute method",
"\t\tMethodBuilder mb = cb.newMethodBuilder(Modifier.PROTECTED,",
"\t\t\tClassName.ResultSet, \"doExecute\");",
"\t\tmb.addThrownException(ClassName.StandardException);",
"",
"\t\treturn\tmb;",
"\t}",
""
]
},
{
"added": [
"\tvoid finishExecuteMethod() {",
" if (executeMethod != null) {",
" executeMethod.methodReturn();",
" executeMethod.complete();",
" }"
],
"header": "@@ -225,23 +181,12 @@ class ActivationClassBuilder\textends\tExpressionClassBuilder",
"removed": [
"\tvoid finishExecuteMethod(boolean genMarkAsTopNode) {",
"",
"\t\t/* We only call markAsTopResultSet() for selects.",
"\t\t * Non-select DML marks the top NoPutResultSet in the constructor.",
"\t\t * Needed for closing down resultSet on an error.",
"\t\t */",
"\t\tif (genMarkAsTopNode)",
"\t\t{",
"\t\t\t// dup the result set to leave one for the return and one for this call",
"\t\t\texecuteMethod.dup();",
"\t\t\texecuteMethod.cast(ClassName.NoPutResultSet);",
"\t\t\texecuteMethod.callMethod(VMOpcode.INVOKEINTERFACE, (String) null, \"markAsTopResultSet\", \"void\", 0);",
"\t\t}",
"\t\t/* return resultSet */",
"\t\texecuteMethod.methodReturn();",
"\t\texecuteMethod.complete();"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java",
"hunks": [
{
"added": [
"import java.io.Serializable;",
"import java.lang.reflect.Modifier;",
"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.io.FormatableArrayHolder;",
"import org.apache.derby.iapi.services.loader.GeneratedClass;",
"import org.apache.derby.iapi.sql.compile.TypeCompiler;",
"import org.apache.derby.impl.sql.execute.IndexColumnOrder;"
],
"header": "@@ -22,55 +22,25 @@",
"removed": [
"import org.apache.derby.iapi.services.compiler.MethodBuilder;",
"import org.apache.derby.iapi.reference.ClassName;",
"",
"",
"",
"import org.apache.derby.iapi.sql.execute.ResultSetFactory;",
"import org.apache.derby.iapi.sql.execute.ExecutionFactory;",
"import org.apache.derby.iapi.sql.execute.ExecIndexRow;",
"",
"import org.apache.derby.iapi.sql.Activation;",
"import org.apache.derby.iapi.sql.ParameterValueSet;",
"import org.apache.derby.iapi.sql.Row;",
"",
"import org.apache.derby.iapi.sql.execute.ExecRow;",
"",
"import org.apache.derby.impl.sql.compile.OrderedColumnList;",
"import org.apache.derby.impl.sql.compile.ResultColumnList;",
"import org.apache.derby.impl.sql.execute.IndexColumnOrder;",
"",
"import org.apache.derby.iapi.types.DataValueDescriptor;",
"import org.apache.derby.iapi.types.DataTypeDescriptor;",
"import org.apache.derby.iapi.types.DataValueFactory;",
"",
"import org.apache.derby.iapi.sql.compile.TypeCompiler;",
"",
"import org.apache.derby.iapi.error.StandardException;",
"",
"import org.apache.derby.iapi.services.loader.ClassFactory;",
"import org.apache.derby.iapi.services.loader.GeneratedClass;",
"import org.apache.derby.iapi.services.loader.GeneratedByteCode;",
"import org.apache.derby.iapi.services.loader.GeneratedMethod;",
"",
"import java.lang.reflect.Modifier;",
"import org.apache.derby.iapi.services.classfile.VMOpcode;",
"",
"import org.apache.derby.iapi.services.monitor.Monitor;",
"",
"import org.apache.derby.iapi.services.io.FormatableArrayHolder;",
"",
"import java.io.Serializable;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/StatementNode.java",
"hunks": [
{
"added": [
" // Create the method that generates the ResultSet tree used when",
" // executing this statement. Implements the abstract method",
" // BaseActivation.createResultSet().",
" Modifier.PROTECTED,",
" \"createResultSet\");"
],
"header": "@@ -299,40 +299,13 @@ public abstract class StatementNode extends QueryTreeNode",
"removed": [
" /*",
" * Generate the code to execute this statement.",
" * Two methods are generated here: doExecute() and",
" * fillResultSet().",
" * <BR>",
" * doExecute() is called for every execution of the",
" * Activation. Nodes may add code to this using",
" * ActivationClassBuilder.getExecuteMethod().",
" * This code will be executed every execution.",
" * <BR>",
" * fillResultSet is called by execute if the BaseActivation's",
" * resultSet field is null and the returned ResultSet is",
" * set into the the resultSet field.",
" * <P>",
" * The generated code is equivalent to:",
" * <code>",
" * protected ResultSet doExecute() {",
" * ",
" * [per-execution code added by nodes]",
" * ",
" * if (resultSet == null)",
" * resultSet = fillResultSet();",
" * ",
" * return resultSet;",
" * }",
" * </code>",
" */",
"",
" MethodBuilder executeMethod = generatingClass.getExecuteMethod();",
"",
" Modifier.PRIVATE,",
" \"fillResultSet\");"
]
},
{
"added": [],
"header": "@@ -342,35 +315,6 @@ public abstract class StatementNode extends QueryTreeNode",
"removed": [
" // Get the value of the resultSet field.",
"\t\texecuteMethod.pushThis();",
"\t\texecuteMethod.getField(ClassName.BaseActivation, \"resultSet\",",
" ClassName.ResultSet);",
"",
" // Keep a copy of the field value on the stack so we don't need",
" // to look it up again if it's non-null.",
" executeMethod.dup();",
"\t\texecuteMethod.conditionalIfNull();",
"",
" // The field was null, so we won't use the value that's on the",
" // stack. Forget about it.",
" executeMethod.pop();",
"",
" // Generate the result set tree and store the",
" // resulting top-level result set into the resultSet",
" // field, as well as returning it from the execute method.",
"",
" // Push this onto the stack twice, as both callMethod() and",
" // putField() take the instance as first operand.",
"\t\t\texecuteMethod.pushThis();",
" executeMethod.dup();",
"\t\t\texecuteMethod.callMethod(VMOpcode.INVOKEVIRTUAL, (String) null,",
"\t\t\t\t\t\t\t\t\t \"fillResultSet\", ClassName.ResultSet, 0);",
" executeMethod.putField(ClassName.BaseActivation, \"resultSet\", ClassName.ResultSet);",
" ",
"\t\texecuteMethod.startElseCode(); // this is here as the compiler only supports ? :",
"\t\texecuteMethod.completeConditional();",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/ConstantActionActivation.java",
"hunks": [
{
"added": [],
"header": "@@ -22,11 +22,8 @@",
"removed": [
"",
"import java.util.Vector;",
""
]
},
{
"added": [
" protected ResultSet createResultSet() throws StandardException {",
" return getResultSetFactory().getDDLResultSet(this);",
" }"
],
"header": "@@ -57,11 +54,9 @@ public final class ConstantActionActivation extends BaseActivation",
"removed": [
"\tprotected ResultSet doExecute() throws StandardException {",
"\t\tif (resultSet == null)",
"\t\t\tresultSet = getResultSetFactory().getDDLResultSet(this);",
"\t\treturn resultSet;",
"\t}"
]
}
]
}
] |
derby-DERBY-5947-dd9ad070
|
DERBY-5947: Factor out common code from generated classes
Move authorization check for CursorNodes from generated code to
CursorActivation.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1400024 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/execute/CursorActivation.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.error.StandardException;",
"import org.apache.derby.iapi.sql.ResultSet;",
"import org.apache.derby.iapi.sql.conn.Authorizer;",
"import org.apache.derby.iapi.sql.execute.NoPutResultSet;",
""
],
"header": "@@ -21,6 +21,11 @@",
"removed": []
},
{
"added": [
"",
" /** @see BaseActivation#decorateResultSet */",
" ResultSet decorateResultSet() throws StandardException {",
" // CursorActivation means it's a query that returns rows. Check that",
" // the caller is authorized to run SQL read operations.",
" getLanguageConnectionContext().getAuthorizer().authorize(",
" this, Authorizer.SQL_SELECT_OP);",
"",
" // The top-level result set should be marked as such.",
" NoPutResultSet rs = (NoPutResultSet) createResultSet();",
" rs.markAsTopResultSet();",
" return rs;",
" }"
],
"header": "@@ -46,4 +51,17 @@ public abstract class CursorActivation",
"removed": []
}
]
}
] |
derby-DERBY-5947-edb7fcc6
|
DERBY-5947: Factor out common code from generated classes
- Move common code from the generated execute() method to a method
in BaseActivation, and rename the generated execute() method to
doExecute(), called from BaseActivation.execute().
- Simplify generated code in doExecute(). Specifically, fetch the
resultSet field only once.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1399140 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ActivationClassBuilder.java",
"hunks": [
{
"added": [
"import java.lang.reflect.Modifier;",
"import org.apache.derby.iapi.reference.ClassName;",
"import org.apache.derby.iapi.services.compiler.LocalField;",
"import org.apache.derby.iapi.services.compiler.MethodBuilder;",
"import org.apache.derby.iapi.sql.compile.CodeGeneration;",
"import org.apache.derby.iapi.sql.compile.CompilerContext;"
],
"header": "@@ -21,40 +21,14 @@",
"removed": [
"import org.apache.derby.iapi.services.compiler.ClassBuilder;",
"import org.apache.derby.iapi.services.compiler.MethodBuilder;",
"import org.apache.derby.iapi.services.compiler.LocalField;",
"import org.apache.derby.iapi.reference.ClassName;",
"",
"",
"import org.apache.derby.iapi.services.sanity.SanityManager;",
"",
"import org.apache.derby.iapi.sql.compile.CompilerContext;",
"import org.apache.derby.iapi.sql.compile.CodeGeneration;",
"",
"import org.apache.derby.iapi.sql.execute.CursorResultSet;",
"",
"import org.apache.derby.iapi.sql.ResultSet;",
"",
"import org.apache.derby.iapi.sql.execute.ExecRow;",
"",
"import org.apache.derby.iapi.types.DataTypeDescriptor;",
"import org.apache.derby.iapi.types.TypeId;",
"",
"",
"import org.apache.derby.iapi.services.loader.GeneratedMethod;",
"",
"import java.lang.reflect.Modifier;",
"",
"import java.io.PrintWriter;",
"",
"import java.io.File;",
"import java.io.FileOutputStream;",
"import java.io.ByteArrayOutputStream;",
"import java.io.IOException;",
"import java.util.Hashtable;"
]
},
{
"added": [
"\t *\t\tprotected ResultSet doExecute() throws StandardException {"
],
"header": "@@ -108,8 +82,7 @@ class ActivationClassBuilder\textends\tExpressionClassBuilder",
"removed": [
"\t *\t\tpublic ResultSet execute() throws StandardException {",
"\t *\t\t\tthrowIfClosed(\"execute\");"
]
},
{
"added": [
"\t *\t\tprotected ResultSet doExecute() throws StandardException {"
],
"header": "@@ -192,8 +165,7 @@ class ActivationClassBuilder\textends\tExpressionClassBuilder",
"removed": [
"\t *\t\tpublic ResultSet execute() throws StandardException {",
"\t *\t\t\tthrowIfClosed(\"execute\");"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/StatementNode.java",
"hunks": [
{
"added": [
" * Two methods are generated here: doExecute() and",
" * doExecute() is called for every execution of the"
],
"header": "@@ -301,10 +301,10 @@ public abstract class StatementNode extends QueryTreeNode",
"removed": [
" * Two methods are generated here: execute() and",
" * execute is called for every execution of the"
]
},
{
"added": [
" * protected ResultSet doExecute() {"
],
"header": "@@ -315,12 +315,8 @@ public abstract class StatementNode extends QueryTreeNode",
"removed": [
" * public ResultSet execute() {",
" * // these two added by ActivationClassBuilder",
" * throwIfClosed(\"execute\");",
" * startExecution();",
" * "
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java",
"hunks": [
{
"added": [
" public final ResultSet execute() throws StandardException {",
" throwIfClosed(\"execute\");",
"",
" // Determine if we should check row counts during this execution.",
" checkRowCounts = shouldWeCheckRowCounts();",
"",
" // If we are to check row counts, clear the hash table of row counts",
" // we have checked.",
" if (checkRowCounts) {",
" rowCountsCheckedThisExecution.clear();",
" }",
"",
" return doExecute();",
" }",
"",
" /**",
" * Abstract method overridden by generated classes, containing the",
" * body of the {@link #execute()} method.",
" */",
" protected abstract ResultSet doExecute() throws StandardException;",
""
],
"header": "@@ -258,6 +258,27 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/ConstantActionActivation.java",
"hunks": [
{
"added": [
"\tprotected ResultSet doExecute() throws StandardException {",
""
],
"header": "@@ -57,14 +57,11 @@ public final class ConstantActionActivation extends BaseActivation",
"removed": [
"\tpublic ResultSet execute() throws StandardException {",
"",
"\t\tthrowIfClosed(\"execute\");",
"\t\tstartExecution();",
""
]
}
]
}
] |
derby-DERBY-5947-f5426327
|
DERBY-5947: Factor out common code from generated classes
Move execution count from generated class to GenericPreparedStatement.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1413586 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/compiler/MethodBuilder.java",
"hunks": [
{
"added": [],
"header": "@@ -161,17 +161,6 @@ public interface MethodBuilder {",
"removed": [
" /**",
" * Push the contents of the static field onto the stack.",
" * <pre>",
" * Stack ... =>",
" * ...,field_value",
" * </pre>",
" *",
" * @param field a static field",
" */",
" public void getStaticField(LocalField field);",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/bytecode/BCClass.java",
"hunks": [
{
"added": [],
"header": "@@ -263,10 +263,6 @@ class BCClass extends GClass {",
"removed": [
" * <p>",
" * If the modifiers include static, the returned method builder is for",
" * a class or interface initialization method. Otherwise, the builder is",
" * for an instance initialization method."
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/services/bytecode/BCMethod.java",
"hunks": [
{
"added": [],
"header": "@@ -885,12 +885,6 @@ class BCMethod implements MethodBuilder {",
"removed": [
" public void getStaticField(LocalField field) {",
" BCLocalField lf = (BCLocalField) field;",
" myCode.addInstrU2(VMOpcode.GETSTATIC, lf.cpi);",
" growStack(lf.type);",
" }",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/GenericPreparedStatement.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.util.ReuseFactory;"
],
"header": "@@ -37,6 +37,7 @@ import org.apache.derby.iapi.services.cache.Cacheable;",
"removed": []
},
{
"added": [
"import java.util.ArrayList;",
"import java.util.Collections;"
],
"header": "@@ -72,6 +73,8 @@ import org.apache.derby.iapi.services.loader.GeneratedClass;",
"removed": []
},
{
"added": [
" /**",
" * Holder for row counts and execution count. Used for determining",
" * whether the statement should be recompiled.",
" */",
" private RowCountStatistics rowCountStats = new RowCountStatistics();",
""
],
"header": "@@ -178,6 +181,12 @@ public class GenericPreparedStatement",
"removed": []
},
{
"added": [
" rowCountStats.reset();"
],
"header": "@@ -1002,7 +1011,7 @@ recompileOutOfDatePlan:",
"removed": [
"\t\treturn;"
]
},
{
"added": [
" clone.rowCountStats = rowCountStats;"
],
"header": "@@ -1189,6 +1198,7 @@ recompileOutOfDatePlan:",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/compile/ExpressionClassBuilder.java",
"hunks": [
{
"added": [],
"header": "@@ -72,7 +72,6 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface",
"removed": [
" protected MethodBuilder staticInitializer;"
]
},
{
"added": [],
"header": "@@ -169,13 +168,6 @@ abstract\tclass ExpressionClassBuilder implements ExpressionClassBuilderInterface",
"removed": [
" MethodBuilder getStaticInitializer() {",
" if (staticInitializer == null) {",
" staticInitializer = cb.newConstructorBuilder(Modifier.STATIC);",
" }",
" return staticInitializer;",
" }",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/sql/execute/BaseActivation.java",
"hunks": [
{
"added": [],
"header": "@@ -27,7 +27,6 @@ import java.sql.SQLWarning;",
"removed": [
"import java.util.List;"
]
},
{
"added": [],
"header": "@@ -920,35 +919,6 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
" /**",
" * This class holds row count statistics for a query.",
" */",
" protected static class RowCountStats {",
" /**",
" * Stale plan check interval tells how often the row counts should be",
" * checked. Cached here so that we don't need to query the database",
" * properties on each execution.",
" */",
" private int stalePlanCheckInterval;",
" /** The number of times this query has been executed. */",
" private int executionCount;",
" /** List with row count estimates for each table in the query. */",
" private final List rowCounts;",
"",
" public RowCountStats() {",
" rowCounts = new ArrayList();",
" }",
" }",
"",
" /**",
" * Get the object holding row count statistics for this activation.",
" *",
" * It may return {@code null} if row count statistics are not maintained",
" * for the activation. In that case, {@link #shouldWeCheckRowCounts()}",
" * must return {@code false}.",
" */",
" protected abstract RowCountStats getRowCountStats();",
""
]
},
{
"added": [
" long n1 = getPreparedStatement()",
" .getInitialRowCount(resultSetNumber, currentRowCount);",
" /*",
" ** Has the row count changed significantly?",
" */",
" if (currentRowCount != n1)",
" {",
" if (n1 >= TEN_PERCENT_THRESHOLD)",
" {",
" /*",
" ** For tables with more than",
" ** TEN_PERCENT_THRESHOLD rows, the",
" ** threshold is 10% of the size of the table.",
" */",
" long changeFactor = n1 / (currentRowCount - n1);",
" if (Math.abs(changeFactor) <= 10) {",
" significantChange = true;",
" }",
" else",
" {",
" /*",
" ** For tables with less than",
" ** TEN_PERCENT_THRESHOLD rows, the threshold",
" ** is non-linear. This is because we want",
" ** recompilation to happen sooner for small",
" ** tables that change size. This formula",
" ** is for a second-order equation (a parabola).",
" ** The derivation is:",
" **",
" ** c * n1 = (difference in row counts) ** 2",
" **\t\t\t\t- or -",
" ** c * n1 = (currentRowCount - n1) ** 2",
" **",
" ** Solving this for currentRowCount, we get:",
" **",
" ** currentRowCount = n1 + sqrt(c * n1)",
" **",
" **\t\t\t\t- or -",
" **",
" ** difference in row counts = sqrt(c * n1)",
" **",
" **\t\t\t\t- or -",
" **",
" ** (difference in row counts) ** 2 =",
" **\t\t\t\t\tc * n1",
" **",
" ** Which means that we should recompile when",
" ** the current row count exceeds n1 (the first",
" ** row count) by sqrt(c * n1), or when the",
" ** square of the difference exceeds c * n1.",
" ** A good value for c seems to be 4.",
" **",
" ** We don't use this formula when c is greater",
" ** than TEN_PERCENT_THRESHOLD because we never",
" ** want to recompile unless the number of rows",
" ** changes by more than 10%, and this formula",
" ** is more sensitive than that for values of",
" ** n1 greater than TEN_PERCENT_THRESHOLD.",
" */",
" long changediff = currentRowCount - n1;",
"",
" /*",
" ** Square changediff rather than take the square",
" ** root of (4 * n1), because multiplying is",
" ** faster than taking a square root. Also,",
" ** check to be sure that squaring changediff",
" ** will not cause an overflow by comparing it",
" ** with the square root of the maximum value",
" ** for a long (this square root is taken only",
" ** once, when the class is loaded, or during",
" ** compilation if the compiler is smart enough).",
" */",
" if (Math.abs(changediff) <= MAX_SQRT)",
" {",
" if ((changediff * changediff) >",
" Math.abs(4 * n1))",
" {",
" significantChange = true;",
" }",
" }",
" }",
" }"
],
"header": "@@ -968,121 +938,90 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
" final RowCountStats stats = getRowCountStats();",
" synchronized (stats)",
"\t\t\t\t{",
" final List rowCountCheckVector = stats.rowCounts;",
"\t\t\t\t\tLong firstRowCount = null;",
"\t\t\t\t\t/*",
"\t\t\t\t\t** Check whether this resultSet has been seen yet.",
"\t\t\t\t\t*/",
"\t\t\t\t\tif (resultSetNumber < rowCountCheckVector.size())",
"\t\t\t\t\t{",
"\t\t\t\t\t\tfirstRowCount =",
" (Long) rowCountCheckVector.get(resultSetNumber);",
"\t\t\t\t\t}",
"\t\t\t\t\telse",
"\t\t\t\t\t{",
" int newSize = resultSetNumber + 1;",
" while (rowCountCheckVector.size() < newSize) {",
" rowCountCheckVector.add(null);",
"\t\t\t\t\t}",
"",
"\t\t\t\t\tif (firstRowCount != null)",
"\t\t\t\t\t{",
"\t\t\t\t\t\t/*",
"\t\t\t\t\t\t** This ResultSet has been seen - has the row count",
"\t\t\t\t\t\t** changed significantly?",
"\t\t\t\t\t\t*/",
"\t\t\t\t\t\tlong n1 = firstRowCount.longValue();",
"",
"\t\t\t\t\t\tif (currentRowCount != n1)",
"\t\t\t\t\t\t{",
"\t\t\t\t\t\t\tif (n1 >= TEN_PERCENT_THRESHOLD)",
"\t\t\t\t\t\t\t{",
"\t\t\t\t\t\t\t\t/*",
"\t\t\t\t\t\t\t\t** For tables with more than",
"\t\t\t\t\t\t\t\t** TEN_PERCENT_THRESHOLD rows, the",
"\t\t\t\t\t\t\t\t** threshold is 10% of the size of the table.",
"\t\t\t\t\t\t\t\t*/",
"\t\t\t\t\t\t\t\tlong changeFactor = n1 / (currentRowCount - n1);",
"\t\t\t\t\t\t\t\tif (Math.abs(changeFactor) <= 10)",
"\t\t\t\t\t\t\t\t\tsignificantChange = true;",
"\t\t\t\t\t\t\t}",
"\t\t\t\t\t\t\telse",
"\t\t\t\t\t\t\t{",
"\t\t\t\t\t\t\t\t/*",
"\t\t\t\t\t\t\t\t** For tables with less than",
"\t\t\t\t\t\t\t\t** TEN_PERCENT_THRESHOLD rows, the threshold",
"\t\t\t\t\t\t\t\t** is non-linear. This is because we want",
"\t\t\t\t\t\t\t\t** recompilation to happen sooner for small",
"\t\t\t\t\t\t\t\t** tables that change size. This formula",
"\t\t\t\t\t\t\t\t** is for a second-order equation (a parabola).",
"\t\t\t\t\t\t\t\t** The derivation is:",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** c * n1 = (difference in row counts) ** 2",
"\t\t\t\t\t\t\t\t**\t\t\t\t- or - ",
"\t\t\t\t\t\t\t\t** c * n1 = (currentRowCount - n1) ** 2",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** Solving this for currentRowCount, we get:",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** currentRowCount = n1 + sqrt(c * n1)",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t**\t\t\t\t- or -",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** difference in row counts = sqrt(c * n1)",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t**\t\t\t\t- or -",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** (difference in row counts) ** 2 =",
"\t\t\t\t\t\t\t\t**\t\t\t\t\tc * n1",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** Which means that we should recompile when",
"\t\t\t\t\t\t\t\t** the current row count exceeds n1 (the first",
"\t\t\t\t\t\t\t\t** row count) by sqrt(c * n1), or when the",
"\t\t\t\t\t\t\t\t** square of the difference exceeds c * n1.",
"\t\t\t\t\t\t\t\t** A good value for c seems to be 4.",
"\t\t\t\t\t\t\t\t**",
"\t\t\t\t\t\t\t\t** We don't use this formula when c is greater",
"\t\t\t\t\t\t\t\t** than TEN_PERCENT_THRESHOLD because we never",
"\t\t\t\t\t\t\t\t** want to recompile unless the number of rows",
"\t\t\t\t\t\t\t\t** changes by more than 10%, and this formula",
"\t\t\t\t\t\t\t\t** is more sensitive than that for values of",
"\t\t\t\t\t\t\t\t** n1 greater than TEN_PERCENT_THRESHOLD.",
"\t\t\t\t\t\t\t\t*/",
"\t\t\t\t\t\t\t\tlong changediff = currentRowCount - n1;",
"",
"\t\t\t\t\t\t\t\t/*",
"\t\t\t\t\t\t\t\t** Square changediff rather than take the square",
"\t\t\t\t\t\t\t\t** root of (4 * n1), because multiplying is",
"\t\t\t\t\t\t\t\t** faster than taking a square root. Also,",
"\t\t\t\t\t\t\t\t** check to be sure that squaring changediff",
"\t\t\t\t\t\t\t\t** will not cause an overflow by comparing it",
"\t\t\t\t\t\t\t\t** with the square root of the maximum value",
"\t\t\t\t\t\t\t\t** for a long (this square root is taken only",
"\t\t\t\t\t\t\t\t** once, when the class is loaded, or during",
"\t\t\t\t\t\t\t\t** compilation if the compiler is smart enough).",
"\t\t\t\t\t\t\t\t*/",
"\t\t\t\t\t\t\t\tif (Math.abs(changediff) <= MAX_SQRT)",
"\t\t\t\t\t\t\t\t{",
"\t\t\t\t\t\t\t\t\tif ((changediff * changediff) >",
"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tMath.abs(4 * n1))",
"\t\t\t\t\t\t\t\t\t{",
"\t\t\t\t\t\t\t\t\t\tsignificantChange = true;",
"\t\t\t\t\t\t\t\t\t}",
"\t\t\t\t\t\t\t\t}",
"\t\t\t\t\t\t\t}",
"\t\t\t\t\t\t}",
"\t\t\t\t\t}",
"\t\t\t\t\telse",
"\t\t\t\t\t{",
" rowCountCheckVector.set(",
" resultSetNumber, new Long(currentRowCount));",
"",
"\t\t\t\t\t}",
"\t\t\t\t}"
]
},
{
"added": [
" final ExecPreparedStatement ps = getPreparedStatement();"
],
"header": "@@ -1225,7 +1164,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
" final RowCountStats stats = getRowCountStats();"
]
},
{
"added": [
" int executionCount = ps.incrementExecutionCount();"
],
"header": "@@ -1233,7 +1172,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
" int executionCount = ++stats.executionCount;"
]
},
{
"added": [
" int stalePlanCheckInterval = ps.getStalePlanCheckInterval();"
],
"header": "@@ -1255,7 +1194,7 @@ public abstract class BaseActivation implements CursorActivation, GeneratedByteC",
"removed": [
" int stalePlanCheckInterval = stats.stalePlanCheckInterval;"
]
}
]
}
] |
derby-DERBY-5948-88fc5dd0
|
DERBY-5948 Update JVMInfo to include JDK8
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1406053 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/services/info/JVMInfo.java",
"hunks": [
{
"added": [
" <LI> 9 - J2SE_18 - JDK 1.8"
],
"header": "@@ -49,6 +49,7 @@ public abstract class JVMInfo",
"removed": []
},
{
"added": [
" public static final int J2SE_18 = 9;"
],
"header": "@@ -58,6 +59,7 @@ public abstract class JVMInfo",
"removed": []
},
{
"added": [
" }",
" else if (javaVersion.equals(\"1.8\")) {",
" id = J2SE_18;"
],
"header": "@@ -136,6 +138,9 @@ public abstract class JVMInfo",
"removed": []
},
{
"added": [
" if (Float.parseFloat(javaVersion) > 1.8f)",
" id = J2SE_18;"
],
"header": "@@ -145,8 +150,8 @@ public abstract class JVMInfo",
"removed": [
" if (Float.parseFloat(javaVersion) > 1.7f)",
" id = J2SE_17;"
]
},
{
"added": [
" case J2SE_18: return \"Java SE 8 - JDBC 4.1\";"
],
"header": "@@ -177,6 +182,7 @@ public abstract class JVMInfo",
"removed": []
}
]
}
] |
derby-DERBY-5951-63baf276
|
Various small changes in CollationTest:
- Reorganized how the test suite was built in order to prevent
unnecessary database creation when there are multiple test cases
that should run with the same collation.
- Enabled test case for DERBY-5951 and fixed typos in some of its
SQL statements.
- Removed some unused code.
- Use more of the framework's helper methods.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1430735 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5951-85e788ba
|
DERBY-5951: Supply missing CLOB instantiator.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1398914 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/iapi/types/CollatorSQLClob.java",
"hunks": [
{
"added": [
"import java.sql.Clob;",
""
],
"header": "@@ -21,6 +21,8 @@",
"removed": []
},
{
"added": [
" /**",
" * Create SQL CLOB value initially set to value that",
" * performs collation according to collatorForCharacterDatatypes ",
" */",
"\tCollatorSQLClob(Clob val, RuleBasedCollator collatorForCharacterDatatypes)",
"\t{",
"\t\tsuper(val);",
" setCollator(collatorForCharacterDatatypes);",
"\t}",
""
],
"header": "@@ -66,6 +68,16 @@ class CollatorSQLClob extends SQLClob implements CollationElementsInterface",
"removed": []
}
]
}
] |
derby-DERBY-5954-0af1f882
|
DERBY-5954 NPE in SELECT involving subselects and windows functions
Patch "derby-5954-with-test-2" makes the code only look for in-lined
window specification in simply contained select lists. Adds a new test
case to OLAPTest which would fail with an NPE before this patch,
cf. original JIRA problem.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1406240 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5955-38667d90
|
DERBY-5955 Prepare Derby to run with Compact Profiles (JEP 161)
Patch derby-5955-rename. Rename the new datasources from using prefix
"NonJNDI" to prefix "Basic".
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1440262 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/jdbc/BasicClientConnectionPoolDataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIClientConnectionPoolDataSource40"
]
},
{
"added": [
" * BasicClientConnectionPoolDataSource40 is similar to",
"public class BasicClientConnectionPoolDataSource40",
" extends BasicClientDataSource40"
],
"header": "@@ -29,14 +29,14 @@ import org.apache.derby.shared.common.i18n.MessageUtil;",
"removed": [
" * NonJNDIClientConnectionPoolDataSource40 is similar to",
"public class NonJNDIClientConnectionPoolDataSource40",
" extends NonJNDIClientDataSource40"
]
},
{
"added": [
" \"org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40\";"
],
"header": "@@ -47,7 +47,7 @@ public class NonJNDIClientConnectionPoolDataSource40",
"removed": [
" \"org.apache.derby.jdbc.NonJNDIClientConnectionPoolDataSource40\";"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/BasicClientDataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicClientDataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIClientDataSource40"
]
},
{
"added": [
" * BasicClientDataSource40 is similar to ClientDataSource40 except it",
"public class BasicClientDataSource40",
" \"org.apache.derby.jdbc.BasicClientDataSource40\";"
],
"header": "@@ -29,16 +29,16 @@ import org.apache.derby.client.am.SqlException;",
"removed": [
" * NonJNDIClientDataSource40 is similar to ClientDataSource40 except it",
"public class NonJNDIClientDataSource40",
" \"org.apache.derby.jdbc.NonJNDIClientDataSource40\";"
]
}
]
},
{
"file": "java/client/org/apache/derby/jdbc/BasicClientXADataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicClientXADataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIClientXADataSource40"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedConnectionPoolDataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicEmbeddedConnectionPoolDataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIEmbeddedConnectionPoolDataSource40"
]
},
{
"added": [
" * BasicEmbeddedConnectionPoolDataSource40 is similar to",
"public class BasicEmbeddedConnectionPoolDataSource40",
" extends BasicEmbeddedDataSource40"
],
"header": "@@ -24,14 +24,14 @@ import java.sql.SQLException;",
"removed": [
" * NonJNDIEmbeddedConnectionPoolDataSource40 is similar to",
"public class NonJNDIEmbeddedConnectionPoolDataSource40",
" extends NonJNDIEmbeddedDataSource40"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedDataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicEmbeddedDataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIEmbeddedDataSource40"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/BasicEmbeddedXADataSource40.java",
"hunks": [
{
"added": [
" Derby - Class org.apache.derby.jdbc.BasicEmbeddedXADataSource40"
],
"header": "@@ -1,6 +1,6 @@",
"removed": [
" Derby - Class org.apache.derby.jdbc.NonJNDIEmbeddedXADataSource40"
]
},
{
"added": [
" * BasicEmbeddedXADataSource40 is similar to",
"public class BasicEmbeddedXADataSource40",
" extends BasicEmbeddedDataSource40"
],
"header": "@@ -27,14 +27,14 @@ import org.apache.derby.iapi.jdbc.ResourceAdapter;",
"removed": [
" * NonJNDIEmbeddedXADataSource40 is similar to",
"public class NonJNDIEmbeddedXADataSource40",
" extends NonJNDIEmbeddedDataSource40"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/functionTests/testData/serializedDataSources/SerializeDataSources.java",
"hunks": [
{
"added": [
" \"org.apache.derby.jdbc.BasicEmbeddedDataSource40\",",
" \"org.apache.derby.jdbc.BasicEmbeddedConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.BasicEmbeddedXADataSource40\""
],
"header": "@@ -67,9 +67,9 @@ public class SerializeDataSources {",
"removed": [
" \"org.apache.derby.jdbc.NonJNDIEmbeddedDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIEmbeddedConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIEmbeddedXADataSource40\""
]
},
{
"added": [
" \"org.apache.derby.jdbc.BasicClientDataSource40\",",
" \"org.apache.derby.jdbc.BasicClientConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.BasicClientXADataSource40\""
],
"header": "@@ -80,9 +80,9 @@ public class SerializeDataSources {",
"removed": [
" \"org.apache.derby.jdbc.NonJNDIClientDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIClientConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIClientXADataSource40\""
]
},
{
"added": [
" if (!(dsClassName.contains(\"Basic\"))) {"
],
"header": "@@ -137,7 +137,7 @@ public class SerializeDataSources {",
"removed": [
" if (!(dsClassName.contains(\"NonJNDI\"))) {"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/JDBCClient.java",
"hunks": [
{
"added": [
" \"org.apache.derby.jdbc.BasicEmbeddedDataSource40\",",
" \"org.apache.derby.jdbc.BasicEmbeddedConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.BasicEmbeddedXADataSource40\","
],
"header": "@@ -48,15 +48,15 @@ public final class JDBCClient {",
"removed": [
" \"org.apache.derby.jdbc.NonJNDIEmbeddedDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIEmbeddedConnectionPoolDataSource40\",",
" \"org.apache.derby.jdbc.NonJNDIEmbeddedXADataSource40\","
]
}
]
},
{
"file": "java/tools/org/apache/derby/impl/tools/ij/xaHelper.java",
"hunks": [
{
"added": [
" \"org.apache.derby.jdbc.BasicClientXADataSource40\")."
],
"header": "@@ -541,7 +541,7 @@ class xaHelper implements xaAbstractHelper",
"removed": [
" \"org.apache.derby.jdbc.NonJNDIClientXADataSource40\")."
]
}
]
}
] |
derby-DERBY-5955-58bf06e1
|
DERBY-5955 Prepare Derby to run with Compact Profiles (JEP 161)
Patch derby-5955-embed-restructure-04. This restructures the class
hierarchy for embedded data sources to prepare for introduction of the
non-JNDI dependent ones for JEP 161.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1427045 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/drda/org/apache/derby/impl/drda/XADatabase.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.error.ExceptionSeverity;",
"import org.apache.derby.iapi.reference.MessageId;",
"import org.apache.derby.iapi.services.i18n.MessageService;",
"import org.apache.derby.iapi.services.info.JVMInfo;",
"import org.apache.derby.jdbc.EmbeddedXADataSourceInterface;"
],
"header": "@@ -25,8 +25,13 @@ import java.sql.SQLException;",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver30.java",
"hunks": [
{
"added": [
" EmbeddedBaseDataSource eds, String user, String password,"
],
"header": "@@ -121,7 +121,7 @@ public class Driver30 extends Driver20 {",
"removed": [
" EmbeddedDataSource eds, String user, String password,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/Driver40.java",
"hunks": [
{
"added": [
" EmbeddedBaseDataSource eds, String user, String password,"
],
"header": "@@ -168,7 +168,7 @@ public class Driver40 extends Driver30 {",
"removed": [
" EmbeddedDataSource eds, String user, String password,"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbedPooledConnection.java",
"hunks": [
{
"added": [
" final EmbeddedBaseDataSource dataSource;"
],
"header": "@@ -88,7 +88,7 @@ class EmbedPooledConnection implements javax.sql.PooledConnection, BrokeredConne",
"removed": [
"\tfinal ReferenceableDataSource dataSource;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbedXAConnection40.java",
"hunks": [
{
"added": [
" EmbedXAConnection40 (EmbeddedBaseDataSource ds, ResourceAdapter ra,"
],
"header": "@@ -52,7 +52,7 @@ final class EmbedXAConnection40 extends EmbedXAConnection",
"removed": [
" \tEmbedXAConnection40 (EmbeddedDataSource ds, ResourceAdapter ra, "
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource.java",
"hunks": [
{
"added": [
" implements EmbeddedConnectionPoolDataSourceInterface"
],
"header": "@@ -46,7 +46,7 @@ import javax.sql.PooledConnection;",
"removed": [
"\t\timplements\tjavax.sql.ConnectionPoolDataSource"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedConnectionPoolDataSource40.java",
"hunks": [
{
"added": [],
"header": "@@ -22,7 +22,6 @@ package org.apache.derby.jdbc;",
"removed": [
"import javax.sql.ConnectionPoolDataSource;"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedDataSource.java",
"hunks": [
{
"added": [
"import java.lang.reflect.InvocationTargetException;",
"import java.lang.reflect.Method;",
"import java.lang.reflect.Modifier;",
"import javax.naming.NamingException;",
"import javax.naming.Reference;",
"import javax.naming.Referenceable;",
"import javax.naming.StringRefAddr;"
],
"header": "@@ -21,15 +21,13 @@",
"removed": [
"import java.io.PrintWriter;",
"import java.sql.Connection;",
"import java.sql.Driver;",
"import java.sql.DriverManager;",
"import java.sql.SQLException;",
"import java.util.Properties;",
"import org.apache.derby.iapi.reference.Attribute;",
"import org.apache.derby.iapi.reference.SQLState;",
"import org.apache.derby.impl.jdbc.Util;"
]
},
{
"added": [
"public class EmbeddedDataSource extends ReferenceableDataSource",
" implements Referenceable"
],
"header": "@@ -180,65 +178,12 @@ import org.apache.derby.impl.jdbc.Util;",
"removed": [
"public class EmbeddedDataSource extends ReferenceableDataSource implements",
"\t\t\t\tjavax.sql.DataSource",
"\t/** instance variables that will be serialized */",
"",
"\t/**",
"\t * The database name.",
"\t * @serial",
"\t */",
"\tprivate String databaseName;",
"",
"\t/**",
"\t * The data source name.",
"\t * @serial",
"\t */",
"\tprivate String dataSourceName;",
"",
"\t/**",
"\t * Description of the database.",
"\t * @serial",
"\t */",
"\tprivate String description;",
"",
"\t/**",
"\t * Set to \"create\" if the database should be created.",
"\t * @serial",
"\t */",
"\tprivate String createDatabase;",
"",
"\t/**",
"\t * Set to \"shutdown\" if the database should be shutdown.",
"\t * @serial",
"\t */",
"\tprivate String shutdownDatabase;",
"",
"\t/**",
"\t * Derby specific connection attributes.",
"\t * @serial",
"\t */",
"\tprivate String connectionAttributes;",
"",
"\t/**",
"\t\tSet password to be a set of connection attributes.",
"\t*/",
"\tprivate boolean attributesAsPassword;",
"",
"\t/** instance variables that will not be serialized */",
"\ttransient private PrintWriter printer;",
"\ttransient private int loginTimeout;",
"",
"\t// Unlike a DataSource, LocalDriver is shared by all",
"\t// Derby databases in the same jvm.",
"\ttransient InternalDriver driver;",
"",
"\ttransient private String jdbcurl;",
""
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource.java",
"hunks": [
{
"added": [
"public class EmbeddedXADataSource extends EmbeddedDataSource implements EmbeddedXADataSourceInterface"
],
"header": "@@ -56,8 +56,7 @@ import org.apache.derby.iapi.services.monitor.Monitor;",
"removed": [
"public class EmbeddedXADataSource extends EmbeddedDataSource implements",
"\t\t\t\tjavax.sql.XADataSource"
]
},
{
"added": [
" ra = setupResourceAdapter(this, ra, null, null, false);"
],
"header": "@@ -88,7 +87,7 @@ public class EmbeddedXADataSource extends EmbeddedDataSource implements",
"removed": [
"\t\t\tsetupResourceAdapter(null, null, false);"
]
}
]
},
{
"file": "java/testing/org/apache/derbyTesting/junit/JDBCDataSource.java",
"hunks": [
{
"added": [
" BaseTestCase.fail(\"unexpected error\", e);"
],
"header": "@@ -179,7 +179,7 @@ public class JDBCDataSource {",
"removed": [
" Assert.fail(e.toString());"
]
}
]
}
] |
derby-DERBY-5955-cb88209e
|
DERBY-5955 Prepare Derby to run with Compact Profiles (JEP 161)
Patch derby-5955-javadoc-followup; typo fix plus clarify usage: JDBC 4.2/Java
8/Java 8 Compact profile 2.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1441327 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/jdbc/EmbeddedXADataSource40.java",
"hunks": [
{
"added": [
" running on the following platforms:",
" <p>",
" <ul>",
" <li>JDBC 4.1 - Java SE 7",
" <li>JDBC 4.2 - full Java SE 8",
" </ul>",
" <p>",
" Use BasicEmbeddedXADataSource40 if your application runs on Java 8",
" Compact Profile 2.",
" <p>",
" Use EmbeddedXADataSource if your application runs on the following",
" platforms:"
],
"header": "@@ -28,10 +28,19 @@ import org.apache.derby.impl.jdbc.Util;",
"removed": [
" running on full Java SE 7, corresponding to JDBC 4.1.",
"\tUse EmbeddedXADataSource",
"\tif your application runs in the following environments:"
]
}
]
}
] |
derby-DERBY-5960-e82e672f
|
DERBY-5960: VirtualRandomAccessFile.close() is not idempotent
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1402111 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/io/vfmem/VirtualRandomAccessFile.java",
"hunks": [
{
"added": [],
"header": "@@ -25,7 +25,6 @@ import java.io.DataInputStream;",
"removed": [
""
]
},
{
"added": [
" private final BlockedByteArrayInputStream bIn;",
" private final DataInputStream dIs;",
" private final BlockedByteArrayOutputStream bOut;",
" private final DataOutputStream dOs;"
],
"header": "@@ -43,19 +42,19 @@ public class VirtualRandomAccessFile",
"removed": [
" private BlockedByteArrayInputStream bIn;",
" private DataInputStream dIs;",
" private BlockedByteArrayOutputStream bOut;",
" private DataOutputStream dOs;"
]
}
]
}
] |
derby-DERBY-5964-6051d0cd
|
DERBY-5964: Timestamp comparison failure in AutomaticIndexStatisticsTest.testStatisticsCorrectness
Run test in GMT timezone to prevent instabilities around transition
to or from DST.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1404886 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5969-e744e840
|
DERBY-5969: Raise a SQLWarning if someone attempts to change the encryption state of an already booted database.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1404947 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-597-39aa8c4a
|
DERBY-398 - Bring store tests into J2ME/CDC Foundation testing
Contributed by Deepa Remesh
Attaching a patch 'store_patch.diff' for enabling tests (mostly store tests) to run in J2ME. This patch does the following:
* i18n\urlLocale.sql, i18n\urlLocale_app.properties, urlLocale.out - Removed protocol name from URLs and added 'ij.protocol' to app_properties file so that test can run in J2ME. Updated master file.
* i18n\DefaultLocale.java - Removed lines to get nested connection from procedure methods since these connections were not used. This was causing failures with JSR169 where nested connections are not supported.
* i18n\iepnegativetests_ES_app.properties, iepnegativetests_ES.out - Added 'ij.protocol' to app_properties file so that test can run in J2ME. Updated master file.
* storetests\st_1_app.properties, storetests\st_schema_app.properties, storetests\st_b5772_app.properties, storetests\derby94_app.properties - Changed the property 'database' to 'ij.database' in st_schema_app.properties.
* tools\ij2_app.properties - Changed the property 'database' to 'ij.database' and added ij.dataSource properties.
* tools\ij4_app.properties - Added comment that this test has to be excluded since it is a test for a case with no default driver.
* tools\iepnegativetests_app.properties, tools\iepnegativetests.sql, iepnegativetests.out - Removed protocol name from URLs and added 'ij.protocol' to app_properties file so that test can run in J2ME. Updated master file.
* tools\ij_app.properties - Added comment that test is specific to ij and tests bad/good urls
* testRoutines.sql - To avoid using nested connection, directly called create procedures instead of calling a wrapper which will create the procedures.
* store\databaseProperties_app.properties, databaseProperties.out - Changed the master file to match change in testRoutines.sql
* TestUtil.java - Changed getDataSource method to handle case for EmbeddedSimpleDataSource. Added getDataSourceConnection method which takes a Properties object and returns a connection using the appropriate data source class. This method can be used to boot/shutdown Derby using DataSource.
* lang\errorStream_app.properties - This test works with changes to TestUtil.getDataSource method to handle case for EmbeddedSimpleDataSource.
* lang\logStream.java, lang\logStream_app.properties, logStream.out - Changed to call TestUtil.getDataSourceConnection instead of DriverManager.getConnection
* lang\functions_app.properties - Added comment that test is excluded for now since it uses server-side JDBC. This test can be converted to Java test to call only functions which do not use server-side JDBC in JSR169 environment.
* lang\releaseCompileLocks_app.properties - Added comment that test uses server-side JDBC
* store\backupRestore.sql, store\backupRestore_app.properties, backupRestore.out - Removed protocol name from URLs. Updated master file.
* store\removeStubs.sql, store\removeStubs_app.properties, removeStubs.out - Removed protocol name from URLs. Updated master file.
* store\rollForwardBackup_app.properties, store\rollForwardBackup.sql, rollForwardBackup.out - Removed protocol name from URLs. Updated master file.
* store\connectDisconnect_app.properties - This test works after changes for DERBY-597. So just re-enabled it.
* store\Beetle6038_app.properties - Added comment that this tests encryption which is not supported in Derby J2ME implementation
* store\TestDurabilityProperty.java, store\TestDurabilityProperty_app.properties - Changed to call TestUtil.getDataSourceConnection instead of DriverManager.getConnection
* store\backupRestore1.java, store\backupRestore1_app.properties - Changed to call TestUtil.getDataSourceConnection instead of DriverManager.getConnection
* store\MaxLogNumber_app.properties, store\MaxLogNumberRecovery_app.properties - Changed the property 'database' to 'ij.database' and added ij.dataSource properties.
* store\rollForwardRecovery.sql, store\rollForwardRecovery_app.properties, rollForwardRecovery.out - Removed protocol name from URLs. Updated master file.
* store\logDevice_app.properties - This test works after changes for DERBY-597. So just re-enabled it.
* lang\closed.java, lang\closed_app.properties - Added catch for NoSuchMethodError for DatabaseMetadata.getURL method. Skips 'shutDownTest' if it is JSR169. I think I can change this to use TestUtil.getDataSourceConnection for shutdown test. I noticed this when writing this down and so will submit this in my next patch.
* j9_foundation\closed.out - Added new master to handle DatabaseMetadata.getURL
* j9_foundation\ij2.out - Added new master because of difference in output of show connections in J2ME.
Ran derbyall with this patch using Sun JDK 1.4.2 and j9_foundation in IBM WCTME 5.7. No new failures.
Created: 28/Jun/05 07:23 PM Updated: Yesterday 11:56 PM
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@348593 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/functionTests/util/TestUtil.java",
"hunks": [
{
"added": [
"",
"import javax.sql.DataSource;",
"",
"",
"",
"\t",
"\t//Used for JSR169",
"\tpublic static boolean HAVE_DRIVER_CLASS;",
"\tstatic{",
"\t\ttry{",
"\t\t\tClass.forName(\"java.sql.Driver\");",
"\t\t\tHAVE_DRIVER_CLASS = true;",
"\t\t}",
"\t\tcatch(ClassNotFoundException e){",
"\t\t\t//Used for JSR169",
"\t\t\tHAVE_DRIVER_CLASS = false;",
"\t\t}",
"\t}"
],
"header": "@@ -28,15 +28,33 @@ import java.util.Enumeration;",
"removed": []
},
{
"added": [
"\tprivate static String JSR169_DATASOURCE_STRING = \"Simple\";"
],
"header": "@@ -79,6 +97,7 @@ public class TestUtil {",
"removed": []
},
{
"added": [
"\t\tString classname;",
"\t\tif(HAVE_DRIVER_CLASS)",
"\t\t\tclassname = getDataSourcePrefix() + REGULAR_DATASOURCE_STRING + \"DataSource\";",
"\t\telse",
"\t\t\tclassname = getDataSourcePrefix() + JSR169_DATASOURCE_STRING + \"DataSource\";"
],
"header": "@@ -239,8 +258,12 @@ public class TestUtil {",
"removed": [
"\t\tString classname = getDataSourcePrefix() + REGULAR_DATASOURCE_STRING + \"DataSource\";"
]
}
]
}
] |
derby-DERBY-597-9952cc5b
|
DERBY-597 - Enhance ij connect statement to work in J2ME/CDC/FP
ummary of patch:
* If ij.dataSource property is set and the url in the 'connect' statement does not start with 'jdbc:', ij calls util.getDataSourceConnection to get connection (instead of using DriverManager).
* Added getDataSourceConnection(String dsName,String user,String password,String dbName,boolean firstTime) to util.java. This returns a connection using the data source passed in ij.dataSource property. This method is called by startJBMS in util.java and ConnectStatement() in ij. The parameter firstTime indicates whether this method is called at start of test by startJBMS or by ConnectStatement.
* getDataSourceConnection method in turn calls setupDataSource which calls the set methods of data source. If firstTime=true, it uses values of ij.dataSource.* properties to set up the data source object. Otherwise, the properties ij.dataSource.databaseName and ij.dataSource.createDatabase are ignored. Instead, value of 'dbName' parameter is used. [In first version of this patch, parameter 'firstTime' was called 'create']
* Removed J2ME excludes from 13 tests which pass with this patch. Some tests needed changes in the connect statement url and master files.
Contributed by Deepa Remesh
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@328246 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/tools/org/apache/derby/impl/tools/ij/util.java",
"hunks": [
{
"added": [
" /**",
" * Sets up a data source with values specified in ij.dataSource.* properties or",
" * passed as parameters of this method",
" * ",
" * @param ds DataSource object",
" * @param dbName Database Name",
" * @param firstTime If firstTime is false, ij.dataSource.createDatabase and ij.dataSource.databaseName ",
" * properties will not be used. The value in parameter dbName will be used instead of ",
" * ij.dataSource.databaseName.",
" * ",
" * @throws Exception",
" */",
" static public void setupDataSource(Object ds,String dbName,boolean firstTime) throws Exception {",
"\t// then call the method with corresponding value. Call setCreateDatabase based on",
" //parameter create. \t",
" java.lang.reflect.Method[] methods = ds.getClass().getMethods();",
"\t ",
"\t \t//Check if setCreateDatabase has to be called based on create parameter",
"\t \tif(name.equals(\"setCreateDatabase\") && !firstTime)",
"\t \t\tcontinue;",
"\t \t",
"\t \tString property = name.substring(\"set\".length()); // setXyyyZwww",
"\t \tproperty = \"ij.dataSource.\"+property.substring(0,1).toLowerCase(java.util.Locale.ENGLISH)+ property.substring(1); // xyyyZwww",
"\t \tString value = util.getSystemProperty(property);",
"\t \tif(name.equals(\"setDatabaseName\") && !firstTime)",
"\t \t\tvalue = dbName;",
"\t \tif (value != null) {",
"\t \t\ttry {",
"\t \t\t\t// call string method",
"\t \t\t\tm.invoke(ds, new Object[] {value});",
"\t \t\t} catch (Throwable ignore) {",
"\t \t\t\t// failed, assume it's an integer parameter",
"\t \t\t\tm.invoke(ds, new Object[] {Integer.valueOf(value)});",
"\t \t\t}",
"\t \t}",
" ",
" /**",
" * Returns a connection obtained using the DataSource. This method will be called when ij.dataSource",
" * property is set. It uses ij.dataSource.* properties to get details for the connection. ",
" * ",
" * @param dsName Data Source name",
" * @param user User name",
" * @param password Password",
" * @param dbName Database Name",
" * @param firstTime Indicates if the method is called first time. This is passed to setupDataSource ",
" * method.",
" * ",
" * @return",
" * @throws SQLException",
" */",
" public static Connection getDataSourceConnection(String dsName,String user,String password,",
" \t\t\t\t\t\t\t\t\t\t\t\tString dbName,boolean firstTime) throws SQLException{",
"\t\t// Get a new proxied connection through DataSource",
"\t\tObject ds = null; // really javax.sql.DataSource",
"\t\ttry {",
"\t\t\t",
"\t\t Class dc = Class.forName(dsName);",
"\t\t ds = dc.newInstance();",
"\t\t ",
"\t\t // set datasource properties",
"\t\t setupDataSource(ds,dbName,firstTime);\t ",
"",
"\t\t // Java method call \"by hand\" { con = ds.getConnection(); }",
"\t\t // or con = ds.getConnection(user, password)",
"\t\t \t",
"\t\t\tjava.lang.reflect.Method m = ",
"\t\t\t\tuser == null ? dc.getMethod(\"getConnection\", null) :",
"\t\t\t\t\t dc.getMethod(\"getConnection\", DS_GET_CONN_TYPES);",
"\t\t\t\t",
"\t\t\treturn (java.sql.Connection) m.invoke(ds,",
"\t\t\t\t\t user == null ? null : new String[] {user, password});",
"\t\t} catch (InvocationTargetException ite)",
"\t\t{",
"\t\t\tif (ite.getTargetException() instanceof SQLException)",
"\t\t\t\tthrow (SQLException) ite.getTargetException();",
"\t\t\tite.printStackTrace(System.out);",
"\t\t} catch (Exception e)",
"\t\t{",
"\t\t\te.printStackTrace(System.out);",
"\t\t}",
"\t\treturn null;",
" }"
],
"header": "@@ -335,30 +335,96 @@ public final class util implements java.security.PrivilegedAction {",
"removed": [
" static public void setupDataSource(Object ds) throws Exception {",
"\t// then call the method with corresponding value.",
"\tjava.lang.reflect.Method[] methods = ds.getClass().getMethods();",
"\t\tString property = name.substring(\"set\".length()); // setXyyyZwww",
"\t\tproperty = \"ij.dataSource.\"+property.substring(0,1).toLowerCase(java.util.Locale.ENGLISH)+ property.substring(1); // xyyyZwww",
"\t\tString value = util.getSystemProperty(property);",
"\t\t//System.out.println(\"setupDateSource: method=\"+name+\" property=\"+property+\" value=\"+((value==null)?\"null\":value));",
"\t\tif (value != null) {",
"\t\t try {",
"\t\t\t// call string method",
"\t\t\tm.invoke(ds, new Object[] {value});",
"\t\t } catch (Throwable ignore) {",
"\t\t\t// failed, assume it's an integer parameter",
"\t\t\tm.invoke(ds, new Object[] {Integer.valueOf(value)});",
"\t\t }",
"\t\t}"
]
},
{
"added": [
"\t ",
"\t //First connection - pass firstTime=true, dbName=null. For database name, ",
"\t //value in ij.dataSource.databaseName will be used. ",
"\t con = getDataSourceConnection(dsName,user,password,null,true);",
"\t return con;"
],
"header": "@@ -433,37 +499,11 @@ public final class util implements java.security.PrivilegedAction {",
"removed": [
"",
"\t\t// Get a new proxied connection through DataSource",
"\t\tObject ds = null; // really javax.sql.DataSource",
"\t\ttry {",
"\t\t\t",
"\t\t Class dc = Class.forName(dsName);",
"\t\t ds = dc.newInstance();",
"\t\t ",
"\t\t // set datasource properties",
"\t\t setupDataSource(ds);\t ",
"",
"\t\t // Java method call \"by hand\" { con = ds.getConnection(); }",
"\t\t // or con = ds.getConnection(user, password)",
"\t\t \t",
"\t\t\tjava.lang.reflect.Method m = ",
"\t\t\t\tuser == null ? dc.getMethod(\"getConnection\", null) :",
"\t\t\t\t\t dc.getMethod(\"getConnection\", DS_GET_CONN_TYPES);",
"\t\t\t\t",
"\t\t\treturn (java.sql.Connection) m.invoke(ds,",
"\t\t\t\t\t user == null ? null : new String[] {user, password});",
"\t\t} catch (InvocationTargetException ite)",
"\t\t{",
"\t\t\tif (ite.getTargetException() instanceof SQLException)",
"\t\t\t\tthrow (SQLException) ite.getTargetException();",
"\t\t\tite.printStackTrace(System.out);",
"\t\t} catch (Exception e)",
"\t\t{",
"\t\t\te.printStackTrace(System.out);",
"\t\t}",
"\t\t",
"\t\treturn null;"
]
}
]
}
] |
derby-DERBY-5970-345f23d4
|
DERBY-5970: Prevent user from setting the decryptDatabase attribute to anything other than true.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1403735 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedConnection.java",
"hunks": [
{
"added": [
" private boolean isCryptoBoot(Properties p)",
" throws SQLException",
" {",
" vetTrue(p, Attribute.DECRYPT_DATABASE) ||"
],
"header": "@@ -770,9 +770,11 @@ public class EmbedConnection implements EngineConnection",
"removed": [
" private boolean isCryptoBoot(Properties p) {",
" isTrue(p, Attribute.DECRYPT_DATABASE) ||"
]
},
{
"added": [
" /**",
" * Returns true if the attribute exists and is set to true.",
" * Raises an exception if the attribute exists and is set to something else.",
" */",
" private static boolean vetTrue(Properties p, String attribute)",
" throws SQLException",
" {",
" String value = p.getProperty( attribute );",
" if ( value == null ) { return false; }",
"",
" if ( Boolean.valueOf( value ).booleanValue() ) { return true; }",
"",
" throw newSQLException",
" ( SQLState.INVALID_ATTRIBUTE, attribute, value, Boolean.TRUE.toString() );",
" }",
""
],
"header": "@@ -849,6 +851,22 @@ public class EmbedConnection implements EngineConnection",
"removed": []
}
]
}
] |
derby-DERBY-5971-59481500
|
DERBY-5971: Improve test coverage for SQLBoolean class
Cover the hashCode() method by testing SELECT DISTINCT, which performs
a hash scan.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1406125 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5971-82bf2d50
|
DERBY-5971: Improve test coverage for SQLBoolean class
Remove two unused methods and add test cases for binary operators.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1404190 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5972-eca1f7c6
|
DERBY-5972: Grammar doesn't accept OR operator without parentheses
Update grammar to allow full value expressions where it previously
only allowed conjunctions of boolean primaries.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1408136 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5975-cfd0e57c
|
DERBY-5975; intermittent nightly test failure across releases in Derby5937SlaveShutdownTest.testSlaveFailoverLeak
disabling test for weme
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1412392 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5979-93fd82e1
|
DERBY-5979: Part a: Do not use \n to terminate lines in Apache License header String constant and instead join the line strings with the value of line.separator property.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1499287 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/build/org/apache/derbyPreBuild/ReleaseProperties.java",
"hunks": [
{
"added": [
" private static final String LS = System.getProperty(\"line.separator\");",
" \"# Licensed to the Apache Software Foundation (ASF) under one or more\" + LS +",
" \"# contributor license agreements. See the NOTICE file distributed with\" + LS +",
" \"# this work for additional information regarding copyright ownership.\" + LS +",
" \"# The ASF licenses this file to you under the Apache License, Version 2.0\" + LS +",
" \"# (the \\\"License\\\"); you may not use this file except in compliance with\" + LS +",
" \"# the License. You may obtain a copy of the License at\" + LS +",
" \"#\" + LS +",
" \"# http://www.apache.org/licenses/LICENSE-2.0\" + LS +",
" \"#\" + LS +",
" \"# Unless required by applicable law or agreed to in writing, software\" + LS +",
" \"# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\" + LS +",
" \"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\" + LS +",
" \"# See the License for the specific language governing permissions and\" + LS +",
" \"# limitations under the License.\" + LS + LS;"
],
"header": "@@ -56,23 +56,22 @@ public class ReleaseProperties extends Task",
"removed": [
"",
" \"# Licensed to the Apache Software Foundation (ASF) under one or more\\n\" +",
" \"# contributor license agreements. See the NOTICE file distributed with\\n\" +",
" \"# this work for additional information regarding copyright ownership.\\n\" +",
" \"# The ASF licenses this file to you under the Apache License, Version 2.0\\n\" +",
" \"# (the \\\"License\\\"); you may not use this file except in compliance with\\n\" +",
" \"# the License. You may obtain a copy of the License at\\n\" +",
" \"#\\n\" +",
" \"# http://www.apache.org/licenses/LICENSE-2.0\\n\" +",
" \"#\\n\" +",
" \"# Unless required by applicable law or agreed to in writing, software\\n\" +",
" \"# distributed under the License is distributed on an \\\"AS IS\\\" BASIS,\\n\" +",
" \"# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\\n\" +",
" \"# See the License for the specific language governing permissions and\\n\" +",
" \"# limitations under the License.\\n\" +",
" \"\\n\";"
]
}
]
}
] |
derby-DERBY-5986-e27c25c2
|
DERBY-5986: Make ArithmeticTest test DECIMAL data type
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1406950 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5988-1bd559bd
|
DERBY-5988 Instability in DataSourceTest: some test fixture orderings makes test_jdbc4_1 fail
Patch derby-5988: temporary measure to avoid tests failing
intermittently. Could be removed when the issue is fixed, but IMHO
running fixtures in in a predicatable order is good anyway.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1427660 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-5989-80fb7449
|
DERBY-5989: Stop producing byte code for non-existent qualifiers
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1409120 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/sql/compile/PredicateList.java",
"hunks": [
{
"added": [
" String retvalType = ClassName.Qualifier + \"[][]\";",
"",
" // If there are no qualifiers, return null.",
" if (numberOfQualifiers == 0) {",
" mb.pushNull(retvalType);",
" return;",
" }",
""
],
"header": "@@ -3032,9 +3032,16 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\tString retvalType = ClassName.Qualifier + \"[][]\";"
]
},
{
"added": [
" if (SanityManager.DEBUG)",
" {",
" if (numberOfQualifiers > size())",
" SanityManager.THROWASSERT(",
" \"numberOfQualifiers(\" + numberOfQualifiers +",
" \") > size(\" + size() + \").\" + \":\" + this.hashCode());",
" }",
" // Determine number of leading AND qualifiers, and subsequent",
" // trailing OR qualifiers.",
" int num_of_or_conjunctions = 0;",
" for (int i = 0; i < numberOfQualifiers; i++)",
" {",
" if (((Predicate) elementAt(i)).isOrList())",
" num_of_or_conjunctions++;",
" }",
" /* Assign the initializer to the Qualifier[] field */",
" consMB.pushNewArray(",
" ClassName.Qualifier + \"[]\", (int) num_of_or_conjunctions + 1);",
" consMB.setField(qualField);",
" // Allocate qualifiers[0] which is an entry for each of the leading",
" // AND clauses.",
" consMB.getField(qualField); // 1st arg allocateQualArray",
" consMB.push((int) 0); // 2nd arg allocateQualArray",
" consMB.push((int) numberOfQualifiers - num_of_or_conjunctions); // 3rd arg allocateQualArray",
"",
" consMB.callMethod(",
" VMOpcode.INVOKESTATIC,",
" acb.getBaseClassName(),",
" \"allocateQualArray\", \"void\", 3);"
],
"header": "@@ -3070,52 +3077,44 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\t/*",
"\t\t** Initialize the Qualifier array to a new Qualifier[][] if",
"\t\t** there are any qualifiers. It is automatically initialized to",
"\t\t** null if it isn't explicitly initialized.",
"\t\t*/",
"\t\tif (numberOfQualifiers != 0)",
"\t\t{",
" if (SanityManager.DEBUG)",
" if (numberOfQualifiers > size())",
" {",
" SanityManager.THROWASSERT(",
" \"numberOfQualifiers(\" + numberOfQualifiers + ",
" \") > size(\" + size() + \").\" + \":\" + this.hashCode());",
" }",
" // Determine number of leading AND qualifiers, and subsequent",
" // trailing OR qualifiers.",
" int num_of_or_conjunctions = 0;",
" for (int i = 0; i < numberOfQualifiers; i++)",
" if (((Predicate) elementAt(i)).isOrList())",
" {",
" num_of_or_conjunctions++;",
" }",
" ",
"\t\t\t/* Assign the initializer to the Qualifier[] field */",
"\t\t\tconsMB.pushNewArray(",
" ClassName.Qualifier + \"[]\", (int) num_of_or_conjunctions + 1);",
"\t\t\tconsMB.setField(qualField);",
" // Allocate qualifiers[0] which is an entry for each of the leading",
" // AND clauses.",
"\t\t\tconsMB.getField(qualField); // 1st arg allocateQualArray",
"\t\t\tconsMB.push((int) 0); // 2nd arg allocateQualArray",
"\t\t\tconsMB.push((int) numberOfQualifiers - num_of_or_conjunctions); // 3rd arg allocateQualArray",
"\t\t\tconsMB.callMethod(",
" VMOpcode.INVOKESTATIC, ",
" acb.getBaseClassName(), ",
" \"allocateQualArray\", \"void\", 3);",
"\t\t}"
]
},
{
"added": [
" orderQualifiers();"
],
"header": "@@ -3129,10 +3128,7 @@ public class PredicateList extends QueryTreeNodeVector implements OptimizablePre",
"removed": [
"\t\tif (numberOfQualifiers > 0)",
"\t\t{",
"\t\t\torderQualifiers();",
"\t\t}"
]
}
]
}
] |
derby-DERBY-5992-c724a49e
|
DERBY-5992: Use BaseTestCase.execJavaCmd() to start process from NetworkServerTestSetup
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1409113 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/NetworkServerTestSetup.java",
"hunks": [
{
"added": [
"import java.util.Arrays;"
],
"header": "@@ -33,6 +33,7 @@ import java.security.PrivilegedActionException;",
"removed": []
},
{
"added": [],
"header": "@@ -301,8 +302,6 @@ final public class NetworkServerTestSetup extends BaseTestSetup {",
"removed": [
" final TestConfiguration config = TestConfiguration.getCurrent();",
" "
]
},
{
"added": [],
"header": "@@ -320,14 +319,8 @@ final public class NetworkServerTestSetup extends BaseTestSetup {",
"removed": [
" String classpath = BaseTestCase.getSystemProperty( \"java.class.path\" );",
" al.add( BaseTestCase.getJavaExecutableName() );",
" al.add( \"-Demma.verbosity.level=silent\" );",
" al.add( \"-classpath\" );",
" al.add( classpath );",
" "
]
},
{
"added": [
" al.addAll(Arrays.asList(getDefaultStartupArgs(skipHostName)));",
" al.addAll(Arrays.asList(startupArgs));",
" Process serverProcess = BaseTestCase.execJavaCmd(command);"
],
"header": "@@ -377,48 +370,13 @@ final public class NetworkServerTestSetup extends BaseTestSetup {",
"removed": [
" String[] defaultArgs = getDefaultStartupArgs( skipHostName );",
"",
" count = defaultArgs.length;",
" for ( int i = 0; i < count; i++ )",
" {",
" al.add( defaultArgs[ i ] );",
" }",
"",
" count = startupArgs.length;",
" for ( int i = 0; i < count; i++ )",
" {",
" al.add( startupArgs[ i ] );",
" }",
" String startcommand =\"\";",
" for (int i = 0 ; i < command.length ; i++) {",
" \tstartcommand += command[i] + \" \";",
" }",
"",
" BaseTestCase.println(\"XXX server startup command = \" +",
"\tstartcommand + \"\\n\");",
"",
" Process serverProcess;",
" ",
" try {",
" serverProcess = (Process)",
" AccessController.doPrivileged",
" (",
" new PrivilegedExceptionAction()",
" {",
" public Object run() throws IOException",
" {",
" return Runtime.getRuntime().exec(command);",
" }",
" }",
" );",
" } catch (PrivilegedActionException e) {",
" throw e.getException();",
" }"
]
}
]
}
] |
derby-DERBY-5995-b79d9d80
|
DERBY-5995 (Add a test case to check the 3 readme files get created even when log directory has been changed with jdbc url attribute logDevice )
Adding a junit test for readme files but the log directory has been redirected using logDevice jdbc url attribute.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1413740 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/testing/org/apache/derbyTesting/junit/DropDatabaseSetup.java",
"hunks": [
{
"added": [
" //DERBY-5995 (Add a test case to check the 3 readme files get created ",
" // even when log directory has been changed with jdbc url attribute ",
" // logDevice )",
" String logDevice = config.getConnectionAttributes().getProperty(\"logDevice\");",
" if (logDevice != null) {",
" removeDirectory(logDevice);",
" }"
],
"header": "@@ -90,6 +90,13 @@ class DropDatabaseSetup extends BaseTestSetup {",
"removed": []
}
]
}
] |
derby-DERBY-5996-9496f49a
|
DERBY-5996(Create readme files (cautioning users against modifying database files) at database hard upgrade time)
During hard upgrade to 10.10, Derby will create 3 readme files, one in database directory, one in "seg0" directory and one in log directory. These readme files warn users against touching any of files associated with derby database
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1418568 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/store/access/RAMAccessManager.java",
"hunks": [
{
"added": [
"import org.apache.derby.iapi.services.monitor.PersistentService;"
],
"header": "@@ -32,6 +32,7 @@ import org.apache.derby.iapi.services.daemon.Serviceable;",
"removed": []
},
{
"added": [
"import org.apache.derby.iapi.store.raw.log.LogFactory;",
"import org.apache.derby.iapi.store.raw.data.DataFactory;"
],
"header": "@@ -55,6 +56,8 @@ import org.apache.derby.iapi.store.raw.ContainerKey;",
"removed": []
}
]
}
] |
derby-DERBY-5998-026c5e8f
|
DERBY-5998: Replication tests fail on CDC platforms without optional JSSE package
Skip the replication tests if the optional package is not available.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1411160 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6000-01c7f835
|
DERBY-6000: Fix misc issues raised by JDBC 4.2 buddy testing.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1450422 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/jdbc/ClientDriver.java",
"hunks": [
{
"added": [
" ",
" checkURLNotNull( url );",
""
],
"header": "@@ -93,6 +93,9 @@ public class ClientDriver implements java.sql.Driver {",
"removed": []
},
{
"added": [
"",
" checkURLNotNull( url );",
" "
],
"header": "@@ -207,6 +210,9 @@ public class ClientDriver implements java.sql.Driver {",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/InternalDriver.java",
"hunks": [
{
"added": [
"\tpublic boolean acceptsURL(String url) throws SQLException",
" {"
],
"header": "@@ -132,7 +132,8 @@ public abstract class InternalDriver implements ModuleControl {",
"removed": [
"\tpublic boolean acceptsURL(String url) {"
]
}
]
},
{
"file": "java/engine/org/apache/derby/jdbc/JDBC.java",
"hunks": [
{
"added": [
"import java.sql.SQLException;",
""
],
"header": "@@ -21,6 +21,8 @@",
"removed": []
}
]
},
{
"file": "java/engine/org/apache/derby/mbeans/JDBCMBean.java",
"hunks": [
{
"added": [
"import java.sql.SQLException;",
""
],
"header": "@@ -21,6 +21,8 @@",
"removed": []
}
]
}
] |
derby-DERBY-6000-0b0a105a
|
DERBY-6000: Add JDBC 4.2 method Statement.executeLargeBatch() to embedded and client drivers.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1440035 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/client/org/apache/derby/client/am/Statement.java",
"hunks": [
{
"added": [
" agent_.logWriter_.traceEntry(this, \"executeLargeUpdate\", sql);",
" agent_.logWriter_.traceExit(this, \"executeLargeUpdate\", updateValue);"
],
"header": "@@ -501,11 +501,11 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" agent_.logWriter_.traceEntry(this, \"executeUpdate\", sql);",
" agent_.logWriter_.traceExit(this, \"executeUpdate\", updateValue);"
]
},
{
"added": [
" // Added by JDBC 4.2",
" public long[] executeLargeBatch() throws SQLException, BatchUpdateException {",
" try",
" {",
" synchronized (connection_) {",
" if (agent_.loggingEnabled()) {",
" agent_.logWriter_.traceEntry(this, \"executeLargeBatch\");",
" }",
" long[] updateCounts = executeBatchX();",
" if (agent_.loggingEnabled()) {",
" agent_.logWriter_.traceExit(this, \"executeLargeBatch\", updateCounts);",
" }",
" return updateCounts;",
" }",
" }",
" catch ( SqlException se )",
" {",
" throw se.getSQLException();",
" }",
" }",
""
],
"header": "@@ -1175,6 +1175,27 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": []
},
{
"added": [
" agent_.logWriter_.traceEntry(this, \"executeLargeUpdate\", sql, autoGeneratedKeys);",
" agent_.logWriter_.traceExit(this, \"executeLargeUpdate\", updateValue);"
],
"header": "@@ -1308,12 +1329,12 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" agent_.logWriter_.traceEntry(this, \"executeUpdate\", sql, autoGeneratedKeys);",
" agent_.logWriter_.traceExit(this, \"executeUpdate\", updateValue);"
]
},
{
"added": [
" agent_.logWriter_.traceEntry(this, \"executeLargeUpdate\", sql, columnIndexes);",
" agent_.logWriter_.traceExit(this, \"executeLargeUpdate\", updateValue);"
],
"header": "@@ -1353,14 +1374,14 @@ public class Statement implements java.sql.Statement, StatementCallbackInterface",
"removed": [
" agent_.logWriter_.traceEntry(this, \"executeUpdate\", sql, columnIndexes);",
" agent_.logWriter_.traceExit(this, \"executeUpdate\", updateValue);"
]
}
]
},
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java",
"hunks": [
{
"added": [
" return Util.squashLongs( executeLargeBatch() );",
" }",
" ",
" /**",
" * JDBC 4.2",
" * ",
" * Submit a batch of commands to the database for execution.",
" * This method is optional. For use with",
" * statements which may touch more than Integer.MAX_VALUE rows.",
" */",
" public long[] executeLargeBatch() throws SQLException {",
" setupContextStack();"
],
"header": "@@ -1015,10 +1015,21 @@ public class EmbedStatement extends ConnectionChild",
"removed": [
" setupContextStack();"
]
},
{
"added": [
"\t\t\tlong[] returnUpdateCountForBatch = new long[size];"
],
"header": "@@ -1035,7 +1046,7 @@ public class EmbedStatement extends ConnectionChild",
"removed": [
"\t\t\tint[] returnUpdateCountForBatch = new int[size];"
]
},
{
"added": [
"\t\t\t\t\treturnUpdateCountForBatch[ i ] = getLargeUpdateCount();"
],
"header": "@@ -1048,7 +1059,7 @@ public class EmbedStatement extends ConnectionChild",
"removed": [
"\t\t\t\t\treturnUpdateCountForBatch[i] = getUpdateCount();"
]
}
]
}
] |
derby-DERBY-6000-0be21896
|
DERBY-6000: Add JDBC 4.2 DatabaseMetaData changes to embedded and client drivers.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1441436 13f79535-47bb-0310-9956-ffa450edef68
|
[
{
"file": "java/engine/org/apache/derby/impl/jdbc/EmbedDatabaseMetaData.java",
"hunks": [
{
"added": [
" /**",
" * Added in JDBC 4.2.",
" *",
" * Derby does not support the Types.REF_CURSOR type.",
" *",
" * @return true if so",
" */",
"\tpublic boolean supportsRefCursors()",
" {",
"\t\treturn false;",
"\t}",
" "
],
"header": "@@ -971,6 +971,18 @@ public class EmbedDatabaseMetaData extends ConnectionChild",
"removed": []
}
]
}
] |
derby-DERBY-6000-1149dc1d
|
DERBY-6000: Add negative tests for the new JDBC 4.2 overloads of ResultSet.updateObject.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1450776 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
derby-DERBY-6000-17efc162
|
DERBY-6000: Add new CallableStatement.setObject() overloads introduced by JDBC 4.2.
git-svn-id: https://svn.apache.org/repos/asf/db/derby/code/trunk@1445327 13f79535-47bb-0310-9956-ffa450edef68
|
[] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.