Removes redundant casts and array creations

This commit is contained in:
Fuzzlemann 2017-07-23 14:07:47 +02:00
parent 0f14efbc46
commit f1ae1c3f8f
6 changed files with 6 additions and 6 deletions

View File

@ -58,7 +58,7 @@ public class PlanDeathEventListener implements Listener {
handler.addToPool(new KillInfo(killer.getUniqueId(), time, dead, itemInHand.name()));
}
if (dead instanceof Player) {
handler.addToPool(new DeathInfo(((Player) dead).getUniqueId()));
handler.addToPool(new DeathInfo(dead.getUniqueId()));
}
}
}

View File

@ -74,7 +74,7 @@ public class PunchCardGraphCreator {
for (int j = 0; j < 24; j++) {
int value = dataArray[i][j];
if (value - avg > 3 * standardDiviation) {
dataArray[i][j] = (int) (avg);
dataArray[i][j] = avg;
}
}
}

View File

@ -18,7 +18,7 @@ public class NewPlayerCreator {
* @return a new UserData object
*/
public static UserData createNewPlayer(IPlayer player) {
return createNewPlayer((IOfflinePlayer) player, player.getGamemode());
return createNewPlayer(player, player.getGamemode());
}
/**

View File

@ -45,7 +45,7 @@ public class DouglasPeckerAlgorithm {
results.addAll(results1.subList(0, results1.size() - 1));
results.addAll(results2);
} else {
return Arrays.asList(new Point[]{points.get(0), points.get(lastIndex)});
return Arrays.asList(points.get(0), points.get(lastIndex));
}
return results;
}

View File

@ -132,7 +132,7 @@ public class ExportUtility {
String playersHtml = PlayersPageResponse.buildContent(rawData);
playersfolder.mkdirs();
File playersHtmlFile = new File(playersfolder, "index.html");
Files.write(playersHtmlFile.toPath(), Arrays.asList(new String[]{playersHtml}));
Files.write(playersHtmlFile.toPath(), Arrays.asList(playersHtml));
}
}

View File

@ -194,7 +194,7 @@ public class DatabaseTest {
c.put("/roiergbnougbierubieugbeigubeigubgierbgeugeg", 3);
db.saveCommandUse(c);
assertTrue(db.removeAllData());
assertTrue("Contains the user", db.getUserDataForUUIDS(Arrays.asList(new UUID[]{MockUtils.getPlayerUUID(), MockUtils.getPlayer2UUID()})).isEmpty());
assertTrue("Contains the user", db.getUserDataForUUIDS(Arrays.asList(MockUtils.getPlayerUUID(), MockUtils.getPlayer2UUID())).isEmpty());
assertTrue("Contains commandUse", db.getCommandUse().isEmpty());
}