Prestiges.java

1
package sh.okx.rankup.prestige;
2
3
import java.util.ArrayList;
4
import java.util.List;
5
import java.util.Map;
6
import org.bukkit.configuration.ConfigurationSection;
7
import org.bukkit.configuration.file.FileConfiguration;
8
import sh.okx.rankup.RankupPlugin;
9
import sh.okx.rankup.ranks.RankElement;
10
import sh.okx.rankup.ranks.RankList;
11
12
public class Prestiges extends RankList<Prestige> {
13
  public Prestiges(RankupPlugin plugin, FileConfiguration config) {
14
    super(plugin, convert(plugin, config));
15
  }
16
17
  private static List<Prestige> convert(RankupPlugin plugin, FileConfiguration config) {
18
    Map<String, Object> values = config.getValues(false);
19
    List<Prestige> prestiges = new ArrayList<>(values.size());
20
    for (Map.Entry<String, Object> entry : values.entrySet()) {
21
      prestiges.add(Prestige.deserialize(plugin, (ConfigurationSection) entry.getValue()));
22
    }
23 1 1. convert : replaced return value with Collections.emptyList for sh/okx/rankup/prestige/Prestiges::convert → KILLED
    return prestiges;
24
  }
25
26
  @Override
27
  protected void addLastRank(RankupPlugin plugin) {
28
    RankElement<Prestige> last = getTree().last();
29 1 1. addLastRank : removed call to sh/okx/rankup/ranks/RankElement::setNext → SURVIVED
    last.setNext(new RankElement<>(new LastPrestige(plugin, last.getRank().getNext()), null));
30
  }
31
32
}

Mutations

23

1.1
Location : convert
Killed by : sh.okx.rankup.prestige.BrokenPrestigeTest.[engine:junit-jupiter]/[class:sh.okx.rankup.prestige.BrokenPrestigeTest]/[method:testPrestige()]
replaced return value with Collections.emptyList for sh/okx/rankup/prestige/Prestiges::convert → KILLED

29

1.1
Location : addLastRank
Killed by : none
removed call to sh/okx/rankup/ranks/RankElement::setNext → SURVIVED

Active mutators

Tests examined


Report generated by PIT 1.7.0