Rank.java

1
package sh.okx.rankup.ranks;
2
3
import java.util.List;
4
import lombok.AccessLevel;
5
import lombok.EqualsAndHashCode;
6
import lombok.Getter;
7
import lombok.RequiredArgsConstructor;
8
import org.bukkit.Bukkit;
9
import org.bukkit.configuration.ConfigurationSection;
10
import org.bukkit.entity.Player;
11
import sh.okx.rankup.RankupPlugin;
12
import sh.okx.rankup.ranks.requirements.RankRequirements;
13
import sh.okx.rankup.requirements.Requirement;
14
15 59 1. canEqual : replaced boolean return with false for sh/okx/rankup/ranks/Rank::canEqual → SURVIVED
2. canEqual : replaced boolean return with true for sh/okx/rankup/ranks/Rank::canEqual → SURVIVED
3. equals : negated conditional → SURVIVED
4. equals : negated conditional → SURVIVED
5. equals : negated conditional → SURVIVED
6. equals : negated conditional → NO_COVERAGE
7. equals : negated conditional → SURVIVED
8. equals : negated conditional → NO_COVERAGE
9. equals : negated conditional → NO_COVERAGE
10. equals : negated conditional → NO_COVERAGE
11. equals : negated conditional → NO_COVERAGE
12. equals : negated conditional → NO_COVERAGE
13. equals : negated conditional → NO_COVERAGE
14. equals : negated conditional → NO_COVERAGE
15. equals : negated conditional → NO_COVERAGE
16. equals : negated conditional → NO_COVERAGE
17. equals : negated conditional → NO_COVERAGE
18. equals : negated conditional → NO_COVERAGE
19. equals : negated conditional → NO_COVERAGE
20. equals : negated conditional → NO_COVERAGE
21. equals : negated conditional → NO_COVERAGE
22. equals : negated conditional → NO_COVERAGE
23. equals : negated conditional → NO_COVERAGE
24. equals : negated conditional → NO_COVERAGE
25. equals : negated conditional → NO_COVERAGE
26. equals : replaced boolean return with false for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
27. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
28. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
29. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
30. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
31. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
32. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
33. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
34. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE
35. hashCode : Replaced integer multiplication with division → NO_COVERAGE
36. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
37. hashCode : Replaced integer multiplication with division → NO_COVERAGE
38. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
39. hashCode : Replaced integer multiplication with division → NO_COVERAGE
40. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
41. hashCode : Replaced integer multiplication with division → NO_COVERAGE
42. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
43. hashCode : Replaced integer multiplication with division → NO_COVERAGE
44. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
45. hashCode : Replaced integer multiplication with division → NO_COVERAGE
46. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
47. hashCode : Replaced integer multiplication with division → NO_COVERAGE
48. hashCode : Replaced integer addition with subtraction → NO_COVERAGE
49. hashCode : negated conditional → NO_COVERAGE
50. hashCode : negated conditional → NO_COVERAGE
51. hashCode : negated conditional → NO_COVERAGE
52. hashCode : negated conditional → NO_COVERAGE
53. hashCode : negated conditional → NO_COVERAGE
54. hashCode : negated conditional → NO_COVERAGE
55. hashCode : negated conditional → NO_COVERAGE
56. hashCode : replaced int return with 0 for sh/okx/rankup/ranks/Rank::hashCode → NO_COVERAGE
57. equals : negated conditional → KILLED
58. equals : replaced boolean return with false for sh/okx/rankup/ranks/Rank::equals → KILLED
59. equals : replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → KILLED
@EqualsAndHashCode
16
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
17
public class Rank {
18 1 1. getSection : replaced return value with null for sh/okx/rankup/ranks/Rank::getSection → KILLED
  @Getter
19
  protected final ConfigurationSection section;
20
  protected final RankupPlugin plugin;
21 1 1. getNext : replaced return value with "" for sh/okx/rankup/ranks/Rank::getNext → KILLED
  @Getter
22
  protected final String next;
23 1 1. getRank : replaced return value with "" for sh/okx/rankup/ranks/Rank::getRank → KILLED
  @Getter
24
  protected final String rank;
25 1 1. getDisplayName : replaced return value with "" for sh/okx/rankup/ranks/Rank::getDisplayName → KILLED
  @Getter
26
  protected final String displayName;
27 1 1. getRequirements : replaced return value with null for sh/okx/rankup/ranks/Rank::getRequirements → KILLED
  @Getter
28
  protected final RankRequirements requirements;
29 1 1. getCommands : replaced return value with Collections.emptyList for sh/okx/rankup/ranks/Rank::getCommands → NO_COVERAGE
  @Getter
30
  protected final List<String> commands;
31
32
  public boolean isIn(Player player) {
33 2 1. isIn : replaced boolean return with false for sh/okx/rankup/ranks/Rank::isIn → KILLED
2. isIn : replaced boolean return with true for sh/okx/rankup/ranks/Rank::isIn → KILLED
    return plugin.getPermissions().inGroup(player.getUniqueId(), rank);
34
  }
35
36
  public boolean hasRequirements(Player player) {
37 2 1. hasRequirements : replaced boolean return with false for sh/okx/rankup/ranks/Rank::hasRequirements → KILLED
2. hasRequirements : replaced boolean return with true for sh/okx/rankup/ranks/Rank::hasRequirements → KILLED
    return requirements.hasRequirements(player);
38
  }
39
40
  public Requirement getRequirement(Player player, String name) {
41 1 1. getRequirement : replaced return value with null for sh/okx/rankup/ranks/Rank::getRequirement → KILLED
    return requirements.getRequirement(player, name);
42
  }
43
44
  public void applyRequirements(Player player) {
45 1 1. applyRequirements : removed call to sh/okx/rankup/ranks/requirements/RankRequirements::applyRequirements → KILLED
    requirements.applyRequirements(player);
46
  }
47
48
  public void runCommands(Player player, Rank next) {
49
    for (String command : commands) {
50
      String string = plugin.newMessageBuilder(command).replacePlayer(player).replaceOldRank(this).replaceRank(next).toString(player);
51
      Bukkit.dispatchCommand(Bukkit.getConsoleSender(), string);
52
    }
53
  }
54
55
  @Override
56
  public String toString() {
57 1 1. toString : replaced return value with "" for sh/okx/rankup/ranks/Rank::toString → NO_COVERAGE
    return "Rank{" +
58
        "next='" + next + '\'' +
59
        ", rank='" + rank + '\'' +
60
        ", commands=" + commands +
61
        '}';
62
  }
63
}

