You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2012/07/03 15:57:59 UTC
svn commit: r1356735 - in
/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility:
JDBCDriverTest.java VersionCombinationConfigurator.java
VersionedNetworkServerTestSetup.java _Suite.java
Author: rhillegas
Date: Tue Jul 3 13:57:58 2012
New Revision: 1356735
URL: http://svn.apache.org/viewvc?rev=1356735&view=rev
Log:
DERBY-5840: Silence compiler warnings in the compatibility tests.
Modified:
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionCombinationConfigurator.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionedNetworkServerTestSetup.java
db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java?rev=1356735&r1=1356734&r2=1356735&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/JDBCDriverTest.java Tue Jul 3 13:57:58 2012
@@ -219,10 +219,10 @@ public class JDBCDriverTest
/////////////////////////////////////////////////////////////
// map derby type name to type descriptor
- private static HashMap _types = new HashMap(); // maps Derby type names to TypeDescriptors
+ private static HashMap<String,TypeDescriptor> _types = new HashMap<String,TypeDescriptor>();
// map jdbc type to index into COERCIONS
- private static HashMap _coercionIndex = new HashMap(); // maps jdbc types to legal coercions
+ private static HashMap<Integer,Integer> _coercionIndex = new HashMap<Integer,Integer>();
/////////////////////////////////////////////////////////////
//
@@ -783,7 +783,7 @@ public class JDBCDriverTest
// Verify that we can select all legal datatypes in a table.
//
private void readTable(String tableName, TypeDescriptor[] types,
- Object[][] rows, List casts )
+ Object[][] rows, List<Object> casts )
throws SQLException {
PreparedStatement ps = readTableQuery(tableName, types);
ResultSet rs = ps.executeQuery();
@@ -884,7 +884,7 @@ public class JDBCDriverTest
* @throws Exception
*/
private void checkRows(PreparedStatement ps, TypeDescriptor[] types,
- Object[][] rows, List casts)
+ Object[][] rows, List<Object> casts)
throws SQLException {
int typeCount = types.length;
@@ -943,7 +943,7 @@ public class JDBCDriverTest
* @param casts
*/
private void checkCoercions(PreparedStatement ps, TypeDescriptor type,
- List casts)
+ List<Object> casts)
throws SQLException {
String columnName = type.getDerbyTypeName();
T_CN coercionDesc = COERCIONS[ getCoercionIndex(type.getJdbcType()) ];
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionCombinationConfigurator.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionCombinationConfigurator.java?rev=1356735&r1=1356734&r2=1356735&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionCombinationConfigurator.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionCombinationConfigurator.java Tue Jul 3 13:57:58 2012
@@ -269,9 +269,15 @@ public class VersionCombinationConfigura
/**
* Sorts and filters out distributions based on the configurator settings.
*
+ * We suppress warnings here because DerbyDistribution needs to
+ * implement Comparable<DerbyVersion> and not just Comparable. But DerbyDistribution
+ * lives in a package which has to compile at level 1.4 and so cannot be
+ * declared that way.
+ *
* @param distributions list of distributions to filter
* @return A filtered list of distributions.
*/
+ @SuppressWarnings("unchecked")
private List<DerbyDistribution> sortAndFilterVersions(
List<DerbyDistribution> distributions) {
// Sort the releases based on the version number (highest first).
@@ -307,7 +313,7 @@ public class VersionCombinationConfigura
*/
static URL getClassURL(final Class cl) {
return (URL)
- AccessController.doPrivileged(new PrivilegedAction() {
+ AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
if (cl.getProtectionDomain().getCodeSource() == null) {
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionedNetworkServerTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionedNetworkServerTestSetup.java?rev=1356735&r1=1356734&r2=1356735&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionedNetworkServerTestSetup.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/VersionedNetworkServerTestSetup.java Tue Jul 3 13:57:58 2012
@@ -88,7 +88,7 @@ public class VersionedNetworkServerTestS
(appendToClasspath == null
? ""
: File.pathSeparator + appendToClasspath);
- ArrayList cmd = new ArrayList();
+ ArrayList<String> cmd = new ArrayList<String>();
cmd.add("org.apache.derby.drda.NetworkServerControl");
cmd.add("start");
cmd.add("-p");
@@ -170,7 +170,7 @@ public class VersionedNetworkServerTestS
private String shutDownInSeparateProcess() {
int port = TestConfiguration.getCurrent().getPort();
// java -classpath ... org.apache.derby.drda...
- ArrayList cmd = new ArrayList();
+ ArrayList<String> cmd = new ArrayList<String>();
cmd.add("org.apache.derby.drda.NetworkServerControl");
cmd.add("shutdown");
cmd.add("-p");
Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java?rev=1356735&r1=1356734&r2=1356735&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/compatibility/_Suite.java Tue Jul 3 13:57:58 2012
@@ -85,9 +85,13 @@ public class _Suite
* <strong>NOTE</strong>: If invalid versions are found a warning is simply
* printed to the console.
*
+ * We have to suppress warnings here until DerbyVersion can be compiled
+ * at Java 5 level.
+ *
* @param versions list of Derby versions, i.e '10.8.1.2,10.7.1.1'
* @return A list of parsed Derby versions.
*/
+ @SuppressWarnings("unchecked")
private static List<DerbyVersion> parseVersionList(String versions) {
if (versions == null || versions.length() == 0) {
return Collections.EMPTY_LIST;