You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-commits@db.apache.org by mb...@apache.org on 2022/08/10 20:42:27 UTC

[db-jdo] branch tck-compiler-warnings updated: JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule

This is an automated email from the ASF dual-hosted git repository.

mbo pushed a commit to branch tck-compiler-warnings
in repository https://gitbox.apache.org/repos/asf/db-jdo.git


The following commit(s) were added to refs/heads/tck-compiler-warnings by this push:
     new 0d588b32 JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule
0d588b32 is described below

commit 0d588b32cd02d0fdec489620bd5d232cb48e25aa
Author: Michael Bouschen <Mi...@akquinet.de>
AuthorDate: Wed Aug 10 22:42:19 2022 +0200

    JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule
---
 api/src/main/java/javax/jdo/Enhancer.java          |  14 +--
 api/src/main/java/javax/jdo/FetchGroup.java        |   4 +-
 api/src/main/java/javax/jdo/FetchPlan.java         |  10 +-
 api/src/main/java/javax/jdo/JDOHelper.java         |  16 ++-
 api/src/main/java/javax/jdo/JDOQLTypedQuery.java   |   2 +-
 .../main/java/javax/jdo/PersistenceManager.java    |  36 +++----
 .../java/javax/jdo/PersistenceManagerFactory.java  |   6 +-
 api/src/main/java/javax/jdo/Query.java             |  28 ++---
 .../javax/jdo/annotations/PersistenceCapable.java  |   2 +-
 api/src/main/java/javax/jdo/annotations/Query.java |   2 +-
 .../main/java/javax/jdo/annotations/Sequence.java  |   2 +-
 .../java/javax/jdo/datastore/DataStoreCache.java   |  24 ++---
 .../main/java/javax/jdo/identity/ByteIdentity.java |  24 ++---
 .../main/java/javax/jdo/identity/CharIdentity.java |  24 ++---
 .../main/java/javax/jdo/identity/IntIdentity.java  |  24 ++---
 .../main/java/javax/jdo/identity/LongIdentity.java |  42 ++++----
 .../java/javax/jdo/identity/ObjectIdentity.java    |  45 ++++----
 .../java/javax/jdo/identity/ShortIdentity.java     |  25 ++---
 .../javax/jdo/identity/SingleFieldIdentity.java    |  10 +-
 .../java/javax/jdo/identity/StringIdentity.java    |  20 ++--
 .../main/java/javax/jdo/metadata/JDOMetadata.java  |   4 +-
 .../java/javax/jdo/metadata/PackageMetadata.java   |   4 +-
 .../main/java/javax/jdo/query/EnumExpression.java  |   4 +-
 api/src/main/java/javax/jdo/query/Expression.java  |  10 +-
 .../javax/jdo/query/PersistableExpression.java     |   4 +-
 .../java/javax/jdo/query/StringExpression.java     |   2 +-
 api/src/main/java/javax/jdo/spi/I18NHelper.java    |   8 +-
 api/src/main/java/javax/jdo/spi/JDOImplHelper.java | 116 ++++++++++-----------
 .../test/java/javax/jdo/AbstractJDOConfigTest.java |   8 +-
 api/src/test/java/javax/jdo/EnhancerTest.java      |   2 +-
 .../test/java/javax/jdo/JDOHelperConfigTest.java   |  20 ++--
 api/src/test/java/javax/jdo/JDOHelperTest.java     |  12 +--
 api/src/test/java/javax/jdo/MockEnhancer.java      |   8 +-
 api/src/test/java/javax/jdo/ObjectStateTest.java   |   4 +-
 api/src/test/java/javax/jdo/PMFService.java        |   6 +-
 .../javax/jdo/identity/ConcreteTestIdentity.java   |   2 +-
 api/src/test/java/javax/jdo/pc/PCPoint.java        |   6 +-
 .../test/java/javax/jdo/spi/JDOImplHelperTest.java |  10 +-
 api/src/test/java/javax/jdo/stub/StubPMF.java      |  20 ++--
 .../test/java/javax/jdo/util/BatchTestRunner.java  |  10 +-
 api/src/test/java/javax/jdo/util/XMLTestUtil.java  |  10 +-
 tck/src/main/resources/conf/jdo-signatures.txt     |  21 ++--
 42 files changed, 301 insertions(+), 350 deletions(-)

