diff options
author | Ryan D. Brooks | 2015-09-28 18:49:18 +0000 |
---|---|---|
committer | Ryan D. Brooks | 2015-09-28 18:49:18 +0000 |
commit | 071fcbc5cca4e22e650bb459701f5fc9be701013 (patch) | |
tree | ac629d866ecfea675bc4e134c68315440282d560 /plugins/org.eclipse.osee.cache.admin | |
parent | b4f6f62b0d3af365b67a3786dbb24c97fa638536 (diff) | |
download | org.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.tar.gz org.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.tar.xz org.eclipse.osee-071fcbc5cca4e22e650bb459701f5fc9be701013.zip |
refactor: Use type inference when invoking a generic constructor
Change-Id: I5afeb235038dcf1dd0496930d15d6b42aeb46fec
Diffstat (limited to 'plugins/org.eclipse.osee.cache.admin')
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/CacheConfiguration.java b/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/CacheConfiguration.java index 881cd78dc45..8ac5778b4c7 100644 --- a/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/CacheConfiguration.java +++ b/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/CacheConfiguration.java @@ -20,7 +20,7 @@ import org.eclipse.osee.framework.jdk.core.type.Pair; public class CacheConfiguration { private static final int DEFAULT_UNSET = -1; - private static final Pair<Long, TimeUnit> UNSET_EXPIRATION = new Pair<Long, TimeUnit>(-1L, TimeUnit.NANOSECONDS); + private static final Pair<Long, TimeUnit> UNSET_EXPIRATION = new Pair<>(-1L, TimeUnit.NANOSECONDS); private int initialCapacity = DEFAULT_UNSET; private long maxSize = DEFAULT_UNSET; @@ -58,7 +58,7 @@ public class CacheConfiguration { } public void setExpireAfterAccess(long duration, TimeUnit timeUnit) { - this.expireAfterAccess = new Pair<Long, TimeUnit>(duration, timeUnit); + this.expireAfterAccess = new Pair<>(duration, timeUnit); } public boolean isExpireAfterWrite() { @@ -66,7 +66,7 @@ public class CacheConfiguration { } public void setExpireAfterWrite(long duration, TimeUnit timeUnit) { - this.expireAfterWrite = new Pair<Long, TimeUnit>(duration, timeUnit); + this.expireAfterWrite = new Pair<>(duration, timeUnit); } public boolean isRefreshAfterWrite() { @@ -74,7 +74,7 @@ public class CacheConfiguration { } public void setRefreshAfterWrite(long duration, TimeUnit timeUnit) { - this.refreshAfterWrite = new Pair<Long, TimeUnit>(duration, timeUnit); + this.refreshAfterWrite = new Pair<>(duration, timeUnit); } public int getInitialCapacity() { diff --git a/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/internal/CacheFactory.java b/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/internal/CacheFactory.java index 27ceb88f78e..858fff74b3f 100644 --- a/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/internal/CacheFactory.java +++ b/plugins/org.eclipse.osee.cache.admin/src/org/eclipse/osee/cache/admin/internal/CacheFactory.java @@ -35,7 +35,7 @@ public class CacheFactory { public <K, V> Cache<K, V> createCache(final CacheConfiguration config) throws Exception { Preconditions.checkNotNull(config, "cacheConfiguration"); com.google.common.cache.Cache<K, V> cache = createCacheBuilder(config).build(); - Cache<K, V> toReturn = new CacheProxy<K, V>(cache); + Cache<K, V> toReturn = new CacheProxy<>(cache); return toReturn; } @@ -62,7 +62,7 @@ public class CacheFactory { return Futures.immediateFuture(newValue); } }); - Cache<K, V> toReturn = new LoadingCacheProxy<K, V>(loadingCache, keyLoader); + Cache<K, V> toReturn = new LoadingCacheProxy<>(loadingCache, keyLoader); return toReturn; } |