Skip to content

Commit 3b2b966

Browse files
remove hardcoded values
1 parent 876f635 commit 3b2b966

File tree

2 files changed

+6
-3
lines changed
  • annotator-core/src

2 files changed

+6
-3
lines changed

annotator-core/src/main/java/edu/ucr/cs/riple/core/checkers/nullaway/NullAway.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,9 @@ private NullAwayError deserializeErrorFromTSVLine(ModuleInfo moduleInfo, String
107107
String[] values = line.split("\t");
108108
Preconditions.checkArgument(
109109
values.length == 12,
110-
"Expected 12 values to create Error instance in NullAway serialization version 2 but found: "
111-
+ values.length);
110+
String.format(
111+
"Expected 12 values to create Error instance in NullAway serialization version %s but found: %s",
112+
NullAway.VERSION, values.length));
112113
int offset = Integer.parseInt(values[4]);
113114
Path path = Printer.deserializePath(values[5]);
114115
String errorMessage = values[1];

annotator-core/src/test/java/edu/ucr/cs/riple/core/tools/Utility.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
package edu.ucr.cs.riple.core.tools;
2626

27+
import edu.ucr.cs.riple.core.checkers.nullaway.NullAway;
2728
import edu.ucr.cs.riple.scanner.Serializer;
2829
import java.io.BufferedReader;
2930
import java.io.IOException;
@@ -161,7 +162,8 @@ public static void runTestWithMockedBuild(Path testDir, Runnable runnable) {
161162
createAFileWithContent(
162163
testDir.resolve("0").resolve(fileName), "HEADER\n"));
163164
createAFileWithContent(
164-
testDir.resolve("0").resolve("serialization_version.txt"), "3");
165+
testDir.resolve("0").resolve("serialization_version.txt"),
166+
String.valueOf(NullAway.VERSION));
165167
return null;
166168
});
167169
runnable.run();

0 commit comments

Comments
 (0)