Mutations

15

1.1
Location : canEqual
Killed by : none
replaced boolean return with false for sh/okx/rankup/ranks/Rank::canEqual → SURVIVED

2.2
Location : canEqual
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::canEqual → SURVIVED

3.3
Location : equals
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusComplete()]
negated conditional → KILLED

4.4
Location : equals
Killed by : none
negated conditional → SURVIVED

5.5
Location : equals
Killed by : none
negated conditional → SURVIVED

6.6
Location : equals
Killed by : none
negated conditional → SURVIVED

7.7
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

8.8
Location : equals
Killed by : none
negated conditional → SURVIVED

9.9
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

10.10
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

11.11
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

12.12
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

13.13
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

14.14
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

15.15
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

16.16
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

17.17
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

18.18
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

19.19
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

20.20
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

21.21
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

22.22
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

23.23
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

24.24
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

25.25
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

26.26
Location : equals
Killed by : none
negated conditional → NO_COVERAGE

27.27
Location : equals
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusCurrent()]
replaced boolean return with false for sh/okx/rankup/ranks/Rank::equals → KILLED

28.28
Location : equals
Killed by : none
replaced boolean return with false for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

29.29
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

30.30
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

31.31
Location : equals
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusComplete()]
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → KILLED

32.32
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

33.33
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

34.34
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

35.35
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

36.36
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

37.37
Location : equals
Killed by : none
replaced boolean return with true for sh/okx/rankup/ranks/Rank::equals → NO_COVERAGE

38.38
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

39.39
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

40.40
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

41.41
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

42.42
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

43.43
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

44.44
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

45.45
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

46.46
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

47.47
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

48.48
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

49.49
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

