ThreadSleeper.java

1
package com.rox.time;
2
3
public final class ThreadSleeper implements Sleeper {
4
    @Override
5
    public void sleepFor(long nanos) throws InterruptedException {
6 1 1. sleepFor : Replaced long division with multiplication → SURVIVED
        long millis = nanos / 1_000_000;
7 1 1. sleepFor : Replaced long modulus with multiplication → KILLED
        int remainingNanos = (int) (nanos % 1_000_000);
8
9 1 1. sleepFor : removed call to java/lang/Thread::sleep → KILLED
        Thread.sleep(millis, remainingNanos);
10
    }
11
}

Mutations

6

1.1
Location : sleepFor
Killed by : none
Replaced long division with multiplication → SURVIVED
Covering tests

7

1.1
Location : sleepFor
Killed by : com.rox.clock.FPSClockTest.[engine:junit-jupiter]/[class:com.rox.clock.FPSClockTest]/[method:runWhenAlreadyRunning()]
Replaced long modulus with multiplication → KILLED

9

1.1
Location : sleepFor
Killed by : com.rox.clock.FPSClockTest.[engine:junit-jupiter]/[class:com.rox.clock.FPSClockTest]/[method:run()]
removed call to java/lang/Thread::sleep → KILLED

Active mutators

Tests examined


Report generated by PIT 1.22.1