openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r768588 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/util/ openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ openjpa-persistence-jdbc/src/main/j...
Date Sat, 25 Apr 2009 19:29:07 GMT
Author: ppoddar
Date: Sat Apr 25 19:29:07 2009
New Revision: 768588

URL: http://svn.apache.org/viewvc?rev=768588&view=rev
Log:
OPENJPA-1050: Use parameterized type whenever applicable

Modified:
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
    openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
    openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
    openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
    openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java?rev=768588&r1=768587&r2=768588&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/AbstractBrokerFactory.java
Sat Apr 25 19:29:07 2009
@@ -23,7 +23,6 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
@@ -71,6 +70,7 @@
  *
  * @author Abe White
  */
+@SuppressWarnings("serial")
 public abstract class AbstractBrokerFactory
     implements BrokerFactory {
 
@@ -78,33 +78,34 @@
         (AbstractBrokerFactory.class);
 
     // static mapping of configurations to pooled broker factories
-    private static final Map _pool = Collections.synchronizedMap(new HashMap());
+    private static final Map<Object,AbstractBrokerFactory> _pool = 
+       Collections.synchronizedMap(new HashMap<Object,AbstractBrokerFactory>());
 
     // configuration
     private final OpenJPAConfiguration _conf;
     private transient boolean _readOnly = false;
     private transient boolean _closed = false;
     private transient RuntimeException _closedException = null;
-    private Map _userObjects = null;
+    private Map<Object,Object> _userObjects = null;
 
     // internal lock: spec forbids synchronization on this object
     private final ReentrantLock _lock = new ReentrantLock();
 
     // maps global transactions to associated brokers
-    private transient ConcurrentHashMap _transactional
-        = new ConcurrentHashMap();
+    private transient ConcurrentHashMap<Object,Collection<Broker>> 
+        _transactional = new ConcurrentHashMap<Object,Collection<Broker>>();
 
     // weak-ref tracking of open brokers
-    private transient Set _brokers;
+    private transient Set<Broker> _brokers;
 
     // cache the class names loaded from the persistent classes property so
     // that we can re-load them for each new broker
-    private transient Collection _pcClassNames = null;
-    private transient Collection _pcClassLoaders = null;
+    private transient Collection<String> _pcClassNames = null;
+    private transient Collection<ClassLoader> _pcClassLoaders = null;
     private transient boolean _persistentTypesLoaded = false;
 
     // lifecycle listeners to pass to each broker
-    private transient Map _lifecycleListeners = null;
+    private transient Map<Object, Class<?>[]> _lifecycleListeners = null;
 
     // transaction listeners to pass to each broker
     private transient List _transactionListeners = null;
@@ -285,16 +286,16 @@
         // cache persistent type names if not already
         ClassLoader loader = _conf.getClassResolverInstance().
             getClassLoader(getClass(), envLoader);
-        Collection toRedefine = new ArrayList();
+        Collection<Class<?>> toRedefine = new ArrayList<Class<?>>();
         if (!_persistentTypesLoaded) {
-            Collection clss = _conf.getMetaDataRepositoryInstance().
+            Collection<Class<?>> clss = _conf.getMetaDataRepositoryInstance().
                 loadPersistentTypes(false, loader, _conf.isInitializeEagerly());
             if (clss.isEmpty())
                 _pcClassNames = Collections.EMPTY_SET;
             else {
-                Collection c = new ArrayList(clss.size());
-                for (Iterator itr = clss.iterator(); itr.hasNext();) {
-                    Class cls = (Class) itr.next();
+                Collection<String> c = new ArrayList<String>(clss.size());
+                for (Iterator<Class<?>> itr = clss.iterator(); itr.hasNext();)
{
+                    Class<?> cls = itr.next();
                     c.add(cls.getName());
                     if (needsSub(cls))
                         toRedefine.add(cls);
@@ -335,7 +336,7 @@
         try {
             assertOpen();
             if (_lifecycleListeners == null)
-                _lifecycleListeners = new HashMap(7);
+                _lifecycleListeners = new HashMap<Object, Class<?>[]>(7);
             _lifecycleListeners.put(listener, classes);
         } finally {
             unlock();
@@ -491,7 +492,7 @@
                 return (_userObjects == null) ? null : _userObjects.remove(key);
 
             if (_userObjects == null)
-                _userObjects = new HashMap();
+                _userObjects = new HashMap<Object,Object>();
             return _userObjects.put(key, val);
         } finally {
             unlock();

Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java?rev=768588&r1=768587&r2=768588&view=diff
==============================================================================
--- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
(original)
+++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/AbstractLRSProxyMap.java
Sat Apr 25 19:29:07 2009
@@ -33,7 +33,6 @@
 import org.apache.commons.collections.Predicate;
 import org.apache.commons.collections.iterators.FilterIterator;
 import org.apache.commons.collections.iterators.IteratorChain;
-import org.apache.openjpa.conf.OpenJPAConfiguration;
 import org.apache.openjpa.kernel.OpenJPAStateManager;
 import org.apache.openjpa.lib.util.Closeable;
 import org.apache.openjpa.lib.util.Localizer;
@@ -50,8 +49,8 @@
  *
  * @author Abe White
  */
-public abstract class AbstractLRSProxyMap
-    implements Map, LRSProxy, MapChangeTracker, Predicate {
+public abstract class AbstractLRSProxyMap<K,V>
+    implements Map<K,V>, LRSProxy, MapChangeTracker, Predicate {
 
     private static final int MODE_KEY = 0;
     private static final int MODE_VALUE = 1;
@@ -60,18 +59,18 @@
     private static final Localizer _loc = Localizer.forPackage
         (AbstractLRSProxyMap.class);
 
-    private Class _keyType = null;
-    private Class _valueType = null;
+    private Class<K> _keyType = null;
+    private Class<V> _valueType = null;
     private MapChangeTrackerImpl _ct = null;
     private OpenJPAStateManager _sm = null;
     private int _field = -1;
     private OpenJPAStateManager _origOwner = null;
     private int _origField = -1;
-    private Map _map = null;
+    private Map<K,V> _map = null;
     private int _count = -1;
     private boolean _iterated = false;
 
-    public AbstractLRSProxyMap(Class keyType, Class valueType) {
+    public AbstractLRSProxyMap(Class<K> keyType, Class<V> valueType) {
         _keyType = keyType;
         _valueType = valueType;
         _ct = new MapChangeTrackerImpl(this);
@@ -173,7 +172,7 @@
         }
 
         // key tracking
-        Collection keys = keys(val);
+        Collection<K> keys = keys(val);
         if (keys == null || keys.isEmpty())
             return false;
         keys.removeAll(_ct.getRemoved());
@@ -181,27 +180,27 @@
         return keys.size() > 0;
     }
 
-    public Object get(Object key) {
+    public V get(Object key) {
         if (_keyType != null && !_keyType.isInstance(key))
             return null;
-        Object ret = (_map == null) ? null : _map.get(key);
+        V ret = (_map == null) ? null : _map.get(key);
         if (ret != null)
             return ret;
         if (_ct.getTrackKeys() && _ct.getRemoved().contains(key))
             return null;
-        Object val = value(key);
+        V val = value(key);
         if (!_ct.getTrackKeys() && _ct.getRemoved().contains(val))
             return null;
         return val;
     }
 
-    public Object put(Object key, Object value) {
+    public V put(K key, V value) {
         Proxies.assertAllowedType(key, _keyType);
         Proxies.assertAllowedType(value, _valueType);
         Proxies.dirty(this, false);
         if (_map == null)
-            _map = new HashMap();
-        Object old = _map.put(key, value);
+            _map = new HashMap<K,V>();
+        V old = _map.put(key, value);
         if (old == null && (!_ct.getTrackKeys()
             || !_ct.getRemoved().contains(key)))
             old = value(key);
@@ -213,17 +212,15 @@
         return old;
     }
 
-    public void putAll(Map m) {
-        Map.Entry entry;
-        for (Iterator itr = m.entrySet().iterator(); itr.hasNext();) {
-            entry = (Map.Entry) itr.next();
+    public void putAll(Map<? extends K,? extends V> m) {
+        for (Map.Entry<? extends K, ? extends V> entry : m.entrySet()) {
             put(entry.getKey(), entry.getValue());
         }
     }
 
-    public Object remove(Object key) {
+    public V remove(Object key) {
         Proxies.dirty(this, false);
-        Object old = (_map == null) ? null : _map.remove(key);
+        V old = (_map == null) ? null : _map.remove(key);
         if (old == null && (!_ct.getTrackKeys()
             || !_ct.getRemoved().contains(key)))
             old = value(key);
@@ -239,9 +236,9 @@
         Proxies.dirty(this, false);
         Itr itr = iterator(MODE_ENTRY);
         try {
-            Map.Entry entry;
+            Map.Entry<K,V> entry;
             while (itr.hasNext()) {
-                entry = (Map.Entry) itr.next();
+                entry = (Map.Entry<K,V>) itr.next();
                 Proxies.removed(this, entry.getKey(), true);
                 Proxies.removed(this, entry.getValue(), false);
                 _ct.removed(entry.getKey(), entry.getValue());
@@ -252,8 +249,8 @@
         }
     }
 
-    public Set keySet() {
-        return new AbstractSet() {
+    public Set<K> keySet() {
+        return new AbstractSet<K>() {
             public int size() {
                 return AbstractLRSProxyMap.this.size();
             }
@@ -262,31 +259,31 @@
                 return AbstractLRSProxyMap.this.remove(o) != null;
             }
 
-            public Iterator iterator() {
+            public Iterator<K> iterator() {
                 return AbstractLRSProxyMap.this.iterator(MODE_KEY);
             }
         };
     }
 
-    public Collection values() {
-        return new AbstractCollection() {
+    public Collection<V> values() {
+        return new AbstractCollection<V>() {
             public int size() {
                 return AbstractLRSProxyMap.this.size();
             }
 
-            public Iterator iterator() {
+            public Iterator<V> iterator() {
                 return AbstractLRSProxyMap.this.iterator(MODE_VALUE);
             }
         };
     }
 
-    public Set entrySet() {
-        return new AbstractSet() {
+    public Set<Map.Entry<K, V>> entrySet() {
+        return new AbstractSet<Map.Entry<K, V>>() {
             public int size() {
                 return AbstractLRSProxyMap.this.size();
             }
 
-            public Iterator iterator() {
+            public Iterator<Map.Entry<K, V>> iterator() {
                 return AbstractLRSProxyMap.this.iterator(MODE_ENTRY);
             }
         };
@@ -296,10 +293,10 @@
         throws ObjectStreamException {
         Itr itr = iterator(MODE_ENTRY);
         try {
-            Map map = new HashMap();
-            Map.Entry entry;
+            Map<K,V> map = new HashMap<K,V>();
+            Map.Entry<K,V> entry;
             while (itr.hasNext()) {
-                entry = (Map.Entry) itr.next();
+                entry = (Map.Entry<K,V>) itr.next();
                 map.put(entry.getKey(), entry.getValue());
             }
             return map;
@@ -321,12 +318,12 @@
     /**
      * Return all keys for the given value.
      */
-    protected abstract Collection keys(Object value);
+    protected abstract Collection<K> keys(Object value);
 
     /**
      * Return the value of the given key.
      */
-    protected abstract Object value(Object key);
+    protected abstract V value(Object key);
 
     /**
      * Implement this method to return an iterator over the entries
@@ -336,7 +333,7 @@
      * {@link Iterator#remove} method, and may implement
      * {@link org.apache.openjpa.lib.util.Closeable}.
      */
-    protected abstract Iterator itr();
+    protected abstract Iterator<?> itr();
 
     /**
      * Return the number of entries in the map, or {@link Integer#MAX_VALUE}.

Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java?rev=768588&r1=768587&r2=768588&view=diff
==============================================================================
--- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
(original)
+++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/concurrent/ConcurrentReferenceHashSet.java
Sat Apr 25 19:29:07 2009
@@ -35,7 +35,8 @@
  * @author Abe White
  * @nojavadoc
  */
-public class ConcurrentReferenceHashSet implements Set, Serializable {
+@SuppressWarnings("serial")
+public class ConcurrentReferenceHashSet<E> implements Set<E>, Serializable {
 
     /**
      * Hard reference marker.
@@ -54,7 +55,7 @@
 
     private static final Object DUMMY_VAL = new Object();
 
-    private final Set _set;
+    private final Set<E> _set;
 
     /**
      * Construct a set with the given reference type.
@@ -70,11 +71,11 @@
         }
     }
 
-    public boolean add(Object obj) {
+    public boolean add(E obj) {
         return _set.add(obj);
     }
 
-    public boolean addAll(Collection coll) {
+    public boolean addAll(Collection<? extends E> coll) {
         return _set.addAll(coll);
     }
 
@@ -86,7 +87,7 @@
         return _set.contains(obj);
     }
 
-    public boolean containsAll(Collection coll) {
+    public boolean containsAll(Collection<?> coll) {
         return _set.containsAll(coll);
     }
 
@@ -94,7 +95,7 @@
         return _set.isEmpty();
     }
 
-    public Iterator iterator() {
+    public Iterator<E> iterator() {
         return _set.iterator();
     }
 
@@ -102,11 +103,11 @@
         return _set.remove(obj);
     }
 
-    public boolean removeAll(Collection coll) {
+    public boolean removeAll(Collection<?> coll) {
         return _set.removeAll(coll);
     }
 
-    public boolean retainAll(Collection coll) {
+    public boolean retainAll(Collection<?> coll) {
         return _set.retainAll(coll);
     }
 
@@ -118,7 +119,7 @@
         return _set.toArray();
     }
 
-    public Object[] toArray(Object[] arr) {
+    public <T> T[] toArray(T[] arr) {
         return _set.toArray(arr);
     }
 

Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java?rev=768588&r1=768587&r2=768588&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
(original)
+++ openjpa/trunk/openjpa-persistence-jdbc/src/main/java/org/apache/openjpa/persistence/jdbc/AnnotationPersistenceMappingParser.java
Sat Apr 25 19:29:07 2009
@@ -1865,7 +1865,7 @@
      */
     protected void setMapKeyColumn(FieldMapping fm, MappingInfo info,
         Column col, int unique) {
-        List cols = new ArrayList();
+        List<Column> cols = new ArrayList<Column>();
         cols.add(col);
         info.setColumns(cols);
         if (unique == TRUE)

Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=768588&r1=768587&r2=768588&view=diff
==============================================================================
--- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
(original)
+++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java
Sat Apr 25 19:29:07 2009
@@ -185,8 +185,8 @@
     private static final Localizer _loc = Localizer.forPackage
         (AnnotationPersistenceMetaDataParser.class);
 
-    private static final Map<Class, MetaDataTag> _tags =
-        new HashMap<Class, MetaDataTag>();
+    private static final Map<Class<?>, MetaDataTag> _tags =
+        new HashMap<Class<?>, MetaDataTag>();
 
     static {
         _tags.put(Access.class, ACCESS);
@@ -405,7 +405,7 @@
     /**
      * Parse persistence metadata for the given class.
      */
-    public void parse(Class cls) {
+    public void parse(Class<?> cls) {
         if (_log.isTraceEnabled())
             _log.trace(_loc.get("parse-class", cls.getName()));
 
@@ -548,7 +548,6 @@
 
         Entity entity = _cls.getAnnotation(Entity.class);
         MappedSuperclass mapped = _cls.getAnnotation(MappedSuperclass.class);
-        Embeddable embeddable = _cls.getAnnotation(Embeddable.class);
         if (isMetaDataMode()) {
             meta.setAbstract(mapped != null);
             // while the spec only provides for embedded exclusive, it doesn't
@@ -772,7 +771,7 @@
         if (_file != null)
             return _file;
 
-        Class cls = _cls;
+        Class<?> cls = _cls;
         while (cls.getEnclosingClass() != null)
             cls = cls.getEnclosingClass();
 
@@ -893,9 +892,9 @@
      */
     private Collection<LifecycleCallbacks>[] parseEntityListeners
         (ClassMetaData meta, EntityListeners listeners) {
-        Class[] classes = listeners.value();
+        Class<?>[] classes = listeners.value();
         Collection<LifecycleCallbacks>[] parsed = null;
-        for (Class cls : classes)
+        for (Class<?> cls : classes)
             parsed = parseCallbackMethods(cls, parsed, true, true, 
                 getRepository());
         return parsed;
@@ -910,7 +909,7 @@
      * @param listener whether this is a listener or not
      */
     public static Collection<LifecycleCallbacks>[] parseCallbackMethods
-        (Class cls, Collection<LifecycleCallbacks>[] callbacks, boolean sups,
+        (Class<?> cls, Collection<LifecycleCallbacks>[] callbacks, boolean sups,
         boolean listener, MetaDataRepository repos) {
 
         if (cls == null)
@@ -921,7 +920,7 @@
             getInstance());
 
         int mods;
-        Class sup = cls;
+        Class<?> sup = cls;
         MethodKey key;
         Set<MethodKey> seen = new HashSet<MethodKey>();
         do {
@@ -960,7 +959,7 @@
                 for (int i = 0; i < events.length; i++) {
                     int e = events[i];
                     if (callbacks[e] == null)
-                        callbacks[e] = new ArrayList(3);
+                        callbacks[e] = new ArrayList<LifecycleCallbacks>(3);
                     MetaDataParsers.validateMethodsForSameCallback(cls, 
                         callbacks[e], m, tag, conf, repos.getLog());
                     if (listener) {
@@ -1062,8 +1061,8 @@
                 meta, attr.name()));
 
         field.setInFetchGroup(fg.getName(), true);
-        Set parentFetchGroups = fg.getContainedBy();
-        for (Object parentFetchGroup:parentFetchGroups)
+        Set<String> parentFetchGroups = fg.getContainedBy();
+        for (Object parentFetchGroup : parentFetchGroups)
         	field.setInFetchGroup(parentFetchGroup.toString(), true);
         if (attr.recursionDepth() != Integer.MIN_VALUE)
             fg.setRecursionDepth(field, attr.recursionDepth());
@@ -1265,7 +1264,7 @@
     /**
      * Convert the given class to its OpenJPA type override equivalent.
      */
-    private static Class toOverrideType(Class cls) {
+    private static Class<?> toOverrideType(Class<?> cls) {
         return (cls == Entity.class)
             ? org.apache.openjpa.enhance.PersistenceCapable.class : cls;
     }
@@ -1349,7 +1348,7 @@
      * Parse @Basic. Given annotation may be null.
      */
     private void parseBasic(FieldMetaData fmd, Basic anno, boolean lob) {
-        Class type = fmd.getDeclaredType();
+        Class<?> type = fmd.getDeclaredType();
         if (lob && type != String.class
             && type != char[].class && type != Character[].class
             && type != byte[].class && type != Byte[].class)
@@ -1745,7 +1744,7 @@
         meta.setSchema(schema);
         meta.setCatalog(catalog);
         meta.setSource(getSourceFile(), (el instanceof Class) ? el : null,
-            meta.SRC_ANNOTATIONS);
+            SourceTracker.SRC_ANNOTATIONS);
     }
 
     /**
@@ -1765,7 +1764,7 @@
 
             meta = getRepository().searchQueryMetaDataByName(query.name());
             if (meta != null) {
-            	Class definingType = meta.getDefiningType();
+            	Class<?> definingType = meta.getDefiningType();
                 if ((definingType == null || definingType != _cls) 
                   && _log.isWarnEnabled()) {
                     _log.warn(_loc.get("dup-query", query.name(), el, 
@@ -1781,7 +1780,7 @@
                 meta.addHint(hint.name(), hint.value());
 
             meta.setSource(getSourceFile(), (el instanceof Class) ? el : null,
-                meta.SRC_ANNOTATIONS);
+                SourceTracker.SRC_ANNOTATIONS);
             if (isMetaDataMode())
                 meta.setSourceMode(MODE_META);
             else if (isMappingMode())
@@ -1810,7 +1809,7 @@
 
             meta = getRepository().searchQueryMetaDataByName(query.name());
             if (meta != null) {
-            	Class defType = meta.getDefiningType();
+            	Class<?> defType = meta.getDefiningType();
                 if ((defType != _cls) && _log.isWarnEnabled()) {
                     _log.warn(_loc.get("dup-query", query.name(), el, defType));
                 }
@@ -1820,7 +1819,7 @@
             meta = getRepository().addQueryMetaData(null, query.name());
             meta.setQueryString(query.query());
             meta.setLanguage(QueryLanguages.LANG_SQL);
-            Class res = query.resultClass();
+            Class<?> res = query.resultClass();
             if (ImplHelper.isManagedType(getConfiguration(), res))
                 meta.setCandidateType(res);
             else if (!void.class.equals(res))
@@ -1832,7 +1831,7 @@
                 meta.addHint(hint.name(), hint.value());
 
             meta.setSource(getSourceFile(), (el instanceof Class) ? el : null,
-                meta.SRC_ANNOTATIONS);
+                SourceTracker.SRC_ANNOTATIONS);
             if (isMetaDataMode())
                 meta.setSourceMode(MODE_META);
             else if (isMappingMode())
@@ -1863,7 +1862,7 @@
 
         public int hashCode() {
             int code = 46 * 12 + _method.getName().hashCode();
-            for (Class param : _method.getParameterTypes())
+            for (Class<?> param : _method.getParameterTypes())
                 code = 46 * code + param.hashCode();
             return code;
         }
@@ -1879,7 +1878,7 @@
         }
     }
 
-    private static class MethodComparator implements Comparator {
+    private static class MethodComparator implements Comparator<Method> {
 
         private static MethodComparator INSTANCE = null;
 
@@ -1889,12 +1888,9 @@
             return INSTANCE;
         }
 
-        public int compare(Object o1, Object o2) {
-            Method m1 = (Method) o1;
-            Method m2 = (Method) o2;
-
-            Class c1 = m1.getDeclaringClass();
-            Class c2 = m2.getDeclaringClass();
+        public int compare(Method m1, Method m2) {
+            Class<?> c1 = m1.getDeclaringClass();
+            Class<?> c2 = m2.getDeclaringClass();
             if (!c1.equals(c2)) {
                 if (c1.isAssignableFrom(c2))
                     return -1;



Mime
View raw message