Enable and fix Eclipse warnings about redundant type arguments

Since Java 7 it is possible to replace the type arguments required to
invoke the constructor of a generic class with an empty set of type
parameters (<>) as long as the compiler can infer the type arguments
from the context [1].

Enable the Eclipse warning about redundant type arguments, and remove
the ones it warns about.

[1] http://goo.gl/SG21kM

Change-Id: I422882949a6a6a57391580d881f73120b2843a0e
This commit is contained in:
David Pursehouse
2014-10-31 11:24:52 +09:00
parent 51e708c464
commit 41abb376ca
26 changed files with 38 additions and 41 deletions

View File

@@ -163,7 +163,7 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
SqlStore<K, V> store = newSqlStore(def.name(), def.keyType(), limit,
def.expireAfterWrite(TimeUnit.SECONDS));
H2CacheImpl<K, V> cache = new H2CacheImpl<K, V>(
H2CacheImpl<K, V> cache = new H2CacheImpl<>(
executor, store, def.keyType(),
(Cache<K, ValueHolder<V>>) defaultFactory.create(def, true).build());
synchronized (caches) {
@@ -187,9 +187,9 @@ class H2CacheFactory implements PersistentCacheFactory, LifecycleListener {
def.expireAfterWrite(TimeUnit.SECONDS));
Cache<K, ValueHolder<V>> mem = (Cache<K, ValueHolder<V>>)
defaultFactory.create(def, true)
.build((CacheLoader<K, V>) new H2CacheImpl.Loader<K, V>(
.build((CacheLoader<K, V>) new H2CacheImpl.Loader<>(
executor, store, loader));
H2CacheImpl<K, V> cache = new H2CacheImpl<K, V>(
H2CacheImpl<K, V> cache = new H2CacheImpl<>(
executor, store, def.keyType(), mem);
caches.add(cache);
return cache;