Skip to content

Commit 9c4e53d

Browse files
browngeorgewfraser
authored andcommitted
Fix compiler warnings output when compiling with Bazel.
1 parent 31a7621 commit 9c4e53d

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/main/java/org/javacs/FileStore.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,10 @@ public static String contents(Path file) {
272272

273273
static InputStream inputStream(Path file) {
274274
var uri = file.toUri();
275-
if (activeDocuments.containsKey(uri)) {
276-
var string = activeDocuments.get(uri).content;
275+
file = Paths.get(uri);
276+
277+
if (activeDocuments.containsKey(file)) {
278+
var string = activeDocuments.get(file).content;
277279
var bytes = string.getBytes();
278280
return new ByteArrayInputStream(bytes);
279281
}
@@ -290,8 +292,10 @@ static InputStream inputStream(Path file) {
290292

291293
static BufferedReader bufferedReader(Path file) {
292294
var uri = file.toUri();
293-
if (activeDocuments.containsKey(uri)) {
294-
var string = activeDocuments.get(uri).content;
295+
file = Paths.get(uri);
296+
297+
if (activeDocuments.containsKey(file)) {
298+
var string = activeDocuments.get(file).content;
295299
return new BufferedReader(new StringReader(string));
296300
}
297301
try {

src/main/java/org/javacs/Parser.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,8 @@ long lastCursorIn(Tree node) {
302302
}
303303
if (last == -1) {
304304
throw new RuntimeException(
305-
String.format("No cursor in %s is between %d and %d", offsets, start, end));
305+
String.format(
306+
"No cursor in %s is between %d and %d", Arrays.toString(offsets), start, end));
306307
}
307308
return last;
308309
}

0 commit comments

Comments
 (0)