mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-23 02:55:23 +01:00
Remove redudant type parameters.
This commit is contained in:
parent
5ffade9787
commit
47fb9bd30d
@ -65,7 +65,7 @@ public String[] getIgnorePermissions() {
|
||||
* @param ignoreGroups the ignoreGroups to set
|
||||
*/
|
||||
public void setIgnoreGroups(String[] ignoreGroups) {
|
||||
Set<String> ignoreGroupsSet = new HashSet<String>();
|
||||
Set<String> ignoreGroupsSet = new HashSet<>();
|
||||
for (String group : ignoreGroups) {
|
||||
ignoreGroupsSet.add(group.toLowerCase());
|
||||
}
|
||||
@ -76,7 +76,7 @@ public void setIgnoreGroups(String[] ignoreGroups) {
|
||||
* @param ignorePermissions the ignorePermissions to set
|
||||
*/
|
||||
public void setIgnorePermissions(String[] ignorePermissions) {
|
||||
Set<String> ignorePermissionsSet = new HashSet<String>();
|
||||
Set<String> ignorePermissionsSet = new HashSet<>();
|
||||
Collections.addAll(ignorePermissionsSet, ignorePermissions);
|
||||
this.ignorePermissions = ignorePermissionsSet;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public List<String> getKeys(String node) {
|
||||
res = config.getKeys(node);
|
||||
}
|
||||
if (res == null) {
|
||||
res = new ArrayList<String>();
|
||||
res = new ArrayList<>();
|
||||
}
|
||||
|
||||
return res;
|
||||
|
@ -276,8 +276,8 @@ private <V> Collection<V> queryAllValues(@Nullable RegionAssociable subject, Fla
|
||||
|
||||
int minimumPriority = Integer.MIN_VALUE;
|
||||
|
||||
Map<ProtectedRegion, V> consideredValues = new HashMap<ProtectedRegion, V>();
|
||||
Set<ProtectedRegion> ignoredParents = new HashSet<ProtectedRegion>();
|
||||
Map<ProtectedRegion, V> consideredValues = new HashMap<>();
|
||||
Set<ProtectedRegion> ignoredParents = new HashSet<>();
|
||||
|
||||
for (ProtectedRegion region : getApplicable()) {
|
||||
if (getPriority(region) < minimumPriority) {
|
||||
@ -374,7 +374,7 @@ public <V> V getEffectiveFlag(final ProtectedRegion region, Flag<V> flag, @Nulla
|
||||
|
||||
ProtectedRegion current = region;
|
||||
|
||||
List<ProtectedRegion> seen = new ArrayList<ProtectedRegion>();
|
||||
List<ProtectedRegion> seen = new ArrayList<>();
|
||||
|
||||
while (current != null) {
|
||||
seen.add(current);
|
||||
|
@ -74,7 +74,7 @@ public Set<T> parseInput(FlagContext context) throws InvalidFlagFormat {
|
||||
public Set<T> unmarshal(Object o) {
|
||||
if (o instanceof Collection<?>) {
|
||||
Collection<?> collection = (Collection<?>) o;
|
||||
Set<T> items = new HashSet<T>();
|
||||
Set<T> items = new HashSet<>();
|
||||
|
||||
for (Object sub : collection) {
|
||||
T item = subFlag.unmarshal(sub);
|
||||
@ -91,7 +91,7 @@ public Set<T> unmarshal(Object o) {
|
||||
|
||||
@Override
|
||||
public Object marshal(Set<T> o) {
|
||||
List<Object> list = new ArrayList<Object>();
|
||||
List<Object> list = new ArrayList<>();
|
||||
for (T item : o) {
|
||||
list.add(subFlag.marshal(item));
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ public Set<ProtectedRegion> loadAll(FlagRegistry flagRegistry) {
|
||||
|
||||
@Override
|
||||
public void saveAll(Set<ProtectedRegion> regions) {
|
||||
this.regions = Collections.unmodifiableSet(new HashSet<ProtectedRegion>(regions));
|
||||
this.regions = Collections.unmodifiableSet(new HashSet<>(regions));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,7 +81,7 @@ public RegionDatabase get(String id) {
|
||||
|
||||
@Override
|
||||
public List<RegionDatabase> getAll() throws StorageException {
|
||||
List<RegionDatabase> stores = new ArrayList<RegionDatabase>();
|
||||
List<RegionDatabase> stores = new ArrayList<>();
|
||||
|
||||
File files[] = rootDir.listFiles();
|
||||
if (files != null) {
|
||||
|
@ -116,7 +116,7 @@ private void executeSave(Set<ProtectedRegion> toUpdate, @Nullable Set<ProtectedR
|
||||
}
|
||||
|
||||
if (toRemove != null) {
|
||||
List<String> removeNames = new ArrayList<String>();
|
||||
List<String> removeNames = new ArrayList<>();
|
||||
for (ProtectedRegion region : toRemove) {
|
||||
removeNames.add(region.getId());
|
||||
}
|
||||
@ -144,7 +144,7 @@ private void executeSave(Set<ProtectedRegion> toUpdate, @Nullable Set<ProtectedR
|
||||
}
|
||||
|
||||
private Map<String, String> getExistingRegions() throws SQLException {
|
||||
Map<String, String> existing = new HashMap<String, String>();
|
||||
Map<String, String> existing = new HashMap<>();
|
||||
|
||||
Closer closer = Closer.create();
|
||||
try {
|
||||
|
@ -43,9 +43,9 @@ class RegionInserter {
|
||||
private final DataSourceConfig config;
|
||||
private final Connection conn;
|
||||
private final int worldId;
|
||||
private final List<ProtectedRegion> all = new ArrayList<ProtectedRegion>();
|
||||
private final List<ProtectedCuboidRegion> cuboids = new ArrayList<ProtectedCuboidRegion>();
|
||||
private final List<ProtectedPolygonalRegion> polygons = new ArrayList<ProtectedPolygonalRegion>();
|
||||
private final List<ProtectedRegion> all = new ArrayList<>();
|
||||
private final List<ProtectedCuboidRegion> cuboids = new ArrayList<>();
|
||||
private final List<ProtectedPolygonalRegion> polygons = new ArrayList<>();
|
||||
|
||||
RegionInserter(DataUpdater updater) {
|
||||
this.config = updater.config;
|
||||
|
@ -82,7 +82,7 @@ public RegionDatabase get(String name) {
|
||||
public List<RegionDatabase> getAll() throws StorageException {
|
||||
Closer closer = Closer.create();
|
||||
try {
|
||||
List<RegionDatabase> stores = new ArrayList<RegionDatabase>();
|
||||
List<RegionDatabase> stores = new ArrayList<>();
|
||||
Connection connection = closer.register(getConnection());
|
||||
Statement stmt = connection.createStatement();
|
||||
ResultSet rs = closer.register(stmt.executeQuery("SELECT name FROM " + config.getTablePrefix() + "world"));
|
||||
@ -148,7 +148,7 @@ private void migrate() throws SQLException, StorageException {
|
||||
}
|
||||
|
||||
// Our placeholders
|
||||
Map<String, String> placeHolders = new HashMap<String, String>();
|
||||
Map<String, String> placeHolders = new HashMap<>();
|
||||
placeHolders.put("tablePrefix", config.getTablePrefix());
|
||||
|
||||
Flyway flyway = new Flyway();
|
||||
|
@ -92,7 +92,7 @@ public void setLocatorPolicy(UserLocatorPolicy locatorPolicy) {
|
||||
@Override
|
||||
public DefaultDomain call() throws UnresolvedNamesException {
|
||||
DefaultDomain domain = new DefaultDomain();
|
||||
List<String> namesToQuery = new ArrayList<String>();
|
||||
List<String> namesToQuery = new ArrayList<>();
|
||||
|
||||
for (String s : input) {
|
||||
Matcher m = GROUP_PATTERN.matcher(s);
|
||||
|
@ -110,7 +110,7 @@ public synchronized void remove(long key) {
|
||||
}
|
||||
|
||||
public synchronized ArrayList<EntryBase> entries() {
|
||||
ArrayList<EntryBase> ret = new ArrayList<EntryBase>();
|
||||
ArrayList<EntryBase> ret = new ArrayList<>();
|
||||
|
||||
for (EntryBase[][] outer : this.values) {
|
||||
if (outer == null) continue;
|
||||
|
@ -43,7 +43,7 @@ public synchronized V get(long key) {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public synchronized ArrayList<V> values() {
|
||||
ArrayList<V> ret = new ArrayList<V>();
|
||||
ArrayList<V> ret = new ArrayList<>();
|
||||
|
||||
ArrayList<EntryBase> entries = entries();
|
||||
|
||||
|
@ -171,7 +171,7 @@ public Builder() {
|
||||
public Builder permit(String ... rules) {
|
||||
checkNotNull(rules);
|
||||
if (permitted == null) {
|
||||
permitted = new HashSet<String>();
|
||||
permitted = new HashSet<>();
|
||||
}
|
||||
permitted.addAll(Arrays.asList(rules));
|
||||
return this;
|
||||
@ -186,7 +186,7 @@ public Builder permit(String ... rules) {
|
||||
public Builder deny(String ... rules) {
|
||||
checkNotNull(rules);
|
||||
if (denied == null) {
|
||||
denied = new HashSet<String>();
|
||||
denied = new HashSet<>();
|
||||
}
|
||||
denied.addAll(Arrays.asList(rules));
|
||||
return this;
|
||||
@ -199,8 +199,8 @@ public Builder deny(String ... rules) {
|
||||
*/
|
||||
public CommandFilter build() {
|
||||
return new CommandFilter(
|
||||
permitted != null ? new HashSet<String>(permitted) : null,
|
||||
denied != null ? new HashSet<String>(denied) : null);
|
||||
permitted != null ? new HashSet<>(permitted) : null,
|
||||
denied != null ? new HashSet<>(denied) : null);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,7 @@ public static ExecutorService newBoundedCachedThreadPool(int minThreads, int max
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
|
||||
minThreads, maxThreads,
|
||||
60L, TimeUnit.SECONDS,
|
||||
new LinkedBlockingDeque<Runnable>(queueSize));
|
||||
new LinkedBlockingDeque<>(queueSize));
|
||||
threadPoolExecutor.allowCoreThreadTimeOut(true);
|
||||
return threadPoolExecutor;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ public static Closer create() {
|
||||
final Suppressor suppressor;
|
||||
|
||||
// only need space for 2 elements in most cases, so try to use the smallest array possible
|
||||
private final Deque<Closeable> stack = new ArrayDeque<Closeable>(4);
|
||||
private final Deque<Closeable> stack = new ArrayDeque<>(4);
|
||||
private Throwable thrown;
|
||||
|
||||
@VisibleForTesting
|
||||
|
@ -29,7 +29,7 @@
|
||||
*/
|
||||
public class CancelLogger {
|
||||
|
||||
private List<CancelAttempt> entries = new ArrayList<CancelAttempt>();
|
||||
private List<CancelAttempt> entries = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Log a call.
|
||||
|
@ -75,7 +75,7 @@ public <T extends Event & Cancellable> Entry getIfNotPresent(K key, Cancellable
|
||||
}
|
||||
|
||||
public static <K> EventDebounce<K> create(int debounceTime) {
|
||||
return new EventDebounce<K>(debounceTime);
|
||||
return new EventDebounce<>(debounceTime);
|
||||
}
|
||||
|
||||
public static class Entry {
|
||||
|
Loading…
Reference in New Issue
Block a user