PermissionGroupProvider.java

1
package sh.okx.rankup.hook;
2
3
import java.util.UUID;
4
import org.bukkit.Bukkit;
5
import org.bukkit.entity.Player;
6
7
public class PermissionGroupProvider implements GroupProvider {
8
9
  @Override
10
  public boolean inGroup(UUID uuid, String group) {
11
    Player player = getPlayer(uuid);
12 2 1. inGroup : replaced boolean return with false for sh/okx/rankup/hook/PermissionGroupProvider::inGroup → NO_COVERAGE
2. inGroup : replaced boolean return with true for sh/okx/rankup/hook/PermissionGroupProvider::inGroup → NO_COVERAGE
    return player.hasPermission("rankup.rank." + group);
13
  }
14
15
  @Override
16
  public void addGroup(UUID uuid, String group) {
17
    // no-op
18
  }
19
20
  @Override
21
  public void removeGroup(UUID uuid, String group) {
22
    // no-op
23
  }
24
25
  private Player getPlayer(UUID uuid) {
26
    Player player = Bukkit.getPlayer(uuid);
27 1 1. getPlayer : negated conditional → NO_COVERAGE
    if (player == null) {
28
      throw new IllegalArgumentException("Player not online!");
29
    }
30 1 1. getPlayer : replaced return value with null for sh/okx/rankup/hook/PermissionGroupProvider::getPlayer → NO_COVERAGE
    return player;
31
  }
32
}

Mutations

12

1.1
Location : inGroup
Killed by : none
replaced boolean return with false for sh/okx/rankup/hook/PermissionGroupProvider::inGroup → NO_COVERAGE

2.2
Location : inGroup
Killed by : none
replaced boolean return with true for sh/okx/rankup/hook/PermissionGroupProvider::inGroup → NO_COVERAGE

27

1.1
Location : getPlayer
Killed by : none
negated conditional → NO_COVERAGE

30

1.1
Location : getPlayer
Killed by : none
replaced return value with null for sh/okx/rankup/hook/PermissionGroupProvider::getPlayer → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.7.0