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 Permissions(String permission) {
Permissions(String permission) {
this.permission = permission;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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