mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
No longer use deprecated Double.valueOf()
This commit is contained in:
@@ -10,6 +10,8 @@ import java.util.List;
|
|||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import static java.lang.Double.compare;
|
||||||
|
import static java.lang.Double.parseDouble;
|
||||||
import static org.briarproject.bramble.test.UTest.Result.INCONCLUSIVE;
|
import static org.briarproject.bramble.test.UTest.Result.INCONCLUSIVE;
|
||||||
import static org.briarproject.bramble.test.UTest.Result.LARGER;
|
import static org.briarproject.bramble.test.UTest.Result.LARGER;
|
||||||
import static org.briarproject.bramble.test.UTest.Result.SMALLER;
|
import static org.briarproject.bramble.test.UTest.Result.SMALLER;
|
||||||
@@ -134,7 +136,7 @@ public class UTest {
|
|||||||
if (nA < 5 || nB < 5) die("Too few values for U test\n");
|
if (nA < 5 || nB < 5) die("Too few values for U test\n");
|
||||||
|
|
||||||
double zCritical;
|
double zCritical;
|
||||||
if (args.length == 3) zCritical = Double.valueOf(args[2]);
|
if (args.length == 3) zCritical = parseDouble(args[2]);
|
||||||
else zCritical = Z_CRITICAL_0_01;
|
else zCritical = Z_CRITICAL_0_01;
|
||||||
|
|
||||||
switch (test(a, b, zCritical)) {
|
switch (test(a, b, zCritical)) {
|
||||||
@@ -161,7 +163,7 @@ public class UTest {
|
|||||||
BufferedReader in;
|
BufferedReader in;
|
||||||
in = new BufferedReader(new FileReader(filename));
|
in = new BufferedReader(new FileReader(filename));
|
||||||
String s;
|
String s;
|
||||||
while ((s = in.readLine()) != null) values.add(new Double(s));
|
while ((s = in.readLine()) != null) values.add(parseDouble(s));
|
||||||
in.close();
|
in.close();
|
||||||
} catch (FileNotFoundException fnf) {
|
} catch (FileNotFoundException fnf) {
|
||||||
die(filename + " not found");
|
die(filename + " not found");
|
||||||
@@ -187,9 +189,7 @@ public class UTest {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compareTo(@Nonnull Value v) {
|
public int compareTo(@Nonnull Value v) {
|
||||||
if (value < v.value) return -1;
|
return compare(value, v.value);
|
||||||
if (value > v.value) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user