Skip to content

Commit 5a7d6f4

Browse files
cushoncopybara-github
authored andcommitted
Automatic code cleanup.
PiperOrigin-RevId: 830233723 Change-Id: I30730172e8eb0751dcb2a88894f65d71ea5eab90
1 parent 515083c commit 5a7d6f4

File tree

7 files changed

+14
-17
lines changed

7 files changed

+14
-17
lines changed

src/main/java/com/google/devtools/build/lib/pkgcache/PathPackageLocator.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,11 @@ public Path getPackageBuildFileNullable(
9595
}
9696
}
9797
} else {
98-
Verify.verify(outputBase != null, String.format(
98+
Verify.verify(
99+
outputBase != null,
99100
"External package '%s' needs to be loaded but this PathPackageLocator instance does not "
100-
+ "support external packages", packageIdentifier));
101+
+ "support external packages",
102+
packageIdentifier);
101103
// This works only to some degree, because it relies on the presence of the repository under
102104
// $OUTPUT_BASE/external, which is created by the appropriate RepositoryDirectoryValue. This
103105
// is true for the invocation in GlobCache, but not for the locator.getBuildFileForPackage()

src/test/java/com/google/devtools/build/lib/actions/ExecutableSymlinkActionTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,7 @@ public void testFailIfInputIsNotExecutable() throws Exception {
136136
() -> action.execute(createContext(inputMetadataProvider)));
137137
String want = "'in/some-file' is not executable";
138138
String got = e.getMessage();
139-
assertWithMessage(String.format("got %s, want %s", got, want))
140-
.that(got.contains(want))
141-
.isTrue();
139+
assertWithMessage("got %s, want %s", got, want).that(got.contains(want)).isTrue();
142140
}
143141

144142
@Test

src/test/java/com/google/devtools/build/lib/analysis/AspectCollectionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ private static void validateAspectPaths(AspectCollection collection,
287287
private static void collectAndValidateAspectDeps(AspectDeps aspectDeps,
288288
HashMap<AspectDescriptor, AspectDeps> allDeps) {
289289
if (allDeps.containsKey(aspectDeps.aspect())) {
290-
assertWithMessage(String.format("Two different deps for aspect %s", aspectDeps.aspect()))
290+
assertWithMessage("Two different deps for aspect %s", aspectDeps.aspect())
291291
.that(allDeps.get(aspectDeps.aspect()))
292292
.isSameInstanceAs(aspectDeps);
293293
return;

src/test/java/com/google/devtools/build/lib/analysis/MacroVisibilityTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,10 @@ private void assertVisibilityPermits(String consumer, String dependency) throws
8181
// visibility error event in a traceback.
8282
assertDoesNotContainEvent(visibilityErrorMessage(consumer, dependency));
8383
assertWithMessage(
84-
String.format(
85-
"%s had an error (other than a visibility violation on %s)", consumer, dependency))
84+
"%s had an error (other than a visibility violation on %s)", consumer, dependency)
8685
.that(consumerTarget)
8786
.isNotNull();
88-
assertWithMessage(String.format("%s does not have a dependency on %s", consumer, dependency))
87+
assertWithMessage("%s does not have a dependency on %s", consumer, dependency)
8988
.that(getDirectPrerequisite(consumerTarget, dependency))
9089
.isNotNull();
9190
}
@@ -102,9 +101,8 @@ private void assertVisibilityDisallows(
102101
reporter.removeHandler(failFastHandler);
103102
ConfiguredTarget consumerTarget = getConfiguredTarget(consumer);
104103
assertWithMessage(
105-
String.format(
106-
"%s unexpectedly did not have an error (no visibility violation due to %s)",
107-
consumer, dependency))
104+
"%s unexpectedly did not have an error (no visibility violation due to %s)",
105+
consumer, dependency)
108106
.that(consumerTarget)
109107
.isNull();
110108
assertContainsEvent(visibilityErrorMessage(consumer, dependency, dependencyIsAlias));

src/test/java/com/google/devtools/build/lib/rules/python/PyExecutableConfiguredTargetTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ protected void assertPythonVersionIs_UnderNewConfigs(
105105
String targetName, PythonVersion version, String[]... configs) throws Exception {
106106
for (String[] config : configs) {
107107
useConfiguration(config);
108-
assertWithMessage(String.format("Under config '%s'", Joiner.on(" ").join(config)))
108+
assertWithMessage("Under config '%s'", Joiner.on(" ").join(config))
109109
.that(getPythonVersion(getOkPyTarget(targetName)))
110110
.isEqualTo(version);
111111
}

src/test/java/com/google/devtools/build/lib/runtime/BlazeCommandDispatcherRcoptionsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ public void testInheritedOptionsWithSpecificOverride() throws Exception {
286286

287287
dispatch.exec(cmdLine, "test", outErr);
288288
String out = outErr.outAsLatin1();
289-
assertWithMessage(String.format(
289+
assertWithMessage(
290290
"The more specific option should override, irrespective of source file or order. %s",
291-
orderedOpts))
291+
orderedOpts)
292292
.that(out)
293293
.isEqualTo("42 reportallinherited");
294294
}

src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleImplementationFunctionsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -855,8 +855,7 @@ private void runExpansion(String command, String expectedPattern) throws Excepti
855855
private static void assertMatches(
856856
String description, String expectedPattern, String computedValue) {
857857
assertWithMessage(
858-
String.format(
859-
"%s '%s' did not match pattern '%s'", description, computedValue, expectedPattern))
858+
"%s '%s' did not match pattern '%s'", description, computedValue, expectedPattern)
860859
.that(Pattern.matches(expectedPattern, computedValue))
861860
.isTrue();
862861
}

0 commit comments

Comments
 (0)