Skip to content

Commit cb0e2b8

Browse files
committed
Fix issues found by latest version of error-prone
1 parent 274acb6 commit cb0e2b8

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

src/common/src/main/java/org/smoothbuild/common/filesystem/mem/MemoryDir.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public Path name() {
2929

3030
@Override
3131
public MemoryDir parent() {
32-
return Preconditions.checkNotNull(parent, "Dir " + name.q() + " does not have parent.");
32+
return Preconditions.checkNotNull(parent, "Dir `%s` does not have parent.", name);
3333
}
3434

3535
@Override

src/common/src/test/java/org/smoothbuild/common/collect/ListTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,6 @@ void as_copy_of_other_list_makes_defensive_copy() {
421421

422422
assertThat(copy).containsExactly(1, 2, 3).inOrder();
423423
}
424-
425-
@Test
426-
void as_copy_of_other_list_creates_different_instance() {
427-
var list = asList(1, 2, 3);
428-
assertThat(listOfAll(list)).isNotSameInstanceAs(list);
429-
}
430424
}
431425

432426
@Nested

src/standard-library/src/main/java/org/smoothbuild/stdlib/java/MavenArtifactFunc.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ static BValue funcImpl(NativeApi nativeApi, BTuple args, HttpClient httpClient)
3131
try {
3232
var response = httpClient.send(httpRequest(coordinate.url()), ofInputStream());
3333
if (response.statusCode() != 200) {
34-
var template = """
34+
var message = """
3535
Failed to download Maven artifact %s
3636
from %s
37-
Status code: %d""";
38-
var message = template.formatted(coordinate, coordinate.url(), response.statusCode());
37+
Status code: %d""".formatted(coordinate, coordinate.url(), response.statusCode());
3938
nativeApi.log().fatal(message);
4039
return null;
4140
}

src/virtual-machine/src/test/java/org/smoothbuild/virtualmachine/bytecode/expr/base/AbstractBExprTestSuite.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void test_hash_of_inequal_exprs() throws Exception {
4040
for (int j = i + 1; j < values.size(); j++) {
4141
T valueI = values.get(i);
4242
T valueJ = values.get(j);
43-
assertWithMessage("Comparing hashes of:\n" + i + ": " + valueI + "\n" + j + ": " + valueJ)
43+
assertWithMessage("Comparing hashes of:\n%s: %s\n%s: %s", i, valueI, j, valueJ)
4444
.that(valueI.hash())
4545
.isNotEqualTo(valueJ.hash());
4646
}

0 commit comments

Comments
 (0)