Removes private at Enum constructors (because they aren't needed at all)

This commit is contained in:
Fuzzlemann 2017-07-23 14:16:10 +02:00
parent 0b0c9c6610
commit 28c3db5da0
12 changed files with 15 additions and 30 deletions

View File

@ -29,7 +29,7 @@ public enum Permissions {
private final String permission; private final String permission;
private Permissions(String permission) { Permissions(String permission) {
this.permission = permission; this.permission = permission;
} }

View File

@ -177,12 +177,12 @@ public enum Phrase {
private String text; private String text;
private ChatColor color; private ChatColor color;
private Phrase(String text) { Phrase(String text) {
this.text = text; this.text = text;
this.color = null; this.color = null;
} }
private Phrase(ChatColor color) { Phrase(ChatColor color) {
this.color = color; this.color = color;
this.text = ""; this.text = "";
} }

View File

@ -86,7 +86,7 @@ public enum Settings {
private final String configPath; private final String configPath;
private Boolean value; private Boolean value;
private Settings(String path) { Settings(String path) {
this.configPath = path; this.configPath = path;
} }

View File

@ -87,10 +87,7 @@ public class KillData {
if (this.date != other.date) { if (this.date != other.date) {
return false; return false;
} }
if (!Objects.equals(this.weapon, other.weapon)) { return Objects.equals(this.weapon, other.weapon) && Objects.equals(this.victim, other.victim);
return false;
}
return Objects.equals(this.victim, other.victim);
} }
@Override @Override

View File

@ -106,10 +106,7 @@ public class SessionData {
return false; return false;
} }
final SessionData other = (SessionData) obj; final SessionData other = (SessionData) obj;
if (this.sessionStart != other.sessionStart) { return this.sessionStart == other.sessionStart && this.sessionEnd == other.sessionEnd;
return false;
}
return this.sessionEnd == other.sessionEnd;
} }
@Override @Override

View File

@ -81,10 +81,7 @@ public class TPS {
if (this.date != other.date) { if (this.date != other.date) {
return false; return false;
} }
if (Double.doubleToLongBits(this.tps) != Double.doubleToLongBits(other.tps)) { return Double.doubleToLongBits(this.tps) == Double.doubleToLongBits(other.tps) && this.players == other.players;
return false;
}
return this.players == other.players;
} }
@Override @Override

View File

@ -806,10 +806,7 @@ public class UserData {
if (!Objects.equals(this.gmTimes, other.gmTimes)) { if (!Objects.equals(this.gmTimes, other.gmTimes)) {
return false; return false;
} }
if (!Objects.equals(this.playerKills, other.playerKills)) { return Objects.equals(this.playerKills, other.playerKills) && Objects.equals(this.sessions, other.sessions);
return false;
}
return Objects.equals(this.sessions, other.sessions);
} }
/** /**

View File

@ -104,17 +104,17 @@ public enum AnalysisType {
private final String modifier; private final String modifier;
private final String placeholderModifier; private final String placeholderModifier;
private AnalysisType(String placeholderModifier, String modifier) { AnalysisType(String placeholderModifier, String modifier) {
this.placeholderModifier = placeholderModifier; this.placeholderModifier = placeholderModifier;
this.modifier = modifier; this.modifier = modifier;
} }
private AnalysisType(String placeholderModifier) { AnalysisType(String placeholderModifier) {
this.placeholderModifier = placeholderModifier; this.placeholderModifier = placeholderModifier;
this.modifier = ""; this.modifier = "";
} }
private AnalysisType() { AnalysisType() {
this.placeholderModifier = ""; this.placeholderModifier = "";
this.modifier = ""; this.modifier = "";
} }

View File

@ -300,10 +300,7 @@ public abstract class PluginData {
if (!Objects.equals(this.placeholder, other.placeholder)) { if (!Objects.equals(this.placeholder, other.placeholder)) {
return false; return false;
} }
if (!Objects.equals(this.sourcePlugin, other.sourcePlugin)) { return Objects.equals(this.sourcePlugin, other.sourcePlugin) && Objects.equals(this.analysisTypes, other.analysisTypes);
return false;
}
return Objects.equals(this.analysisTypes, other.analysisTypes);
} }
@Override @Override

View File

@ -362,7 +362,7 @@ public class DataCacheHandler extends SessionCache {
if (unsavedTPSHistory.isEmpty()) { if (unsavedTPSHistory.isEmpty()) {
return new ArrayList<>(); return new ArrayList<>();
} }
List<List<TPS>> copy = new ArrayList<>(unsavedTPSHistory);; List<List<TPS>> copy = new ArrayList<>(unsavedTPSHistory);
for (List<TPS> history : copy) { for (List<TPS> history : copy) {
final long lastdate = history.get(history.size() - 1).getDate(); final long lastdate = history.get(history.size() - 1).getDate();
final double averageTPS = MathUtils.averageDouble(history.stream().map(TPS::getTps)); final double averageTPS = MathUtils.averageDouble(history.stream().map(TPS::getTps));

View File

@ -49,5 +49,5 @@ public enum InfoType {
* *
* @since 3.1.1 * @since 3.1.1
*/ */
OTHER; OTHER
} }

View File

@ -107,7 +107,7 @@ public enum Html {
private String html; private String html;
private Html(String html) { Html(String html) {
this.html = html; this.html = html;
} }