Code cleaning

Most notable change: Remove redundant type parameters and replaced with <>. This is a small step to bring us closer to upstream parity.
This commit is contained in:
matt
2019-02-15 21:46:10 -05:00
parent 3236bdd78e
commit 85bfd16d7c
82 changed files with 1417 additions and 1406 deletions

View File

@ -185,7 +185,7 @@ public class BiomeCommands extends MethodCommands {
for (int i = 0; i < biomes.length; i++) {
int count = biomes[i];
if (count != 0) {
distribution.add(new Countable<BaseBiome>(new BaseBiome(i), count));
distribution.add(new Countable<>(new BaseBiome(i), count));
}
}
Collections.sort(distribution);

View File

@ -51,14 +51,14 @@ public abstract class HelpBuilder implements Runnable {
}
boolean isRootLevel = true;
List<String> visited = new ArrayList<String>();
List<String> visited = new ArrayList<>();
// Create the message
if (callable instanceof Dispatcher) {
Dispatcher dispatcher = (Dispatcher) callable;
// Get a list of aliases
List<CommandMapping> aliases = new ArrayList<CommandMapping>(dispatcher.getCommands());
List<CommandMapping> aliases = new ArrayList<>(dispatcher.getCommands());
List<String> prefixes = Collections.nCopies(aliases.size(), "");
// Group by callable
@ -174,7 +174,7 @@ public abstract class HelpBuilder implements Runnable {
return;
}
dispatcher = (Dispatcher) callable;
aliases = new ArrayList<CommandMapping>(dispatcher.getCommands());
aliases = new ArrayList<>(dispatcher.getCommands());
prefixes = Collections.nCopies(aliases.size(), "");
} else {
aliases = new ArrayList<>();

View File

@ -139,7 +139,7 @@ public class ScriptingCommands {
engine.setTimeLimit(worldEdit.getConfiguration().scriptTimeout);
Map<String, Object> vars = new HashMap<String, Object>();
Map<String, Object> vars = new HashMap<>();
vars.put("argv", args);
vars.put("actor", actor);

View File

@ -556,7 +556,7 @@ public class UtilityCommands extends MethodCommands {
CreatureButcher flags = new CreatureButcher(actor);
flags.fromCommand(args);
List<EntityVisitor> visitors = new ArrayList<EntityVisitor>();
List<EntityVisitor> visitors = new ArrayList<>();
LocalSession session = null;
EditSession editSession = null;
@ -616,7 +616,7 @@ public class UtilityCommands extends MethodCommands {
EntityRemover remover = new EntityRemover();
remover.fromString(typeStr);
List<EntityVisitor> visitors = new ArrayList<EntityVisitor>();
List<EntityVisitor> visitors = new ArrayList<>();
LocalSession session = null;
EditSession editSession = null;