diff --git a/api/src/main/java/javax/jdo/Enhancer.java b/api/src/main/java/javax/jdo/Enhancer.java
index 4b8d2292..d1edb1f1 100644
--- a/api/src/main/java/javax/jdo/Enhancer.java
+++ b/api/src/main/java/javax/jdo/Enhancer.java
@@ -88,7 +88,7 @@ public class Enhancer {
     private boolean printAndExit = false;
 
     /** Persistence Units */
-    private List<String> persistenceUnitNames = new ArrayList<String>();
+    private List<String> persistenceUnitNames = new ArrayList<>();
     /** Target Directory Parameter */
     private String directoryName = null;
     /** ClassLoader for JDOEnhancer */
@@ -106,13 +106,13 @@ public class Enhancer {
     /** Verbose messages are always collected but only output if verbose flag is set */
     private StringBuilder verboseBuffer = new StringBuilder();
     /** File Names */
-    private List<String> fileNames = new ArrayList<String>();
+    private List<String> fileNames = new ArrayList<>();
     /** Class File Names */
-    private List<String> classFileNames = new ArrayList<String>();
+    private List<String> classFileNames = new ArrayList<>();
     /** JDO File Names */
-    private List<String> jdoFileNames = new ArrayList<String>();
+    private List<String> jdoFileNames = new ArrayList<>();
     /** Jar File Names */
-    private List<String> jarFileNames = new ArrayList<String>();
+    private List<String> jarFileNames = new ArrayList<>();
     /** The number of classes validated by the JDOEnhancer */
     private int numberOfValidatedClasses = 0;
     /** The number of classes enhanced by the JDOEnhancer */
@@ -227,7 +227,7 @@ public class Enhancer {
      */
     private void parseArgs(String[] args) {
         boolean doneWithOptions = false;
-        fileNames = new ArrayList<String>();
+        fileNames = new ArrayList<>();
         for (int i = 0; i < args.length; ++i) {
             String arg = args[i];
             // if first argument is ? then simply print usage and return.
@@ -364,7 +364,7 @@ public class Enhancer {
         // separate classPath using system class path separator
         String separator = System.getProperty("path.separator");
         String[] paths = classPath.split(separator);
-        List<URL> urls = new ArrayList<URL>();
+        List<URL> urls = new ArrayList<>();
         for (String path: paths) {
             // for each path construct a URL from the File
             File file = new File(path);
diff --git a/api/src/main/java/javax/jdo/FetchGroup.java b/api/src/main/java/javax/jdo/FetchGroup.java
index 16f546ce..14506b84 100644
--- a/api/src/main/java/javax/jdo/FetchGroup.java
+++ b/api/src/main/java/javax/jdo/FetchGroup.java
@@ -140,7 +140,7 @@ public interface FetchGroup {
      * @return the persistent type
      * @since 2.2
      */
-    Class getType();
+    Class<?> getType();
 
     /** 
      * Get the post-load property of this FetchGroup.
@@ -260,7 +260,7 @@ public interface FetchGroup {
      * in the FetchGroup
      * @since 2.2
      */
-    Set getMembers();
+    Set<String> getMembers();
 
     /**
      * Make this FetchGroup unmodifiable. If already unmodifiable, this method
diff --git a/api/src/main/java/javax/jdo/FetchPlan.java b/api/src/main/java/javax/jdo/FetchPlan.java
index b480a638..df6fdcd4 100644
--- a/api/src/main/java/javax/jdo/FetchPlan.java
+++ b/api/src/main/java/javax/jdo/FetchPlan.java
@@ -118,7 +118,7 @@ public interface FetchPlan {
      * of all currently active fetch groups
      * @since 2.0
      */
-    Set getGroups();
+    Set<String> getGroups();
 
     /** 
      * Set a collection of groups.
@@ -126,7 +126,7 @@ public interface FetchPlan {
      * @return the FetchPlan
      * @since 2.0
      */
-    FetchPlan setGroups(Collection fetchGroupNames);
+    FetchPlan setGroups(Collection<String> fetchGroupNames);
 
     /** 
      * Set a collection of groups.
@@ -169,7 +169,7 @@ public interface FetchPlan {
      * @return This FetchPlan
      * @since 2.0
      */
-    FetchPlan setDetachmentRoots(Collection roots);
+    FetchPlan setDetachmentRoots(Collection<?> roots);
 
     /**
      * Get the roots for DetachAllOnCommit.
@@ -184,14 +184,14 @@ public interface FetchPlan {
      * @return This FetchPlan
      * @since 2.0
      */
-    FetchPlan setDetachmentRootClasses(Class... rootClasses);
+    FetchPlan setDetachmentRootClasses(Class<?>... rootClasses);
 
     /**
      * Get the root classes for DetachAllOnCommit.
      * @return The detachment root classes
      * @since 2.0
      */
-    Class[] getDetachmentRootClasses();
+    Class<?>[] getDetachmentRootClasses();
 
     /**
      * Set the fetch size for large result set support. Use
diff --git a/api/src/main/java/javax/jdo/JDOHelper.java b/api/src/main/java/javax/jdo/JDOHelper.java
index aa465064..cb5f6324 100644
--- a/api/src/main/java/javax/jdo/JDOHelper.java
+++ b/api/src/main/java/javax/jdo/JDOHelper.java
@@ -103,7 +103,7 @@ public class JDOHelper implements Constants {
      * properties.
      */
     static Map<String, String> createAttributePropertyXref() {
-        Map<String, String> xref = new HashMap<String,String>();
+        Map<String, String> xref = new HashMap<>();
 
         xref.put(
             PMF_ATTRIBUTE_CLASS,
@@ -398,7 +398,7 @@ public class JDOHelper implements Constants {
      * @since 2.0
      */
     public static Collection<Object> getObjectIds(Collection<?> pcs) {
-        ArrayList<Object> result = new ArrayList<Object>();
+        ArrayList<Object> result = new ArrayList<>();
         for (Iterator<?> it = pcs.iterator(); it.hasNext();) {
             result.add(getObjectId(it.next()));
         }
@@ -796,7 +796,7 @@ public class JDOHelper implements Constants {
     protected static PersistenceManagerFactory getPersistenceManagerFactory
             (Map<?, ?> overrides, Map<?, ?> props, ClassLoader pmfClassLoader) {
         
-        List<Throwable> exceptions = new ArrayList<Throwable>();
+        List<Throwable> exceptions = new ArrayList<>();
         if (pmfClassLoader == null)
             throw new JDOFatalUserException (msg.msg (
                 "EXC_GetPMFNullLoader")); //NOI18N
@@ -1278,8 +1278,7 @@ public class JDOHelper implements Constants {
             ClassLoader resourceLoader,
             String jdoconfigResourceName) {
         // key is PU name, value is Map of PU properties
-        Map<String,Map<Object,Object>> propertiesByNameInAllConfigs
-                = new HashMap<String,Map<Object,Object>>();
+        Map<String,Map<Object,Object>> propertiesByNameInAllConfigs = new HashMap<>();
         try {
             URL firstFoundConfigURL = null;
 
@@ -1288,7 +1287,7 @@ public class JDOHelper implements Constants {
                 getResources(resourceLoader, jdoconfigResourceName);
 
             if (resources.hasMoreElements()) {
-                ArrayList<URL> processedResources = new ArrayList<URL>();
+                ArrayList<URL> processedResources = new ArrayList<>();
 
                 // get ready to parse XML
                 DocumentBuilderFactory factory = getDocumentBuilderFactory();
@@ -1412,8 +1411,7 @@ public class JDOHelper implements Constants {
             ? ""
             : requestedPMFName.trim();
 
-        Map<String,Map<Object,Object>>
-                propertiesByName = new HashMap<String,Map<Object,Object>>();
+        Map<String,Map<Object,Object>> propertiesByName = new HashMap<>();
         InputStream in = null;
         try {
             DocumentBuilder builder = factory.newDocumentBuilder();
@@ -1877,7 +1875,7 @@ public class JDOHelper implements Constants {
      * the invocation returns an instance.
      * Otherwise add the exception thrown to an exception list.
      */
-        ArrayList<Throwable> exceptions = new ArrayList<Throwable>();
+        ArrayList<Throwable> exceptions = new ArrayList<>();
         int numberOfJDOEnhancers = 0;
         try {
             Enumeration<URL> urls = getResources(loader, SERVICE_LOOKUP_ENHANCER_RESOURCE_NAME);
diff --git a/api/src/main/java/javax/jdo/JDOQLTypedQuery.java b/api/src/main/java/javax/jdo/JDOQLTypedQuery.java
index 65fbc7b4..38085432 100644
--- a/api/src/main/java/javax/jdo/JDOQLTypedQuery.java
+++ b/api/src/main/java/javax/jdo/JDOQLTypedQuery.java
@@ -532,7 +532,7 @@ public interface JDOQLTypedQuery<T> extends Serializable, Closeable {
      * @param values The extension map of keys and values
      * @return This query
      */
-    JDOQLTypedQuery<T> extensions(Map values);
+    JDOQLTypedQuery<T> extensions(Map<String, Object> values);
 
     /**
      * Save the query, as it is currently defined, as a named query under the specified name.
diff --git a/api/src/main/java/javax/jdo/PersistenceManager.java b/api/src/main/java/javax/jdo/PersistenceManager.java
index 4b53855b..653cb0dc 100644
--- a/api/src/main/java/javax/jdo/PersistenceManager.java
+++ b/api/src/main/java/javax/jdo/PersistenceManager.java
@@ -99,14 +99,14 @@ public interface PersistenceManager extends AutoCloseable {
      * @param pcs the <code>Collection</code> of instances to evict from the 
      * cache.
      */
-    void evictAll (Collection pcs);
+    void evictAll (Collection<?> pcs);
 
     /** Mark the parameter instances as no longer needed in the cache.
      * @param pcClass the class of instances to evict
      * @param subclasses if true, mark instances of subclasses also
      * @since 2.1
      */
-    void evictAll (boolean subclasses, Class pcClass);
+    void evictAll (boolean subclasses, Class<?> pcClass);
 
     /** Mark all persistent-nontransactional instances as no longer needed 
      * in the cache.  It transitions
@@ -141,7 +141,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @see #refresh(Object pc)
      * @param pcs the <code>Collection</code> of instances to refresh.
      */
-    void refreshAll (Collection pcs);
+    void refreshAll (Collection<?> pcs);
     
     /** Refresh the state of all applicable instances from the data store.
      * <P>If called with an active transaction, all transactional instances
@@ -446,7 +446,7 @@ public interface PersistenceManager extends AutoCloseable {
      * of toString() on the object id instance.
      * @return an instance of the object identity class
      */
-    Object newObjectIdInstance (Class pcClass, Object key);
+    Object newObjectIdInstance (Class<?> pcClass, Object key);
     
     /**
      * Return the objects with the given oids.
@@ -458,7 +458,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @see #getObjectById(Object,boolean)
      * @since 2.0
      */
-    Collection getObjectsById (Collection oids, boolean validate);
+    Collection getObjectsById (Collection<?> oids, boolean validate);
 
     /**
      * Return the objects with the given oids. This method is equivalent 
@@ -470,7 +470,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @see #getObjectsById(Collection,boolean)
      * @since 2.0
      */
-    Collection getObjectsById (Collection oids);
+    Collection getObjectsById (Collection<?> oids);
 
     /**
      * Return the objects with the given oids.
@@ -601,7 +601,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @param pcs a <code>Collection</code> of persistent instances
      * @see #deletePersistent(Object pc)
      */
-    void deletePersistentAll (Collection pcs);
+    void deletePersistentAll (Collection<?> pcs);
     
     /** Make an instance transient, removing it from management by this
      * <code>PersistenceManager</code>.
@@ -631,7 +631,7 @@ public interface PersistenceManager extends AutoCloseable {
      * is preserved unchanged.
      * @param pcs the instances to make transient.
      */ 
-    void makeTransientAll (Collection pcs);
+    void makeTransientAll (Collection<?> pcs);
 
     /** Make an instance transient, removing it from management by this 
      * <code>PersistenceManager</code>. If the useFetchPlan parameter is 
@@ -696,7 +696,7 @@ public interface PersistenceManager extends AutoCloseable {
      * which fields to load and which instances to make transient
      * @since 2.0
      */
-    void makeTransientAll (Collection pcs, boolean useFetchPlan);
+    void makeTransientAll (Collection<?> pcs, boolean useFetchPlan);
 
     /** Make an instance subject to transactional boundaries.
      *
@@ -727,7 +727,7 @@ public interface PersistenceManager extends AutoCloseable {
      * transactional.
      * @see #makeTransactional(Object pc)
      */
-    void makeTransactionalAll (Collection pcs);
+    void makeTransactionalAll (Collection<?> pcs);
     
     /** Make an instance non-transactional after commit.
      *
@@ -754,7 +754,7 @@ public interface PersistenceManager extends AutoCloseable {
      * nontransactional.
      * @see #makeNontransactional(Object pc)
      */
-    void makeNontransactionalAll (Collection pcs);
+    void makeNontransactionalAll (Collection<?> pcs);
 
     /** Retrieve field values of an instance from the store.  This tells
      * the <code>PersistenceManager</code> that the application intends to use 
@@ -791,7 +791,7 @@ public interface PersistenceManager extends AutoCloseable {
      * the class to retrieve associated instances.
      * @param pcs the instances
      */
-    void retrieveAll (Collection pcs);
+    void retrieveAll (Collection<?> pcs);
     
     /** Retrieve field values of instances from the store.  This tells
      * the <code>PersistenceManager</code> that the application intends to use 
@@ -812,7 +812,7 @@ public interface PersistenceManager extends AutoCloseable {
      * which fields to load and which instances to retrieve.
      * @since 1.0.1
      */
-    void retrieveAll (Collection pcs, boolean useFetchPlan);
+    void retrieveAll (Collection<?> pcs, boolean useFetchPlan);
     
     /** Retrieve field values of instances from the store.  This tells
      * the <code>PersistenceManager</code> that the application intends to use 
@@ -882,7 +882,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @return the <code>Class</code> of the ObjectId of the parameter
      * @see #getObjectById
      */
-    Class getObjectIdClass(Class cls);
+    Class<?> getObjectIdClass(Class<?> cls);
   
     /** Set the Multithreaded flag for this <code>PersistenceManager</code>.  
      * Applications that use multiple threads to invoke methods or access fields 
@@ -1215,7 +1215,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @since 2.0
      */
     void addInstanceLifecycleListener (InstanceLifecycleListener listener,
-        Class... classes);
+        Class<?>... classes);
 
     /**
      * Removes the listener instance from the list of lifecycle event listeners.
@@ -1259,7 +1259,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @return the objects
      * @since 2.1
      */
-    Set getManagedObjects(Class... classes);
+    Set getManagedObjects(Class<?>... classes);
 
     /**
      * Get the objects managed by this persistence manager having the
@@ -1269,7 +1269,7 @@ public interface PersistenceManager extends AutoCloseable {
      * @return the objects
      * @since 2.1
      */
-    Set getManagedObjects(EnumSet<ObjectState> states, Class... classes);
+    Set getManagedObjects(EnumSet<ObjectState> states, Class<?>... classes);
 
     /**
      * Get a modifiable <code>FetchGroup</code> for the Class and name.
@@ -1291,7 +1291,7 @@ public interface PersistenceManager extends AutoCloseable {
      * class or interface
      * @since 2.2
      */
-    FetchGroup getFetchGroup(Class cls, String name);
+    FetchGroup getFetchGroup(Class<?> cls, String name);
 
     /**
      * Set a persistence manager property. This can be a standard property
diff --git a/api/src/main/java/javax/jdo/PersistenceManagerFactory.java b/api/src/main/java/javax/jdo/PersistenceManagerFactory.java
index 410d14a5..7524c3fd 100644
--- a/api/src/main/java/javax/jdo/PersistenceManagerFactory.java
+++ b/api/src/main/java/javax/jdo/PersistenceManagerFactory.java
@@ -657,7 +657,7 @@ public interface PersistenceManagerFactory extends Serializable {
      * @since 2.0
      */
     void addInstanceLifecycleListener (InstanceLifecycleListener listener,
-        Class[] classes);
+        Class<?>[] classes);
 
     /**
      * Remove the parameter listener instance from the list of
@@ -738,7 +738,7 @@ public interface PersistenceManagerFactory extends Serializable {
      * class or interface
      * @since 2.2
      */
-    FetchGroup getFetchGroup(Class cls, String name);
+    FetchGroup getFetchGroup(Class<?> cls, String name);
 
     /**
      * Get a modifiable Set containing a mutable copy of all currently active
@@ -751,7 +751,7 @@ public interface PersistenceManagerFactory extends Serializable {
      * {@link JDOPermission} ("getMetadata")
      * @since 2.2
      */
-    Set getFetchGroups();
+    Set<FetchGroup> getFetchGroups();
 
     /**
      * Method to register metadata with the persistence process managed by this
diff --git a/api/src/main/java/javax/jdo/Query.java b/api/src/main/java/javax/jdo/Query.java
index af52d392..c66784f1 100644
--- a/api/src/main/java/javax/jdo/Query.java
+++ b/api/src/main/java/javax/jdo/Query.java
@@ -318,7 +318,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @see #executeWithArray(Object[] parameters)
      * @param parameters the <code>Map</code> containing all of the parameters.
      */
-    Object executeWithMap (Map parameters);
+    Object executeWithMap (Map<String, ?> parameters);
     
     /** Execute the query and return the filtered <code>Collection</code>.
      *
@@ -468,7 +468,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param cls the result class
      * @since 2.0
      */
-    void setResultClass(Class cls);
+    void setResultClass(Class<?> cls);
 
     /**
      * Set the range of results to return. The execution of the query is
@@ -524,7 +524,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @see #addExtension
      * @since 2.0
      */
-    void setExtensions(Map extensions);
+    void setExtensions(Map<?, ?> extensions);
 
     /**
      * Returns the <code>FetchPlan</code> used by this
@@ -554,7 +554,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @return the number of instances of the candidate class that were deleted
      * @since 2.0
      */
-    long deletePersistentAll(Map parameters);
+    long deletePersistentAll(Map<?, ?> parameters);
 
     /**
      * Deletes all the instances of the candidate class that pass the
@@ -610,7 +610,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      *    String candidateCollectionExpression, String... parameters)
      * @since 2.1
      */
-    void addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression);
+    void addSubquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression);
 
     /**
      * Add a subquery to this query.
@@ -628,7 +628,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      *    String candidateCollectionExpression, String... parameters)
      * @since 2.1
      */
-    void addSubquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String parameter);
+    void addSubquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression, String parameter);
 
     /**
      * Add a subquery to this query.
@@ -669,7 +669,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * the parameters in the subquery
      * @since 2.1
      */
-    void addSubquery(Query sub, String variableDeclaration, 
+    void addSubquery(Query<?> sub, String variableDeclaration,
          String candidateCollectionExpression, String... parameters);
 
     /**
@@ -691,8 +691,8 @@ public interface Query<T> extends AutoCloseable, Serializable {
      *    String candidateCollectionExpression, String... parameters)
      * @since 2.1
      */
-    void addSubquery(Query sub, String variableDeclaration, 
-         String candidateCollectionExpression, Map parameters);
+    void addSubquery(Query<?> sub, String variableDeclaration,
+         String candidateCollectionExpression, Map<?, ?> parameters);
 
     /**
      * Specify a timeout interval (milliseconds) for any read operations
@@ -860,7 +860,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param candidateCollectionExpression the candidate collection of the subquery as an expression using terms of the outer query
      * @return This query
      */
-    Query<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression);
+    Query<T> subquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression);
 
     /**
      * Add a subquery to this query.
@@ -871,7 +871,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param parameter the expression from the outer query to bind the parameter in the subquery
      * @return This query
      */
-    Query<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String parameter);
+    Query<T> subquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression, String parameter);
 
     /**
      * Add a subquery to this query.
@@ -882,7 +882,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param parameters the expressions from the outer query to bind the parameters in the subquery
      * @return This query
      */
-    Query<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, String... parameters);
+    Query<T> subquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression, String... parameters);
 
     /**
      * Add a subquery to this query.
@@ -893,7 +893,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param parameters the expressions from the outer query to bind the parameter in the subquery
      * @return This query
      */
-    Query<T> subquery(Query sub, String variableDeclaration, String candidateCollectionExpression, Map parameters);
+    Query<T> subquery(Query<?> sub, String variableDeclaration, String candidateCollectionExpression, Map<?, ?> parameters);
 
     /**
      * Set the import statements to be used to identify the fully qualified name of variables or parameters. 
@@ -973,7 +973,7 @@ public interface Query<T> extends AutoCloseable, Serializable {
      * @param values The extension map of keys and values
      * @return This query
      */
-    Query<T> extensions(Map values);
+    Query<T> extensions(Map<?, ?> values);
 
     /**
      * Method to set the named parameters on this query prior to execution.
diff --git a/api/src/main/java/javax/jdo/annotations/PersistenceCapable.java b/api/src/main/java/javax/jdo/annotations/PersistenceCapable.java
index 3cdf7e7d..c41d6626 100644
--- a/api/src/main/java/javax/jdo/annotations/PersistenceCapable.java
+++ b/api/src/main/java/javax/jdo/annotations/PersistenceCapable.java
@@ -84,7 +84,7 @@ public @interface PersistenceCapable
      * Primary key class when using application identity and using own PK. 
      * @return Object-id class (if specified)
      */
-    Class objectIdClass() default void.class;
+    Class<?> objectIdClass() default void.class;
 
     /**
      * Whether this class is cacheable in a Level2 cache.
diff --git a/api/src/main/java/javax/jdo/annotations/Query.java b/api/src/main/java/javax/jdo/annotations/Query.java
index 27f4af16..a2e11724 100644
--- a/api/src/main/java/javax/jdo/annotations/Query.java
+++ b/api/src/main/java/javax/jdo/annotations/Query.java
@@ -62,7 +62,7 @@ public @interface Query
     /** Result class into which to put the results.
      * @return the class of the result
      */
-    Class resultClass() default void.class;
+    Class<?> resultClass() default void.class;
 
     /** The name of the fetch plan used by this query
      * @return the fetch plan
diff --git a/api/src/main/java/javax/jdo/annotations/Sequence.java b/api/src/main/java/javax/jdo/annotations/Sequence.java
index c706e61d..86befa3d 100644
--- a/api/src/main/java/javax/jdo/annotations/Sequence.java
+++ b/api/src/main/java/javax/jdo/annotations/Sequence.java
@@ -50,7 +50,7 @@ public @interface Sequence
     /** Name of a factory class for generating the sequence values. 
      * @return the name of the factory class for the sequence
      */
-    Class factoryClass() default void.class;
+    Class<?> factoryClass() default void.class;
 
     /** Vendor extensions for this sequence. 
      * @return vendor extensions
diff --git a/api/src/main/java/javax/jdo/datastore/DataStoreCache.java b/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
index d901174e..e95f008b 100644
--- a/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
+++ b/api/src/main/java/javax/jdo/datastore/DataStoreCache.java
@@ -55,14 +55,14 @@ public interface DataStoreCache {
      * @param oids the object ids of the instance to evict.
      * @since 2.0
      */
-    void evictAll (Collection oids);
+    void evictAll (Collection<?> oids);
 
     /** Evict the parameter instances from the second-level cache.
      * @param pcClass the class of instances to evict
      * @param subclasses if true, evict instances of subclasses also
      * @since 2.1
      */
-    void evictAll (boolean subclasses, Class pcClass);
+    void evictAll (boolean subclasses, Class<?> pcClass);
 
     /** Pin the parameter instance in the second-level cache.
      * @param oid the object id of the instance to pin.
@@ -74,7 +74,7 @@ public interface DataStoreCache {
      * @param oids the object ids of the instances to pin.
      * @since 2.0
      */
-    void pinAll (Collection oids);
+    void pinAll (Collection<?> oids);
 
     /** Pin the parameter instances in the second-level cache.
      * @param oids the object ids of the instances to pin.
@@ -87,7 +87,7 @@ public interface DataStoreCache {
      * @param subclasses if true, pin instances of subclasses also
      * @since 2.1
      */
-    void pinAll (boolean subclasses, Class pcClass);
+    void pinAll (boolean subclasses, Class<?> pcClass);
 
     /** Unpin the parameter instance from the second-level cache.
      * @param oid the object id of the instance to unpin.
@@ -99,7 +99,7 @@ public interface DataStoreCache {
      * @param oids the object ids of the instance to evict.
      * @since 2.0
      */
-    void unpinAll(Collection oids);
+    void unpinAll(Collection<?> oids);
 
     /** Unpin the parameter instance from the second-level cache.
      * @param oids the object id of the instance to evict.
@@ -112,7 +112,7 @@ public interface DataStoreCache {
      * @param subclasses if true, unpin instances of subclasses also
      * @since 2.1
      */
-    void unpinAll(boolean subclasses, Class pcClass);
+    void unpinAll(boolean subclasses, Class<?> pcClass);
     
     /** 
      * This class is an empty implementation of the DataStoreCache 
@@ -134,10 +134,10 @@ public interface DataStoreCache {
         public void evictAll(Object... oids) {
         }
 
-        public void evictAll(Collection oids) {
+        public void evictAll(Collection<?> oids) {
         }
 
-        public void evictAll(boolean subclasses, Class pcClass) {
+        public void evictAll(boolean subclasses, Class<?> pcClass) {
         }
 
         public void pin(Object oid) {
@@ -146,10 +146,10 @@ public interface DataStoreCache {
         public void pinAll(Object... oids) {
         }
 
-        public void pinAll(Collection oids) {
+        public void pinAll(Collection<?> oids) {
         }
 
-        public void pinAll(boolean subclasses, Class pcClass) {
+        public void pinAll(boolean subclasses, Class<?> pcClass) {
         }
 
         public void unpin(Object oid) {
@@ -158,10 +158,10 @@ public interface DataStoreCache {
         public void unpinAll(Object... oids) {
         }
 
-        public void unpinAll(Collection oids) {
+        public void unpinAll(Collection<?> oids) {
         }
 
-        public void unpinAll(boolean subclasses, Class pcClass) {
+        public void unpinAll(boolean subclasses, Class<?> pcClass) {
         }
     }
 }
diff --git a/api/src/main/java/javax/jdo/identity/ByteIdentity.java b/api/src/main/java/javax/jdo/identity/ByteIdentity.java
index 171cf364..53c9d224 100644
--- a/api/src/main/java/javax/jdo/identity/ByteIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/ByteIdentity.java
@@ -29,7 +29,7 @@ import java.io.ObjectOutput;
 /** This class is for identity with a single byte field.
  * @version 2.0
  */
-public class ByteIdentity extends SingleFieldIdentity {
+public class ByteIdentity extends SingleFieldIdentity<ByteIdentity> {
     
     /** The key.
      */
@@ -46,7 +46,7 @@ public class ByteIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param key the key
      */
-    public ByteIdentity(Class pcClass, byte key) {
+    public ByteIdentity(Class<?> pcClass, byte key) {
         super(pcClass);
         construct(key);
     }
@@ -55,7 +55,7 @@ public class ByteIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param key the key
      */
-    public ByteIdentity(Class pcClass, Byte key) {
+    public ByteIdentity(Class<?> pcClass, Byte key) {
         super(pcClass);
         setKeyAsObject(key);
         construct(key.byteValue());
@@ -65,7 +65,7 @@ public class ByteIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param str the key
      */
-    public ByteIdentity(Class pcClass, String str) {
+    public ByteIdentity(Class<?> pcClass, String str) {
         super(pcClass);
         assertKeyNotNull(str);
         construct(Byte.parseByte(str));
@@ -110,20 +110,12 @@ public class ByteIdentity extends SingleFieldIdentity {
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof ByteIdentity) {
-        	ByteIdentity other = (ByteIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                return (key - other.key);
-            } else {
-                return result;
-            }
-        }
-        else if (o == null) {
+    public int compareTo(ByteIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
+        int result = super.compare(o);
+        return (result == 0) ? (key - o.key) : result;
     }
 
     /** Create the key as an Object.
diff --git a/api/src/main/java/javax/jdo/identity/CharIdentity.java b/api/src/main/java/javax/jdo/identity/CharIdentity.java
index 489d2c91..31d7a82a 100644
--- a/api/src/main/java/javax/jdo/identity/CharIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/CharIdentity.java
@@ -31,7 +31,7 @@ import javax.jdo.spi.I18NHelper;
 /** This class is for identity with a single character field.
  * @version 2.0
  */
-public class CharIdentity extends SingleFieldIdentity {
+public class CharIdentity extends SingleFieldIdentity<CharIdentity> {
 
     /** The Internationalization message helper.
      */
@@ -50,7 +50,7 @@ public class CharIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param key the key
      */
-    public CharIdentity (Class pcClass, char key) {
+    public CharIdentity (Class<?> pcClass, char key) {
         super (pcClass);
         construct(key);
     }
@@ -59,7 +59,7 @@ public class CharIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param key the key
      */
-    public CharIdentity (Class pcClass, Character key) {
+    public CharIdentity (Class<?> pcClass, Character key) {
         super (pcClass);
         setKeyAsObject(key);
         construct(key.charValue());
@@ -70,7 +70,7 @@ public class CharIdentity extends SingleFieldIdentity {
      * @param pcClass the target class
      * @param str the key
      */
-    public CharIdentity (Class pcClass, String str) {
+    public CharIdentity (Class<?> pcClass, String str) {
         super(pcClass);
         assertKeyNotNull(str);
         if (str.length() != 1) 
@@ -118,20 +118,12 @@ public class CharIdentity extends SingleFieldIdentity {
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof CharIdentity) {
-        	CharIdentity other = (CharIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                return (key - other.key);
-            } else {
-                return result;
-            }
-        }
-        else if (o == null) {
+    public int compareTo(CharIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
+        int result = super.compare(o);
+        return (result == 0) ? (key - o.key) : result;
     }
 
     /** Create the key as an Object.
diff --git a/api/src/main/java/javax/jdo/identity/IntIdentity.java b/api/src/main/java/javax/jdo/identity/IntIdentity.java
index ccb67bed..cdeb9914 100644
--- a/api/src/main/java/javax/jdo/identity/IntIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/IntIdentity.java
@@ -29,7 +29,7 @@ import java.io.ObjectOutput;
 /** This class is for identity with a single int field.
  * @version 2.0
  */
-public class IntIdentity extends SingleFieldIdentity {
+public class IntIdentity extends SingleFieldIdentity<IntIdentity> {
 
     private int key;
 
@@ -42,7 +42,7 @@ public class IntIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param key the key
      */
-    public IntIdentity (Class pcClass, int key) {
+    public IntIdentity (Class<?> pcClass, int key) {
         super(pcClass);
         construct(key);
 	}
@@ -51,7 +51,7 @@ public class IntIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param key the key
      */
-    public IntIdentity (Class pcClass, Integer key) {
+    public IntIdentity (Class<?> pcClass, Integer key) {
         super(pcClass);
         setKeyAsObject(key);
         construct(key.intValue ());
@@ -62,7 +62,7 @@ public class IntIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param str the key
      */
-    public IntIdentity (Class pcClass, String str) {
+    public IntIdentity (Class<?> pcClass, String str) {
         super(pcClass);
         assertKeyNotNull(str);
         construct(Integer.parseInt(str));
@@ -107,20 +107,12 @@ public class IntIdentity extends SingleFieldIdentity {
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof IntIdentity) {
-        	IntIdentity other = (IntIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                return (key - other.key);
-            } else {
-                return result;
-            }
-        }
-       else if (o == null) {
+    public int compareTo(IntIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
+        int result = super.compare(o);
+        return (result == 0) ? (key - o.key) : result;
     }
 
     /** Create the key as an Object.
diff --git a/api/src/main/java/javax/jdo/identity/LongIdentity.java b/api/src/main/java/javax/jdo/identity/LongIdentity.java
index 1ddbbc65..f3d6faab 100644
--- a/api/src/main/java/javax/jdo/identity/LongIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/LongIdentity.java
@@ -29,7 +29,7 @@ import java.io.ObjectOutput;
 /** This class is for identity with a single long field.
  * @version 2.0
  */
-public class LongIdentity extends SingleFieldIdentity {
+public class LongIdentity extends SingleFieldIdentity<LongIdentity> {
 	
     /** The key.
      */
@@ -44,7 +44,7 @@ public class LongIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param key the key
      */
-    public LongIdentity (Class pcClass, long key) {
+    public LongIdentity (Class<?> pcClass, long key) {
         super (pcClass);
         construct(key);
     }
@@ -53,7 +53,7 @@ public class LongIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param key the key
      */
-    public LongIdentity (Class pcClass, Long key) {
+    public LongIdentity (Class<?> pcClass, Long key) {
         super(pcClass);
         setKeyAsObject(key);
         construct(key.longValue());
@@ -63,7 +63,7 @@ public class LongIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param str the key
      */
-    public LongIdentity (Class pcClass, String str) {
+    public LongIdentity (Class<?> pcClass, String str) {
         super(pcClass);
         assertKeyNotNull(str);
         construct(Long.parseLong(str));
@@ -108,29 +108,25 @@ public class LongIdentity extends SingleFieldIdentity {
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof LongIdentity) {
-        	LongIdentity other = (LongIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                long diff = key - other.key;
-                if (diff == 0) {
-                    return 0;
+    public int compareTo(LongIdentity o) {
+        if (o == null) {
+            throw new ClassCastException("object is null");
+        }
+        int result = super.compare(o);
+        if (result == 0) {
+            long diff = key - o.key;
+            if (diff == 0) {
+                return 0;
+            } else {
+                if (diff < 0) {
+                    return -1;
                 } else {
-                    if (diff < 0) {
-                        return -1;
-                    } else {
-                        return 1;
-                    }
+                    return 1;
                 }
-            } else {
-                return result;
             }
+        } else {
+            return result;
         }
-        else if (o == null) {
-            throw new ClassCastException("object is null");
-        }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
     }
 
     /** Create the key as an Object.
diff --git a/api/src/main/java/javax/jdo/identity/ObjectIdentity.java b/api/src/main/java/javax/jdo/identity/ObjectIdentity.java
index 751d2200..0c90a420 100644
--- a/api/src/main/java/javax/jdo/identity/ObjectIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/ObjectIdentity.java
@@ -38,7 +38,7 @@ import javax.jdo.spi.JDOImplHelper;
 /** This class is for identity with a single Object type field.
  * @version 2.0
  */
-public class ObjectIdentity extends SingleFieldIdentity {
+public class ObjectIdentity extends SingleFieldIdentity<ObjectIdentity> {
     
     /** The key is stored in the superclass field keyAsObject.
      */
@@ -75,7 +75,7 @@ public class ObjectIdentity extends SingleFieldIdentity {
      * @param param the key
      */
     @SuppressWarnings("static-access")
-    public ObjectIdentity (Class pcClass, Object param) {
+    public ObjectIdentity (Class<?> pcClass, Object param) {
         super (pcClass);
         assertKeyNotNull(param);
         String paramString = null;
@@ -165,31 +165,26 @@ public class ObjectIdentity extends SingleFieldIdentity {
      * @since 2.2
      */
     @SuppressWarnings("unchecked")
-    public int compareTo(Object o) {
-        if (o instanceof ObjectIdentity) {
-        	ObjectIdentity other = (ObjectIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                if (other.keyAsObject instanceof Comparable && 
-                        keyAsObject instanceof Comparable) {
-                    return ((Comparable)keyAsObject).compareTo(
-                            (Comparable)other.keyAsObject);
-                }
-                else
-                {
-                    throw new ClassCastException("The key class (" + 
-                            keyAsObject.getClass().getName() + 
-                            ") does not implement Comparable");
-                }
-            } else {
-                return result;
-            }
-        }
-        else if (o == null) {
+    public int compareTo(ObjectIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + 
-                " != " + o.getClass().getName());
+        int result = super.compare(o);
+        if (result == 0) {
+            if (o.keyAsObject instanceof Comparable &&
+                    keyAsObject instanceof Comparable) {
+                return ((Comparable<Object>)keyAsObject).compareTo(
+                        o.keyAsObject);
+            }
+            else
+            {
+                throw new ClassCastException("The key class (" +
+                        keyAsObject.getClass().getName() +
+                        ") does not implement Comparable");
+            }
+        } else {
+            return result;
+        }
     }
 
     /** Write this object. Write the superclass first.
diff --git a/api/src/main/java/javax/jdo/identity/ShortIdentity.java b/api/src/main/java/javax/jdo/identity/ShortIdentity.java
index 6481a234..bb7b9590 100644
--- a/api/src/main/java/javax/jdo/identity/ShortIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/ShortIdentity.java
@@ -29,8 +29,7 @@ import java.io.ObjectOutput;
 /** This class is for identity with a single short field.
  * @version 2.0
  */
-public class ShortIdentity
-	extends SingleFieldIdentity
+public class ShortIdentity extends SingleFieldIdentity<ShortIdentity>
 {
 	private short key;
 
@@ -43,7 +42,7 @@ public class ShortIdentity
      * @param pcClass the class
      * @param key the key
      */
-    public ShortIdentity (Class pcClass, short key) {
+    public ShortIdentity (Class<?> pcClass, short key) {
         super(pcClass);
         construct(key);
     }
@@ -52,7 +51,7 @@ public class ShortIdentity
      * @param pcClass the class
      * @param key the key
      */
-    public ShortIdentity (Class pcClass, Short key) {
+    public ShortIdentity (Class<?> pcClass, Short key) {
         super(pcClass);
         setKeyAsObject(key);
         construct(key.shortValue());
@@ -62,7 +61,7 @@ public class ShortIdentity
      * @param pcClass the class
      * @param str the key
      */
-    public ShortIdentity (Class pcClass, String str) {
+    public ShortIdentity (Class<?> pcClass, String str) {
         super(pcClass);
         assertKeyNotNull(str);
         construct(Short.parseShort (str));
@@ -107,20 +106,12 @@ public class ShortIdentity
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof ShortIdentity) {
-        	ShortIdentity other = (ShortIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                return (key - other.key);
-            } else {
-                return result;
-            }
-        }
-        else if (o == null) {
+    public int compareTo(ShortIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
+        int result = super.compare(o);
+        return (result == 0) ? (key - o.key) : result;
     }
 
     /** Create the key as an Object.
diff --git a/api/src/main/java/javax/jdo/identity/SingleFieldIdentity.java b/api/src/main/java/javax/jdo/identity/SingleFieldIdentity.java
index 041a9335..fcd09168 100644
--- a/api/src/main/java/javax/jdo/identity/SingleFieldIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/SingleFieldIdentity.java
@@ -39,8 +39,8 @@ import javax.jdo.spi.I18NHelper;
  * a new user-defined class for the purpose.
  * @version 2.0
  */
-public abstract class SingleFieldIdentity
-    implements Externalizable, Comparable {
+public abstract class SingleFieldIdentity<SUBCLASS extends SingleFieldIdentity<SUBCLASS>>
+        implements Externalizable, Comparable<SUBCLASS>  {
     
     /** The Internationalization message helper.
      */
@@ -48,7 +48,7 @@ public abstract class SingleFieldIdentity
 
     /** The class of the target object.
      */
-    transient private Class targetClass;
+    transient private Class<?> targetClass;
     
     /** The name of the class of the target object.
      */
@@ -66,7 +66,7 @@ public abstract class SingleFieldIdentity
      * @param pcClass the class of the target
      * @since 2.0
      */
-    protected SingleFieldIdentity(Class pcClass) {
+    protected SingleFieldIdentity(Class<?> pcClass) {
         if (pcClass == null)
             throw new NullPointerException();
         targetClass = pcClass;
@@ -105,7 +105,7 @@ public abstract class SingleFieldIdentity
      * @return the target class.
      * @since 2.0
      */
-    public Class getTargetClass() {
+    public Class<?> getTargetClass() {
         return targetClass;
     }
 
diff --git a/api/src/main/java/javax/jdo/identity/StringIdentity.java b/api/src/main/java/javax/jdo/identity/StringIdentity.java
index 0802ab20..35e4a09a 100644
--- a/api/src/main/java/javax/jdo/identity/StringIdentity.java
+++ b/api/src/main/java/javax/jdo/identity/StringIdentity.java
@@ -29,7 +29,7 @@ import java.io.ObjectOutput;
 /** This class is for identity with a single String field.
  * @version 2.0
  */
-public class StringIdentity extends SingleFieldIdentity {
+public class StringIdentity extends SingleFieldIdentity<StringIdentity> {
     
     /** The key is stored in the superclass field keyAsObject.
      */
@@ -38,7 +38,7 @@ public class StringIdentity extends SingleFieldIdentity {
      * @param pcClass the class
      * @param key the key
      */
-    public StringIdentity (Class pcClass, String key) {
+    public StringIdentity (Class<?> pcClass, String key) {
         super (pcClass);
         setKeyAsObject(key);
         hashCode = hashClassName() ^ key.hashCode();
@@ -83,20 +83,12 @@ public class StringIdentity extends SingleFieldIdentity {
      * @return The relative ordering between the objects
      * @since 2.2
      */
-    public int compareTo(Object o) {
-        if (o instanceof StringIdentity) {
-            StringIdentity other = (StringIdentity)o;
-            int result = super.compare(other);
-            if (result == 0) {
-                return ((String)keyAsObject).compareTo((String)other.keyAsObject);
-            } else {
-                return result;
-            }
-        }
-        else if (o == null) {
+    public int compareTo(StringIdentity o) {
+        if (o == null) {
             throw new ClassCastException("object is null");
         }
-        throw new ClassCastException(this.getClass().getName() + " != " + o.getClass().getName());
+        int result = super.compare(o);
+        return (result == 0) ? ((String)keyAsObject).compareTo((String)o.keyAsObject) : result;
     }
 
     /** Write this object. Write the superclass first.
diff --git a/api/src/main/java/javax/jdo/metadata/JDOMetadata.java b/api/src/main/java/javax/jdo/metadata/JDOMetadata.java
index ab6fb6d8..b1fdd39d 100644
--- a/api/src/main/java/javax/jdo/metadata/JDOMetadata.java
+++ b/api/src/main/java/javax/jdo/metadata/JDOMetadata.java
@@ -83,7 +83,7 @@ public interface JDOMetadata extends Metadata {
      * @param cls Class to add
      * @return The ClassMetadata
      */
-    ClassMetadata newClassMetadata(Class cls);
+    ClassMetadata newClassMetadata(Class<?> cls);
 
     /**
      * Add a new interface to this JDO Metadata.
@@ -91,7 +91,7 @@ public interface JDOMetadata extends Metadata {
      * @param cls Class to add
      * @return The InterfaceMetadata
      */
-    InterfaceMetadata newInterfaceMetadata(Class cls);
+    InterfaceMetadata newInterfaceMetadata(Class<?> cls);
 
     /**
      * Accessor for any named queries defined on the JDO Metadata.
diff --git a/api/src/main/java/javax/jdo/metadata/PackageMetadata.java b/api/src/main/java/javax/jdo/metadata/PackageMetadata.java
index 980472b7..5c8a1bba 100644
--- a/api/src/main/java/javax/jdo/metadata/PackageMetadata.java
+++ b/api/src/main/java/javax/jdo/metadata/PackageMetadata.java
@@ -73,7 +73,7 @@ public interface PackageMetadata extends Metadata {
      * @param cls The class
      * @return The ClassMetadata
      */
-    ClassMetadata newClassMetadata(Class cls);
+    ClassMetadata newClassMetadata(Class<?> cls);
 
     /**
      * Accessor for the number of classes defined in this package.
@@ -99,7 +99,7 @@ public interface PackageMetadata extends Metadata {
      * @param cls The class
      * @return The ClassMetadata
      */
-    InterfaceMetadata newInterfaceMetadata(Class cls);
+    InterfaceMetadata newInterfaceMetadata(Class<?> cls);
 
     /**
      * Accessor for the number of interfaces defined in this package.
diff --git a/api/src/main/java/javax/jdo/query/EnumExpression.java b/api/src/main/java/javax/jdo/query/EnumExpression.java
index 065295f3..62933217 100644
--- a/api/src/main/java/javax/jdo/query/EnumExpression.java
+++ b/api/src/main/java/javax/jdo/query/EnumExpression.java
@@ -21,11 +21,11 @@ package javax.jdo.query;
  * 
  * @param <T> Enum type
  */
-public interface EnumExpression<T> extends ComparableExpression<Enum>
+public interface EnumExpression<T> extends ComparableExpression<Enum<?>>
 {
     /**
      * Method to return an expression for the ordinal of this enum.
      * @return Expression for the ordinal of the passed enum
      */
-    NumericExpression ordinal();
+    NumericExpression<Integer> ordinal();
 }
diff --git a/api/src/main/java/javax/jdo/query/Expression.java b/api/src/main/java/javax/jdo/query/Expression.java
index 7133b299..117ae561 100644
--- a/api/src/main/java/javax/jdo/query/Expression.java
+++ b/api/src/main/java/javax/jdo/query/Expression.java
@@ -28,7 +28,7 @@ public interface Expression<T>
      * @param expr Other expression
      * @return Whether they are equal
      */
-    BooleanExpression eq(Expression expr);
+    BooleanExpression eq(Expression<?> expr);
 
     /**
      * Method returning whether this expression equals the literal.
@@ -42,7 +42,7 @@ public interface Expression<T>
      * @param expr Other expression
      * @return Whether they are not equal
      */
-    BooleanExpression ne(Expression expr);
+    BooleanExpression ne(Expression<?> expr);
 
     /**
      * Method returning whether this expression doesn't equal the literal.
@@ -68,19 +68,19 @@ public interface Expression<T>
      * @param cls Class to check against
      * @return Whether it is an instanceof
      */
-    BooleanExpression instanceOf(Class cls);
+    BooleanExpression instanceOf(Class<?> cls);
 
     /**
      * Return an expression where this expression is cast to the specified type.
      * @param cls Class to cast to
      * @return The cast expression
      */
-    Expression cast(Class cls);
+    <S> Expression<S> cast(Class<S> cls);
 
     /**
      * Method to return an expression with the specified alias assigned to this expression.
      * @param alias the alias for this expression
      * @return the expression with an alias
      */
-    Expression as(String alias);
+    Expression<T> as(String alias);
 }
\ No newline at end of file
diff --git a/api/src/main/java/javax/jdo/query/PersistableExpression.java b/api/src/main/java/javax/jdo/query/PersistableExpression.java
index 83c1fa07..82abb616 100644
--- a/api/src/main/java/javax/jdo/query/PersistableExpression.java
+++ b/api/src/main/java/javax/jdo/query/PersistableExpression.java
@@ -27,11 +27,11 @@ public interface PersistableExpression<T> extends Expression<T>
      * Method to return an expression for the (JDO) identity of this persistable object.
      * @return The identity expression
      */
-    Expression jdoObjectId();
+    Expression<?> jdoObjectId();
 
     /**
      * Method to return an expression for the (JDO) version of this persistable object.
      * @return The version expression
      */
-    Expression jdoVersion();
+    Expression<?> jdoVersion();
 }
\ No newline at end of file
diff --git a/api/src/main/java/javax/jdo/query/StringExpression.java b/api/src/main/java/javax/jdo/query/StringExpression.java
index 6d98e8b5..c4c863e2 100644
--- a/api/src/main/java/javax/jdo/query/StringExpression.java
+++ b/api/src/main/java/javax/jdo/query/StringExpression.java
@@ -26,7 +26,7 @@ public interface StringExpression extends ComparableExpression<String>
      * @param expr The other expression
      * @return The summation
      */
-    StringExpression add(Expression expr);
+    StringExpression add(Expression<?> expr);
 
     /**
      * Method to return an expression for this expression added to the passed string (String concatenation).
diff --git a/api/src/main/java/javax/jdo/spi/I18NHelper.java b/api/src/main/java/javax/jdo/spi/I18NHelper.java
index 4e3abaae..5261f778 100644
--- a/api/src/main/java/javax/jdo/spi/I18NHelper.java
+++ b/api/src/main/java/javax/jdo/spi/I18NHelper.java
@@ -50,13 +50,11 @@ public class I18NHelper {
 
     /** Bundles that have already been loaded 
      */
-    private static Hashtable<String,ResourceBundle>
-            bundles = new Hashtable<String,ResourceBundle>();
+    private static Hashtable<String,ResourceBundle> bundles = new Hashtable<>();
     
     /** Helper instances that have already been created 
      */
-    private static Hashtable<String,I18NHelper>
-            helpers = new Hashtable<String,I18NHelper>();
+    private static Hashtable<String,I18NHelper> helpers = new Hashtable<>();
     
     /** The default locale for this VM.
      */
@@ -107,7 +105,7 @@ public class I18NHelper {
      * @param cls the class object from which to load the resource bundle
      * @return the helper instance bound to the bundle
      */
-    public static I18NHelper getInstance (final Class cls) {
+    public static I18NHelper getInstance (final Class<?> cls) {
         ClassLoader classLoader = doPrivileged (
             new PrivilegedAction<ClassLoader> () {
                 public ClassLoader run () {
diff --git a/api/src/main/java/javax/jdo/spi/JDOImplHelper.java b/api/src/main/java/javax/jdo/spi/JDOImplHelper.java
index 4436161a..edefeaf1 100644
--- a/api/src/main/java/javax/jdo/spi/JDOImplHelper.java
+++ b/api/src/main/java/javax/jdo/spi/JDOImplHelper.java
@@ -77,26 +77,26 @@ public class JDOImplHelper extends java.lang.Object {
      * are added by the static method in each <code>PersistenceCapable</code> 
      * class.  Entries are never removed.
      */    
-    private static Map<Class,Meta> registeredClasses =
-            Collections.synchronizedMap(new HashMap<Class,Meta> ());
+    private static Map<Class<?>,Meta> registeredClasses =
+            Collections.synchronizedMap(new HashMap<> ());
     
     /** This Set contains all classes that have registered for setStateManager
      * permissions via authorizeStateManagerClass.
      * Only the key is used in order to maintain a weak set of classes.
      */
-    private static final Map<Class,Class>
-            authorizedStateManagerClasses = new WeakHashMap<Class,Class>();
+    private static final Map<Class<?>,Class<?>>
+            authorizedStateManagerClasses = new WeakHashMap<>();
 
     /** This list contains the registered listeners for 
      * <code>RegisterClassEvent</code>s.
      */
     private static final List<RegisterClassListener>
-            listeners = new ArrayList<RegisterClassListener>();
+            listeners = new ArrayList<>();
     
     /** The list of registered StateInterrogation instances
      */
     private static List<StateInterrogation>
-            stateInterrogations = new ArrayList<StateInterrogation>();
+            stateInterrogations = new ArrayList<>();
 
     /** The singleton <code>JDOImplHelper</code> instance.
      */    
@@ -131,7 +131,7 @@ public class JDOImplHelper extends java.lang.Object {
     public static final Set<String> USER_CONFIGURABLE_STANDARD_PROPERTIES = createUserConfigurableStandardProperties();
 
     private static Set<String> createUserConfigurableStandardProperties() {
-        Set<String> props = new HashSet<String>();
+        Set<String> props = new HashSet<>();
         
         props.add(Constants.PROPERTY_CONNECTION_DRIVER_NAME);
         props.add(Constants.PROPERTY_CONNECTION_FACTORY2_NAME);
@@ -178,7 +178,7 @@ public class JDOImplHelper extends java.lang.Object {
     static Set<String> createUserConfigurableStandardPropertiesLowerCased() {
 	Set<String> mixedCased = createUserConfigurableStandardProperties();
 	Set<String> lowerCased =
-		new HashSet<String>(mixedCased.size());
+		new HashSet<>(mixedCased.size());
 
 	for (String propertyName : mixedCased) {
 	    lowerCased.add(propertyName.toLowerCase());
@@ -220,7 +220,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param pcClass the <code>PersistenceCapable</code> class.
      * @return the field names for the class.
      */    
-    public String[] getFieldNames (Class pcClass) {
+    public String[] getFieldNames (Class<?> pcClass) {
         Meta meta = getMeta (pcClass);
         return meta.getFieldNames();
     }
@@ -230,7 +230,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param pcClass the <code>PersistenceCapable</code> class.
      * @return the field types for the class.
      */    
-    public Class[] getFieldTypes (Class pcClass) {
+    public Class<?>[] getFieldTypes (Class<?> pcClass) {
         Meta meta = getMeta (pcClass);
         return meta.getFieldTypes();
     }
@@ -240,7 +240,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param pcClass the <code>PersistenceCapable</code> class.
      * @return the field types for the class.
      */    
-    public byte[] getFieldFlags (Class pcClass) {
+    public byte[] getFieldFlags (Class<?> pcClass) {
         Meta meta = getMeta (pcClass);
         return meta.getFieldFlags();
     }
@@ -251,7 +251,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @return The <code>PersistenceCapable</code> superclass for this class,
      * or <code>null</code> if there isn't one.
      */    
-    public Class getPersistenceCapableSuperclass (Class pcClass) {
+    public Class<?> getPersistenceCapableSuperclass (Class<?> pcClass) {
         Meta meta = getMeta (pcClass);
         return meta.getPersistenceCapableSuperclass();
     }
@@ -266,7 +266,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @return the new instance, or <code>null</code> if the class is not 
      * registered.
      */    
-    public PersistenceCapable newInstance (Class pcClass, StateManager sm) {
+    public PersistenceCapable newInstance (Class<?> pcClass, StateManager sm) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         return pcInstance == null?null:pcInstance.jdoNewInstance(sm);
@@ -285,7 +285,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param oid the ObjectId instance from which to copy key field values.
  */    
     public PersistenceCapable newInstance 
-            (Class pcClass, StateManager sm, Object oid) {
+            (Class<?> pcClass, StateManager sm, Object oid) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         return pcInstance == null?null:pcInstance.jdoNewInstance(sm, oid);
@@ -303,7 +303,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @return the new ObjectId instance, or <code>null</code> if the class 
      * is not registered.
      */    
-    public Object newObjectIdInstance (Class pcClass) {
+    public Object newObjectIdInstance (Class<?> pcClass) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         return pcInstance == null?null:pcInstance.jdoNewObjectIdInstance();
@@ -334,7 +334,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param pcClass the <code>PersistenceCapable</code> class.
      * @since 2.0
      */
-    public Object newObjectIdInstance (Class pcClass, Object obj) {
+    public Object newObjectIdInstance (Class<?> pcClass, Object obj) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         return (pcInstance == null)?null:pcInstance.jdoNewObjectIdInstance(obj);
@@ -360,7 +360,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param fm the field manager that supplies the field values.
  */    
     public void copyKeyFieldsToObjectId 
-    (Class pcClass, PersistenceCapable.ObjectIdFieldSupplier fm, Object oid) {
+    (Class<?> pcClass, PersistenceCapable.ObjectIdFieldSupplier fm, Object oid) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         if (pcInstance == null) {
@@ -390,7 +390,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param fm the field manager that receives the field values.
      */    
     public void copyKeyFieldsFromObjectId
-    (Class pcClass, PersistenceCapable.ObjectIdFieldConsumer fm, Object oid) {
+    (Class<?> pcClass, PersistenceCapable.ObjectIdFieldConsumer fm, Object oid) {
         Meta meta = getMeta (pcClass);
         PersistenceCapable pcInstance = meta.getPC();
         if (pcInstance == null) {
@@ -415,9 +415,9 @@ public class JDOImplHelper extends java.lang.Object {
      * @param persistenceCapableSuperclass the most immediate superclass that is
      * <code>PersistenceCapable</code>
      */    
-    public static void registerClass (Class pcClass, 
-            String[] fieldNames, Class[] fieldTypes, 
-            byte[] fieldFlags, Class persistenceCapableSuperclass,
+    public static void registerClass (Class<?> pcClass,
+            String[] fieldNames, Class<?>[] fieldTypes,
+            byte[] fieldFlags, Class<?> persistenceCapableSuperclass,
             PersistenceCapable pc) {
         if (pcClass == null) 
             throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N
@@ -431,9 +431,8 @@ public class JDOImplHelper extends java.lang.Object {
                 RegisterClassEvent event = new RegisterClassEvent(
                     jdoImplHelper, pcClass, fieldNames, fieldTypes, 
                     fieldFlags, persistenceCapableSuperclass);
-                for (Iterator i = listeners.iterator(); i.hasNext();) {
-                    RegisterClassListener crl = 
-                        (RegisterClassListener)i.next();
+                for (Iterator<RegisterClassListener> i = listeners.iterator(); i.hasNext();) {
+                    RegisterClassListener crl = i.next();
                     if (crl != null) {
                         crl.registerClass(event);
                     }
@@ -458,9 +457,9 @@ public class JDOImplHelper extends java.lang.Object {
             sec.checkPermission (JDOPermission.MANAGE_METADATA);
         }
         synchronized(registeredClasses) {
-            for (Iterator i = registeredClasses.keySet().iterator(); 
+            for (Iterator<Class<?>> i = registeredClasses.keySet().iterator();
                  i.hasNext();) {
-                Class pcClass = (Class)i.next();
+                Class<?> pcClass = i.next();
                 // Note, the pc class was registered by calling the static
                 // method JDOImplHelper.registerClass. This means the
                 // JDOImplHelper class loader is the same as or an ancestor
@@ -485,7 +484,7 @@ public class JDOImplHelper extends java.lang.Object {
      * unregistered.
      * @since 1.0.2
      */
-    public void unregisterClass (Class pcClass)
+    public void unregisterClass (Class<?> pcClass)
     {
         if (pcClass == null) 
             throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N
@@ -503,7 +502,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param crl the listener to be added
      */
     public void addRegisterClassListener (RegisterClassListener crl) {
-        HashSet alreadyRegisteredClasses = null;
+        HashSet<Class<?>> alreadyRegisteredClasses = null;
         synchronized (listeners) {
             listeners.add(crl);
             // Make a copy of the existing set of registered classes.
@@ -511,12 +510,12 @@ public class JDOImplHelper extends java.lang.Object {
             // registrations might occur, and will then all wait until this 
             // synchronized block completes. Some of the class registrations 
             // might be delivered twice to the newly registered listener.
-            alreadyRegisteredClasses = new HashSet<Class> (registeredClasses.keySet());
+            alreadyRegisteredClasses = new HashSet<> (registeredClasses.keySet());
         }
         // new registrations will call the new listener while the following 
         // occurs notify the new listener about already-registered classes
-        for (Iterator it = alreadyRegisteredClasses.iterator(); it.hasNext();) {
-            Class pcClass = (Class)it.next();
+        for (Iterator<Class<?>> it = alreadyRegisteredClasses.iterator(); it.hasNext();) {
+            Class<?> pcClass = it.next();
             Meta meta = getMeta (pcClass);
             RegisterClassEvent event = new RegisterClassEvent(
                 this, pcClass, meta.getFieldNames(), meta.getFieldTypes(), 
@@ -541,7 +540,7 @@ public class JDOImplHelper extends java.lang.Object {
      * persistence-capable classes.
      * @return registered persistence-capable classes
      */
-    public Collection<Class> getRegisteredClasses() {
+    public Collection<Class<?>> getRegisteredClasses() {
         return Collections.unmodifiableCollection(registeredClasses.keySet());
     }
 
@@ -549,7 +548,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param pcClass the <code>Class</code>.
      * @return the <code>Meta</code> for the <code>Class</code>.
      */    
-    private static Meta getMeta (Class pcClass) {
+    private static Meta getMeta (Class<?> pcClass) {
         Meta ret = (Meta) registeredClasses.get (pcClass);
         if (ret == null) {
             throw new JDOFatalUserException(
@@ -569,7 +568,7 @@ public class JDOImplHelper extends java.lang.Object {
      * JDOPermission("setStateManager").
      * @since 1.0.1
      */
-    public static void registerAuthorizedStateManagerClass (Class smClass) 
+    public static void registerAuthorizedStateManagerClass (Class<?> smClass)
         throws SecurityException {
         if (smClass == null) 
             throw new NullPointerException(msg.msg("ERR_NullClass")); //NOI18N
@@ -594,19 +593,19 @@ public class JDOImplHelper extends java.lang.Object {
      * @since 1.0.1
      */
     public static void registerAuthorizedStateManagerClasses (
-            Collection smClasses) throws SecurityException {
+            Collection<?> smClasses) throws SecurityException {
         SecurityManager sm = LegacyJava.getSecurityManager();
         if (sm != null) {
             sm.checkPermission(JDOPermission.SET_STATE_MANAGER);
             synchronized (authorizedStateManagerClasses) {
-                for (Iterator it = smClasses.iterator(); it.hasNext();) {
+                for (Iterator<?> it = smClasses.iterator(); it.hasNext();) {
                     Object smClass = it.next();
                     if (!(smClass instanceof Class)) {
                         throw new ClassCastException(
                             msg.msg("ERR_StateManagerClassCast", //NOI18N
                                 smClass.getClass().getName()));
                     }
-                    registerAuthorizedStateManagerClass((Class)it.next());
+                    registerAuthorizedStateManagerClass((Class<?>)it.next());
                 }
             }
         }
@@ -677,7 +676,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param smClass a Class to be checked for JDOPermission("setStateManager")
      * @since 1.0.1
      */
-    public static void checkAuthorizedStateManagerClass (Class smClass) {
+    public static void checkAuthorizedStateManagerClass (Class<?> smClass) {
         final SecurityManager scm = LegacyJava.getSecurityManager();
         if (scm == null) {
             // if no security manager, no checking.
@@ -715,8 +714,7 @@ public class JDOImplHelper extends java.lang.Object {
      * keyed on class instance and the value is an instance of 
      * StringConstructor.
      */
-    static final Map<Class,StringConstructor> stringConstructorMap =
-            new HashMap<Class,StringConstructor>();
+    static final Map<Class<?>,StringConstructor> stringConstructorMap = new HashMap<>();
 
     /**
      * 
@@ -727,7 +725,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param sc the StringConstructor instance
      * @return the previous StringConstructor registered for this class
      */
-    public Object registerStringConstructor(Class cls, StringConstructor sc) {
+    public Object registerStringConstructor(Class<?> cls, StringConstructor sc) {
         synchronized(stringConstructorMap) {
             return stringConstructorMap.put(cls, sc);
         }
@@ -844,7 +842,7 @@ public class JDOImplHelper extends java.lang.Object {
             if (stringConstructor != null) {
                 return stringConstructor.construct(keyString);
             } else {
-                Constructor keyConstructor = 
+                Constructor<?> keyConstructor =
                     keyClass.getConstructor(new Class[]{String.class});
                 return keyConstructor.newInstance(new Object[]{keyString});
             }
@@ -937,8 +935,8 @@ public class JDOImplHelper extends java.lang.Object {
          * <code>PersistenceCapable</code> superclass
          * @param pc An instance of the <code>PersistenceCapable</code> class
          */        
-        Meta (String[] fieldNames, Class[] fieldTypes, byte[] fieldFlags,
-              Class persistenceCapableSuperclass, PersistenceCapable pc) {
+        Meta (String[] fieldNames, Class<?>[] fieldTypes, byte[] fieldFlags,
+              Class<?> persistenceCapableSuperclass, PersistenceCapable pc) {
             this.fieldNames = fieldNames;
             this.fieldTypes = fieldTypes;
             this.fieldFlags = fieldFlags;
@@ -963,12 +961,12 @@ public class JDOImplHelper extends java.lang.Object {
          * for the Model at runtime.  The field
          * is passed by the static class initialization.
          */
-        Class[] fieldTypes;
+        Class<?>[] fieldTypes;
     
         /** Get the field types from the metadata.
          * @return the array of field types.
          */
-        Class[] getFieldTypes() {
+        Class<?>[] getFieldTypes() {
             return fieldTypes;
         }
     
@@ -988,12 +986,12 @@ public class JDOImplHelper extends java.lang.Object {
         /** This is the <code>Class</code> instance of the 
          * <code>PersistenceCapable</code> superclass.
          */
-        Class persistenceCapableSuperclass;
+        Class<?> persistenceCapableSuperclass;
     
         /** Return the <code>PersistenceCapable</code> superclass.
          * @return the <code>PersistenceCapable</code> superclass
          */
-        Class getPersistenceCapableSuperclass() {
+        Class<?> getPersistenceCapableSuperclass() {
             return persistenceCapableSuperclass;
         }
         /** This is an instance of <code>PersistenceCapable</code>,
@@ -1022,8 +1020,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param si the StateInterrogation to add
      */
     public synchronized void addStateInterrogation(StateInterrogation si) {
-        List<StateInterrogation> newList =
-                new ArrayList<StateInterrogation>(stateInterrogations);
+        List<StateInterrogation> newList = new ArrayList<>(stateInterrogations);
         newList.add(si);
         stateInterrogations = newList;
     }
@@ -1034,8 +1031,7 @@ public class JDOImplHelper extends java.lang.Object {
      * @param si the StateInterrogation to remove
      */
     public synchronized void removeStateInterrogation(StateInterrogation si) {
-        List<StateInterrogation> newList =
-                new ArrayList<StateInterrogation>(stateInterrogations);
+        List<StateInterrogation> newList = new ArrayList<>(stateInterrogations);
         newList.remove(si);
         stateInterrogations = newList;
     }
@@ -1045,7 +1041,7 @@ public class JDOImplHelper extends java.lang.Object {
      * Synchronize to avoid add/remove/iterate conflicts.
      * @return an Iterator over all StateInterrogation instances.
      */
-    private synchronized Iterator getStateInterrogationIterator() {
+    private synchronized Iterator<StateInterrogation> getStateInterrogationIterator() {
         return stateInterrogations.iterator();
     }
     
@@ -1057,9 +1053,9 @@ public class JDOImplHelper extends java.lang.Object {
      * @param fieldName the field to mark dirty
      */
     public void nonBinaryCompatibleMakeDirty(Object pc, String fieldName) {
-        Iterator sit = getStateInterrogationIterator();
+        Iterator<StateInterrogation> sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
-            StateInterrogation si = (StateInterrogation)sit.next();
+            StateInterrogation si = sit.next();
             try {
                 if (si.makeDirty(pc, fieldName)) return;
             } catch (Throwable t) {
@@ -1084,9 +1080,9 @@ public class JDOImplHelper extends java.lang.Object {
      */
     public boolean nonBinaryCompatibleIs(Object pc, 
             StateInterrogationBooleanReturn sibr) {
-        Iterator sit = getStateInterrogationIterator();
+        Iterator<StateInterrogation> sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
-            StateInterrogation si = (StateInterrogation)sit.next();
+            StateInterrogation si = sit.next();
             Boolean result;
             try {
                 result = sibr.is(pc, si);
@@ -1112,9 +1108,9 @@ public class JDOImplHelper extends java.lang.Object {
      */
     public Object nonBinaryCompatibleGet(Object pc, 
             StateInterrogationObjectReturn sibr) {
-        Iterator sit = getStateInterrogationIterator();
+        Iterator<StateInterrogation> sit = getStateInterrogationIterator();
         while (sit.hasNext()) {
-            StateInterrogation si = (StateInterrogation)sit.next();
+            StateInterrogation si = sit.next();
             Object result;
             try {
                 result = sibr.get(pc, si);
@@ -1171,7 +1167,7 @@ public class JDOImplHelper extends java.lang.Object {
         if (properties == null || properties.isEmpty())
             return;
 
-        List<JDOUserException> exceptions = new ArrayList<JDOUserException>();
+        List<JDOUserException> exceptions = new ArrayList<>();
         StringBuilder unknowns = new StringBuilder();
 
         for (Object key : properties.keySet()) {
diff --git a/api/src/test/java/javax/jdo/AbstractJDOConfigTest.java b/api/src/test/java/javax/jdo/AbstractJDOConfigTest.java
index 2ee1378d..18877091 100644
--- a/api/src/test/java/javax/jdo/AbstractJDOConfigTest.java
+++ b/api/src/test/java/javax/jdo/AbstractJDOConfigTest.java
@@ -108,10 +108,10 @@ public abstract class AbstractJDOConfigTest extends AbstractTest {
      * @param expected the first {@link java.util.Map Map} object to test.
      * @param actual the second {@link java.util.Map Map} object to test.
      */
-    static void assertEqualProperties(Map expected, Map actual) {
-        Iterator i = expected.entrySet().iterator();
+    static void assertEqualProperties(Map<?, ?> expected, Map<?, ?> actual) {
+        Iterator<? extends Map.Entry<?, ?>> i = expected.entrySet().iterator();
         while (i.hasNext()) {
-            Map.Entry entry = (Map.Entry) i.next();
+            Map.Entry<?, ?> entry = i.next();
             String key = (String) entry.getKey();
             String expectedValue = (String) entry.getValue();
             String actualValue = (String) actual.get(key);
@@ -126,7 +126,7 @@ public abstract class AbstractJDOConfigTest extends AbstractTest {
     
     protected String getPMFClassNameViaServiceLookup(ClassLoader loader) {
         try {
-            Enumeration urls = JDOHelper.getResources(loader, 
+            Enumeration<URL> urls = JDOHelper.getResources(loader,
                 SERVICE_LOOKUP_PMF_RESOURCE_NAME);
             while (urls.hasMoreElements()) {
                 // return the first one found
diff --git a/api/src/test/java/javax/jdo/EnhancerTest.java b/api/src/test/java/javax/jdo/EnhancerTest.java
index 4adf1387..38782e95 100644
--- a/api/src/test/java/javax/jdo/EnhancerTest.java
+++ b/api/src/test/java/javax/jdo/EnhancerTest.java
@@ -279,7 +279,7 @@ public class EnhancerTest extends AbstractTest {
         InvocationResult result = new InvocationResult();
         try {
             // create the java command to invoke the Enhancer
-            List<String> commands = new ArrayList<String>();
+            List<String> commands = new ArrayList<>();
             // find the java command in the user's path
             commands.add("java");
             commands.add("-cp");
diff --git a/api/src/test/java/javax/jdo/JDOHelperConfigTest.java b/api/src/test/java/javax/jdo/JDOHelperConfigTest.java
index 1825a0ab..a04e2485 100644
--- a/api/src/test/java/javax/jdo/JDOHelperConfigTest.java
+++ b/api/src/test/java/javax/jdo/JDOHelperConfigTest.java
@@ -76,10 +76,10 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
      * @return a new {@link java.util.Map Map} object populated with properties
      *         that can be used in this test suite.
      */
-    protected Map prepareInitialExpectedMap(String testVariant,
+    protected Map<String, String> prepareInitialExpectedMap(String testVariant,
         int listenerCount, int vendorSpecificPropertyCount,
         boolean excludeName, boolean excludePUName) {
-        Map<String, String> expected = new HashMap<String, String>();
+        Map<String, String> expected = new HashMap<>();
 
         if (!excludeName) {
             expected.put(PROPERTY_NAME, PMF_ATTRIBUTE_NAME + "." + testVariant);
@@ -212,10 +212,10 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
 
         URLClassLoader loader = new JDOConfigTestClassLoader(
             getClass().getClassLoader(), classpaths);
-        Map expected = prepareInitialExpectedMap(testVariantName,
+        Map<String, String> expected = prepareInitialExpectedMap(testVariantName,
             listenerCount, vendorSpecificPropertyCount, excludeName, excludePUName);
         String name = testVariantName == null ? null : (String) expected.get(PROPERTY_NAME);
-        Map actual = JDOHelper.getPropertiesFromJdoconfig(name, loader);
+        Map<Object, Object> actual = JDOHelper.getPropertiesFromJdoconfig(name, loader);
 
         assertNotNull("No properties found", actual);
         if (checkEqualProperties) {
@@ -254,7 +254,7 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
             JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1a",
             JDOCONFIG_CLASSPATH_PREFIX + "/Positive01/1b" };
         URLClassLoader loader = new JDOConfigTestClassLoader(getClass().getClassLoader(), classpaths);
-        Map actual = JDOHelper.getPropertiesFromJdoconfig(
+        Map<Object, Object> actual = JDOHelper.getPropertiesFromJdoconfig(
             ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader);
     }
 
@@ -264,7 +264,7 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
         URLClassLoader loader = new JDOConfigTestClassLoader(
                 getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive02/");
 
-        Map properties = JDOHelper.getPropertiesFromJdoconfig(
+        Map<Object, Object> properties = JDOHelper.getPropertiesFromJdoconfig(
             ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader);
         assertNotNull("Anonymous PMF with no properties returned null", properties);
         assertTrue("Anonymous PMF with no properties had properties", properties.size() == 0);
@@ -314,8 +314,8 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
         URLClassLoader loader = new JDOConfigTestClassLoader(
                 getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive06/");
 
-        Map expected = prepareInitialExpectedMap("positive06.pmf0", 2, 0, true, true);
-        Map actual = JDOHelper.getPropertiesFromJdoconfig(
+        Map<String, String> expected = prepareInitialExpectedMap("positive06.pmf0", 2, 0, true, true);
+        Map<Object, Object> actual = JDOHelper.getPropertiesFromJdoconfig(
             ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader);
 
         assertNotNull("No properties found", actual);
@@ -328,8 +328,8 @@ public class JDOHelperConfigTest extends AbstractJDOConfigTest implements Consta
         URLClassLoader loader = new JDOConfigTestClassLoader(
                 getClass().getClassLoader(), JDOCONFIG_CLASSPATH_PREFIX + "/Positive07/");
 
-        Map expected = prepareInitialExpectedMap("positive07.pmf0", 2, 0, true, false);
-        Map actual = JDOHelper.getPropertiesFromJdoconfig(
+        Map<String, String> expected = prepareInitialExpectedMap("positive07.pmf0", 2, 0, true, false);
+        Map<Object, Object> actual = JDOHelper.getPropertiesFromJdoconfig(
             ANONYMOUS_PERSISTENCE_MANAGER_FACTORY_NAME, loader);
 
         assertNotNull("No properties found", actual);
diff --git a/api/src/test/java/javax/jdo/JDOHelperTest.java b/api/src/test/java/javax/jdo/JDOHelperTest.java
index 727bf1a9..86edd3b9 100644
--- a/api/src/test/java/javax/jdo/JDOHelperTest.java
+++ b/api/src/test/java/javax/jdo/JDOHelperTest.java
@@ -450,7 +450,7 @@ public class JDOHelperTest extends AbstractTest {
     /** Test bad PMF class no method getPersistenceManagerFactory(Map).
      */
     public void testBadPMFNoGetPMFMapMethod() {
-        Map<String,String> props = new HashMap<String,String>();
+        Map<String,String> props = new HashMap<>();
         props.put("javax.jdo.PersistenceManagerFactoryClass", 
                 "javax.jdo.JDOHelperTest$BadPMFNoGetPMFMethod");
         try {
@@ -600,21 +600,21 @@ public class JDOHelperTest extends AbstractTest {
 
     public static class BadPMFNonStaticGetPMFMethod {
         public PersistenceManagerFactory
-                getPersistenceManagerFactory(Map props) {
+                getPersistenceManagerFactory(Map<?, ?> props) {
             return null;
         }
     }
         
     public static class BadPMFWrongReturnType {
         public static BadPMFWrongReturnType 
-                getPersistenceManagerFactory(Map props) {
+                getPersistenceManagerFactory(Map<?, ?> props) {
             return new BadPMFWrongReturnType();
         }
     }
     
     public static class BadPMFGetPMFMethodThrowsJDOException {
         public static PersistenceManagerFactory
-                getPersistenceManagerFactory(Map props) {
+                getPersistenceManagerFactory(Map<?, ?> props) {
             throw new JDOUnsupportedOptionException(
                     "GetPMF method throws JDOUnsupportedOptionException");
         }
@@ -622,7 +622,7 @@ public class JDOHelperTest extends AbstractTest {
 
     public static class BadPMFGetPMFMethodThrowsJDOFatalInternalException {
         public static PersistenceManagerFactory
-                getPersistenceManagerFactory(Map props) {
+                getPersistenceManagerFactory(Map<?, ?> props) {
             throw new JDOFatalInternalException(
                     "GetPMF method throws JDOFatalInternalException");
         }
@@ -630,7 +630,7 @@ public class JDOHelperTest extends AbstractTest {
 
     public static class BadPMFGetPMFMethodReturnsNull {
         public static PersistenceManagerFactory
-                getPersistenceManagerFactory(Map props) {
+                getPersistenceManagerFactory(Map<?, ?> props) {
             return null;
         }
     }
diff --git a/api/src/test/java/javax/jdo/MockEnhancer.java b/api/src/test/java/javax/jdo/MockEnhancer.java
index a5208a40..03590740 100644
--- a/api/src/test/java/javax/jdo/MockEnhancer.java
+++ b/api/src/test/java/javax/jdo/MockEnhancer.java
@@ -46,10 +46,10 @@ public class MockEnhancer implements JDOEnhancer {
     @SuppressWarnings("unused")
     private boolean verbose;
     private int numberOfElements;
-    private List<String> classNames = new ArrayList<String>();
-    private List<String> jarNames = new ArrayList<String>();
-    private List<String> jdoNames = new ArrayList<String>();
-    private List<String> puNames = new ArrayList<String>();
+    private List<String> classNames = new ArrayList<>();
+    private List<String> jarNames = new ArrayList<>();
+    private List<String> jdoNames = new ArrayList<>();
+    private List<String> puNames = new ArrayList<>();
     @SuppressWarnings("unused")
     private String outputDirectory = null;
 
diff --git a/api/src/test/java/javax/jdo/ObjectStateTest.java b/api/src/test/java/javax/jdo/ObjectStateTest.java
index 35cdc385..4a62c0eb 100644
--- a/api/src/test/java/javax/jdo/ObjectStateTest.java
+++ b/api/src/test/java/javax/jdo/ObjectStateTest.java
@@ -215,7 +215,7 @@ public class ObjectStateTest extends AbstractTest {
     }
 
     private static Method getDeclaredMethod
-            (Class clazz, String methodName, Class[] parameters) {
+            (Class<?> clazz, String methodName, Class<?>[] parameters) {
         try {
             @SuppressWarnings("unchecked")
             Method result = clazz.getDeclaredMethod(methodName, parameters);
@@ -224,7 +224,7 @@ public class ObjectStateTest extends AbstractTest {
             // human-readable class.methodName(parameter[,parameter])
             StringBuffer sb = new StringBuffer(methodName);
             String delimiter = "(";
-            for (Class parameter: parameters) {
+            for (Class<?> parameter: parameters) {
                 sb.append(delimiter);
                 sb.append(parameter.getName());
                 delimiter = ",";
diff --git a/api/src/test/java/javax/jdo/PMFService.java b/api/src/test/java/javax/jdo/PMFService.java
index 7d1a8e36..e1edb448 100644
--- a/api/src/test/java/javax/jdo/PMFService.java
+++ b/api/src/test/java/javax/jdo/PMFService.java
@@ -28,7 +28,7 @@ public class PMFService implements Constants{
     }
 
     public static PersistenceManagerFactory getPersistenceManagerFactory(
-            Map overrides, Map props) {
+            Map<?, ?> overrides, Map<?, ?> props) {
         PersistenceManagerFactory pmf =
                 (PersistenceManagerFactory) PMFProxy.newInstance();
         setPMFProperties(pmf, props, overrides);
@@ -37,7 +37,7 @@ public class PMFService implements Constants{
     }
 
     public static PersistenceManagerFactory getPersistenceManagerFactory(
-            Map props) {
+            Map<?, ?> props) {
         PersistenceManagerFactory pmf =
                 (PersistenceManagerFactory) PMFProxy.newInstance();
         setPMFProperties(pmf, props, null);
@@ -46,7 +46,7 @@ public class PMFService implements Constants{
     }
 
     private static void setPMFProperties(PersistenceManagerFactory pmf,
-            Map props, Map overrides) {
+            Map<?, ?> props, Map<?, ?> overrides) {
 
         pmf.setConnectionDriverName((String)props.get(PROPERTY_CONNECTION_DRIVER_NAME));
 
diff --git a/api/src/test/java/javax/jdo/identity/ConcreteTestIdentity.java b/api/src/test/java/javax/jdo/identity/ConcreteTestIdentity.java
index 02de1ee7..38e608d9 100644
--- a/api/src/test/java/javax/jdo/identity/ConcreteTestIdentity.java
+++ b/api/src/test/java/javax/jdo/identity/ConcreteTestIdentity.java
@@ -32,7 +32,7 @@ import java.io.ObjectOutput;
  */
     public class ConcreteTestIdentity extends SingleFieldIdentity {
         
-        ConcreteTestIdentity(Class cls) {
+        ConcreteTestIdentity(Class<?> cls) {
             super(cls);
         }
         
diff --git a/api/src/test/java/javax/jdo/pc/PCPoint.java b/api/src/test/java/javax/jdo/pc/PCPoint.java
index 2a80d426..cb30c4d5 100644
--- a/api/src/test/java/javax/jdo/pc/PCPoint.java
+++ b/api/src/test/java/javax/jdo/pc/PCPoint.java
@@ -39,14 +39,14 @@ public class PCPoint
     protected transient byte jdoFlags;
     private static final int jdoInheritedFieldCount = 0;
     private static final String jdoFieldNames[] = { "x", "y" };
-    private static final Class jdoFieldTypes[]; 
+    private static final Class<?> jdoFieldTypes[];
     private static final byte jdoFieldFlags[] = { 
         (byte)(PersistenceCapable.CHECK_READ + PersistenceCapable.CHECK_WRITE + 
                PersistenceCapable.SERIALIZABLE), 
         (byte)(PersistenceCapable.CHECK_READ + PersistenceCapable.CHECK_WRITE + 
                PersistenceCapable.SERIALIZABLE), 
     }; 
-    private static final Class jdoPersistenceCapableSuperclass; 
+    private static final Class<?> jdoPersistenceCapableSuperclass;
 
     static 
     {
@@ -445,7 +445,7 @@ public class PCPoint
         out.defaultWriteObject();
     }
     
-    protected static final Class sunjdo$classForName$(String s) {
+    protected static final Class<?> sunjdo$classForName$(String s) {
         try {
             return Class.forName(s);
         }
diff --git a/api/src/test/java/javax/jdo/spi/JDOImplHelperTest.java b/api/src/test/java/javax/jdo/spi/JDOImplHelperTest.java
index 3e4b7c90..66ec1ddc 100644
--- a/api/src/test/java/javax/jdo/spi/JDOImplHelperTest.java
+++ b/api/src/test/java/javax/jdo/spi/JDOImplHelperTest.java
@@ -71,7 +71,7 @@ public class JDOImplHelperTest extends AbstractTest {
     /** */
     public void testGetFieldTypes() {
         JDOImplHelper implHelper = JDOImplHelper.getInstance();
-        Class[] fieldTypes = implHelper.getFieldTypes(PCPoint.class);
+        Class<?>[] fieldTypes = implHelper.getFieldTypes(PCPoint.class);
         if (fieldTypes == null) {
             fail("array of field types is null");
         }
@@ -116,7 +116,7 @@ public class JDOImplHelperTest extends AbstractTest {
     /** */
     public void testGetPCSuperclass() {
         JDOImplHelper implHelper = JDOImplHelper.getInstance();
-        Class pcSuper = 
+        Class<?> pcSuper =
             implHelper.getPersistenceCapableSuperclass(PCPoint.class);
         if (pcSuper != null) {
             fail("Wrong pc superclass of PCPoint; expected null, got " + 
@@ -139,7 +139,7 @@ public class JDOImplHelperTest extends AbstractTest {
     public void testClassRegistration() {
         JDOImplHelper implHelper = JDOImplHelper.getInstance();
 
-        Collection registeredClasses = implHelper.getRegisteredClasses();
+        Collection<Class<?>> registeredClasses = implHelper.getRegisteredClasses();
         // test whether PCPoint is registered
         if (!registeredClasses.contains(PCPoint.class)) {
             fail("Missing registration of pc class PCPoint");
@@ -147,9 +147,9 @@ public class JDOImplHelperTest extends AbstractTest {
 
         // Save registered meta data for restoring
         String[] fieldNames = implHelper.getFieldNames(PCPoint.class);
-        Class[] fieldTypes = implHelper.getFieldTypes(PCPoint.class);
+        Class<?>[] fieldTypes = implHelper.getFieldTypes(PCPoint.class);
         byte[] fieldFlags = implHelper.getFieldFlags(PCPoint.class);
-        Class pcSuperclass = implHelper.getPersistenceCapableSuperclass(PCPoint.class);
+        Class<?> pcSuperclass = implHelper.getPersistenceCapableSuperclass(PCPoint.class);
         
         // test unregisterClass with null parameter
         try {
diff --git a/api/src/test/java/javax/jdo/stub/StubPMF.java b/api/src/test/java/javax/jdo/stub/StubPMF.java
index b903fafd..f45ec139 100644
--- a/api/src/test/java/javax/jdo/stub/StubPMF.java
+++ b/api/src/test/java/javax/jdo/stub/StubPMF.java
@@ -36,7 +36,7 @@ public class StubPMF implements PersistenceManagerFactory, Constants {
 	private static final long serialVersionUID = 488698916248368422L;
 
 	public static PersistenceManagerFactory getPersistenceManagerFactory(
-        Map props) {
+        Map<?, ?> props) {
 
         StubPMF pmf = new StubPMF();
 
@@ -57,7 +57,7 @@ public class StubPMF implements PersistenceManagerFactory, Constants {
     }
 
     public static PersistenceManagerFactory getPersistenceManagerFactory(
-        Map overrides, Map props) {
+        Map<?, ?> overrides, Map<?, ?> props) {
 
         StubPMF pmf = new StubPMF();
 
@@ -345,40 +345,40 @@ public class StubPMF implements PersistenceManagerFactory, Constants {
         public void evictAll(Object... oids) {
         }
 
-        public void evictAll(Collection oids) {
+        public void evictAll(Collection<?> oids) {
         }
 
-        public void evictAll(boolean subclasses, Class pcClass) {
+        public void evictAll(boolean subclasses, Class<?> pcClass) {
         }
 
         public void pin(Object oid) {
         }
 
-        public void pinAll(Collection oids) {
+        public void pinAll(Collection<?> oids) {
         }
 
         public void pinAll(Object... oids) {
         }
 
-        public void pinAll(boolean subclasses, Class pcClass) {
+        public void pinAll(boolean subclasses, Class<?> pcClass) {
         }
 
         public void unpin(Object oid) {
         }
 
-        public void unpinAll(Collection oids) {
+        public void unpinAll(Collection<?> oids) {
         }
 
         public void unpinAll(Object... oids) {
         }
 
-        public void unpinAll(boolean subclasses, Class pcClass) {
+        public void unpinAll(boolean subclasses, Class<?> pcClass) {
         }
     };
     }
 
     public void addInstanceLifecycleListener(
-        InstanceLifecycleListener listener, Class[] classes) {
+        InstanceLifecycleListener listener, Class<?>[] classes) {
         throw new UnsupportedOperationException("not implemented");
     }
 
@@ -549,7 +549,7 @@ public class StubPMF implements PersistenceManagerFactory, Constants {
             + name);
     }
 
-    void setProperties(Map properties) {
+    void setProperties(Map<?, ?> properties) {
         for (Object key : properties.keySet()) {
             String k = key.toString();
             Object v = properties.get(key);
diff --git a/api/src/test/java/javax/jdo/util/BatchTestRunner.java b/api/src/test/java/javax/jdo/util/BatchTestRunner.java
index 30c758f0..60355902 100644
--- a/api/src/test/java/javax/jdo/util/BatchTestRunner.java
+++ b/api/src/test/java/javax/jdo/util/BatchTestRunner.java
@@ -22,6 +22,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.io.PrintStream;
 
 import junit.framework.Test;
+import junit.framework.TestCase;
 import junit.framework.TestResult;
 import junit.framework.TestSuite;
 import junit.textui.ResultPrinter;
@@ -59,14 +60,15 @@ public class BatchTestRunner
     }
     
     /**  
-     * Constructor. USes teh specified resultPrinter to format the test result.
+     * Constructor. Uses tehe specified resultPrinter to format the test result.
      */
     public BatchTestRunner(ResultPrinter resultPrinter) {
         super(resultPrinter);
     }
 
-    /** Runs all test methods from the specified class. */
-    public static void run(Class clazz) {
+    /** Runs all test methods from the specified class.
+     * @param clazz*/
+    public static void run(Class<? extends TestCase> clazz) {
         run(new TestSuite(clazz));
     }
     
@@ -113,7 +115,7 @@ public class BatchTestRunner
                     // get class instance
                     Class<?> clazz = Class.forName(className);
                     // constructor taking PrintStream arg
-                    Constructor ctor = clazz.getConstructor(
+                    Constructor<?> ctor = clazz.getConstructor(
                         new Class[] { PrintStream.class } );
                     // create instance
                     return (ResultPrinter)ctor.newInstance(
diff --git a/api/src/test/java/javax/jdo/util/XMLTestUtil.java b/api/src/test/java/javax/jdo/util/XMLTestUtil.java
index 10681a7a..8ed53e4b 100644
--- a/api/src/test/java/javax/jdo/util/XMLTestUtil.java
+++ b/api/src/test/java/javax/jdo/util/XMLTestUtil.java
@@ -309,7 +309,7 @@ public class XMLTestUtil {
                 try {
                     BufferedReader bufferedReader =
                         new BufferedReader(new FileReader(fileUnderTest));
-                    ArrayList<String> tmp = new ArrayList<String>();
+                    ArrayList<String> tmp = new ArrayList<>();
                     while (bufferedReader.ready()) {
                         tmp.add(bufferedReader.readLine());
                     }
@@ -389,8 +389,8 @@ public class XMLTestUtil {
         private static final String JDOQUERY_DTD_FILENAME = 
             "javax/jdo/jdoquery_3_2.dtd";
 
-        static Map<String,String> publicIds = new HashMap<String,String>();
-        static Map<String,String> systemIds = new HashMap<String,String>();
+        static Map<String,String> publicIds = new HashMap<>();
+        static Map<String,String> systemIds = new HashMap<>();
         static {
             publicIds.put(RECOGNIZED_JDO_PUBLIC_ID, JDO_DTD_FILENAME);
             publicIds.put(RECOGNIZED_ORM_PUBLIC_ID, ORM_DTD_FILENAME);
@@ -442,7 +442,7 @@ public class XMLTestUtil {
     /** Helper class to find all test JDO metadata files. */
     public static class XMLFinder {
 
-        private List<File> metadataFiles = new ArrayList<File>();
+        private List<File> metadataFiles = new ArrayList<>();
         private final boolean recursive;
         
         /** Constructor. */
@@ -513,7 +513,7 @@ public class XMLTestUtil {
         String[] ret = null;
         String metadata = System.getProperty(METADATA_PROP);
         if ((metadata != null) && (metadata.length() > 0)) {
-            List<String> entries = new ArrayList<String>();
+            List<String> entries = new ArrayList<>();
             StringTokenizer st = new StringTokenizer(metadata, DELIM);
             while (st.hasMoreTokens()) {
                 entries.add(st.nextToken());
diff --git a/tck/src/main/resources/conf/jdo-signatures.txt b/tck/src/main/resources/conf/jdo-signatures.txt
index 6844ef76..ec4566ce 100644
--- a/tck/src/main/resources/conf/jdo-signatures.txt
+++ b/tck/src/main/resources/conf/jdo-signatures.txt
@@ -342,7 +342,8 @@ public class javax.jdo.identity.ByteIdentity extends javax.jdo.identity.SingleFi
     public byte getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.ByteIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -355,7 +356,8 @@ public class javax.jdo.identity.CharIdentity extends javax.jdo.identity.SingleFi
     public char getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.CharIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -368,7 +370,8 @@ public class javax.jdo.identity.IntIdentity extends javax.jdo.identity.SingleFie
     public int getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.IntIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -381,7 +384,8 @@ public class javax.jdo.identity.LongIdentity extends javax.jdo.identity.SingleFi
     public long getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.LongIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -393,7 +397,8 @@ public class javax.jdo.identity.ObjectIdentity extends javax.jdo.identity.Single
     public String toString();
     public boolean equals(Object obj);
     public int hashCode();
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.ObjectIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -406,7 +411,8 @@ public class javax.jdo.identity.ShortIdentity extends javax.jdo.identity.SingleF
     public short getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.ShortIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }
@@ -428,7 +434,8 @@ public class javax.jdo.identity.StringIdentity extends javax.jdo.identity.Single
     public String getKey();
     public String toString();
     public boolean equals(Object obj);
-    public int compareTo(Object obj);
+    public volatile int compareTo(Object);
+    public int compareTo(javax.jdo.identity.StringIdentity obj);
     public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException;
     public void readExternal(java.io.ObjectInput in) throws java.io.IOException, ClassNotFoundException;
 }