50.50
Location : hashCode
Killed by : none
Replaced integer multiplication with division → NO_COVERAGE

51.51
Location : hashCode
Killed by : none
Replaced integer addition with subtraction → NO_COVERAGE

52.52
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

53.53
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

54.54
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

55.55
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

56.56
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

57.57
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

58.58
Location : hashCode
Killed by : none
negated conditional → NO_COVERAGE

59.59
Location : hashCode
Killed by : none
replaced int return with 0 for sh/okx/rankup/ranks/Rank::hashCode → NO_COVERAGE

18

1.1
Location : getSection
Killed by : sh.okx.rankup.toml.TomlTest.[engine:junit-jupiter]/[class:sh.okx.rankup.toml.TomlTest]/[method:testRequirementsNotMet()]
replaced return value with null for sh/okx/rankup/ranks/Rank::getSection → KILLED

21

1.1
Location : getNext
Killed by : sh.okx.rankup.requirements.MobKillsRequirementsTest.[engine:junit-jupiter]/[class:sh.okx.rankup.requirements.MobKillsRequirementsTest]/[method:testMobKillsRequirements()]
replaced return value with "" for sh/okx/rankup/ranks/Rank::getNext → KILLED

23

1.1
Location : getRank
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusCurrent()]
replaced return value with "" for sh/okx/rankup/ranks/Rank::getRank → KILLED

25

1.1
Location : getDisplayName
Killed by : sh.okx.rankup.legacy.LegacyPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.legacy.LegacyPlaceholderTest]/[method:testLegacy()]
replaced return value with "" for sh/okx/rankup/ranks/Rank::getDisplayName → KILLED

27

1.1
Location : getRequirements
Killed by : sh.okx.rankup.requirements.MobKillsRequirementsTest.[engine:junit-jupiter]/[class:sh.okx.rankup.requirements.MobKillsRequirementsTest]/[method:testMobKillsRequirements()]
replaced return value with null for sh/okx/rankup/ranks/Rank::getRequirements → KILLED

29

1.1
Location : getCommands
Killed by : none
replaced return value with Collections.emptyList for sh/okx/rankup/ranks/Rank::getCommands → NO_COVERAGE

33

1.1
Location : isIn
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusCurrent()]
replaced boolean return with false for sh/okx/rankup/ranks/Rank::isIn → KILLED

2.2
Location : isIn
Killed by : sh.okx.rankup.RankupPlaceholderTest.[engine:junit-jupiter]/[class:sh.okx.rankup.RankupPlaceholderTest]/[method:testStatusCurrent()]
replaced boolean return with true for sh/okx/rankup/ranks/Rank::isIn → KILLED

37

1.1
Location : hasRequirements
Killed by : sh.okx.rankup.toml.TomlTest.[engine:junit-jupiter]/[class:sh.okx.rankup.toml.TomlTest]/[method:testRankup()]
replaced boolean return with false for sh/okx/rankup/ranks/Rank::hasRequirements → KILLED

2.2
Location : hasRequirements
Killed by : sh.okx.rankup.toml.TomlTest.[engine:junit-jupiter]/[class:sh.okx.rankup.toml.TomlTest]/[method:testRequirementsNotMet()]
replaced boolean return with true for sh/okx/rankup/ranks/Rank::hasRequirements → KILLED

41

1.1
Location : getRequirement
Killed by : sh.okx.rankup.requirements.MobKillsRequirementsTest.[engine:junit-jupiter]/[class:sh.okx.rankup.requirements.MobKillsRequirementsTest]/[method:testMobKillsRequirements()]
replaced return value with null for sh/okx/rankup/ranks/Rank::getRequirement → KILLED

45

1.1
Location : applyRequirements
Killed by : sh.okx.rankup.requirements.PrestigeRequirementsTest.[engine:junit-jupiter]/[class:sh.okx.rankup.requirements.PrestigeRequirementsTest]/[method:testPrestigeRequirements()]
removed call to sh/okx/rankup/ranks/requirements/RankRequirements::applyRequirements → KILLED

57

1.1
Location : toString
Killed by : none
replaced return value with "" for sh/okx/rankup/ranks/Rank::toString → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.0