Remove unnecessary diamond operator and casting.

This commit is contained in:
Photon-GitHub 2022-07-25 13:46:43 +02:00
parent cc48e692a3
commit 5a14d943fb
4 changed files with 6 additions and 7 deletions

View File

@ -76,8 +76,7 @@ class PacketProcessingQueue extends AbstractConcurrentListenerMultimap<AsyncList
try {
this.processingQueue = Synchronization.queue(MinMaxPriorityQueue.
expectedSize(initialSize).
maximumSize(maximumSize).
<PacketEventHolder>create(), null);
maximumSize(maximumSize).create(), null);
} catch (IncompatibleClassChangeError e) {
// Print in the console
ProtocolLibrary.getErrorReporter().reportWarning(

View File

@ -77,10 +77,10 @@ public class BlockingHashMap<TKey, TValue> {
}
}
}).
build(BlockingHashMap.<TKey, TValue> newInvalidCacheLoader());
build(BlockingHashMap.newInvalidCacheLoader());
// Normal concurrent hash map
locks = new ConcurrentHashMap<TKey, Object>();
locks = new ConcurrentHashMap<>();
}
/**
@ -90,7 +90,7 @@ public class BlockingHashMap<TKey, TValue> {
* @return The created map.
*/
public static <TKey, TValue> BlockingHashMap<TKey, TValue> create() {
return new BlockingHashMap<TKey, TValue>();
return new BlockingHashMap<>();
}
/**

View File

@ -56,7 +56,7 @@ public class PacketConstructor {
private PacketConstructor(Constructor<?> constructorMethod) {
this.constructorMethod = constructorMethod;
this.unwrappers = Lists.newArrayList((Unwrapper) new BukkitUnwrapper(new RethrowErrorReporter()));
this.unwrappers = Lists.newArrayList(new BukkitUnwrapper(new RethrowErrorReporter()));
this.unwrappers.addAll(BukkitConverters.getUnwrappers());
}

View File

@ -188,7 +188,7 @@ class PluginVerifier {
* @return TRUE if the plugin has the given dependency, FALSE otherwise.
*/
private boolean hasDependency(Plugin plugin, Plugin dependency) {
return hasDependency(plugin, dependency, Sets.<String>newHashSet());
return hasDependency(plugin, dependency, new HashSet<>());
}
/**