Skip to content

Commit 6583f71

Browse files
sellophaneGoogler
andauthored
Migrate aswb/base to aswb_library (#7575)
and address new lint warnings. Bug: n/a Test: n/a Change-Id: I668e3ea346023ad6230da64adf844e64b4fb0f95 AOSP: 33cbd443efce966170d1c33b9a4bf9e24d805cf2 Co-authored-by: Googler <[email protected]>
1 parent 694e6b9 commit 6583f71

40 files changed

+85
-69
lines changed

base/src/com/google/idea/blaze/base/async/process/ExternalTask.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ default Future<Integer> runAsync(BlazeScope... scopes) {
6161

6262
/** A builder for an external task */
6363
class Builder {
64-
@VisibleForTesting public final ImmutableList.Builder<String> command = ImmutableList.builder();
64+
public final ImmutableList.Builder<String> command = ImmutableList.builder();
6565
File workingDirectory;
6666
final Map<String, String> environmentVariables = Maps.newHashMap();
67-
@VisibleForTesting @Nullable public BlazeContext context;
68-
@VisibleForTesting @Nullable public OutputStream stdout;
69-
@VisibleForTesting @Nullable public OutputStream stderr;
67+
@Nullable public BlazeContext context;
68+
@Nullable public OutputStream stdout;
69+
@Nullable public OutputStream stderr;
7070
@Nullable BlazeCommand blazeCommand;
7171
boolean redirectErrorStream = false;
7272
boolean ignoreExitCode = false;

base/src/com/google/idea/blaze/base/async/process/ExternalTaskProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
* Constructs an {@link ExternalTask} from a builder instance. This indirection exists to allow easy
2525
* redirection in blaze-invoking integration tests.
2626
*/
27-
@VisibleForTesting
2827
public interface ExternalTaskProvider {
2928

3029
static ExternalTaskProvider getInstance() {

base/src/com/google/idea/blaze/base/bazel/BazelVersion.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ int getBugfix() {
6666
return bugfix;
6767
}
6868

69-
@VisibleForTesting
7069
public static BazelVersion parseVersion(@Nullable String string) {
7170
// treat all unknown / development versions as the very latest version
7271
if (string == null) {

base/src/com/google/idea/blaze/base/command/BlazeFlags.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public static List<String> blazeFlags(
108108
public static final String ADB = "--adb";
109109

110110
// We add this to every single BlazeCommand instance. It's for tracking usage.
111-
@VisibleForTesting
112111
public static String getToolTagFlag() {
113112
String platformPrefix = PlatformUtils.getPlatformPrefix();
114113

base/src/com/google/idea/blaze/base/command/buildresult/BuildResult.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.google.idea.blaze.base.command.buildresult;
1717

18+
import java.util.Locale;
1819
import java.util.Objects;
1920

2021
/** The result of a blaze operation */
@@ -42,7 +43,7 @@ private static Status fromExitCode(int exitCode) {
4243

4344
@Override
4445
public String toString() {
45-
return name().toLowerCase();
46+
return name().toLowerCase(Locale.ROOT);
4647
}
4748
}
4849

base/src/com/google/idea/blaze/base/dependencies/ExternalFileProjectManagementHelper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import java.nio.file.Path;
6161
import java.util.HashSet;
6262
import java.util.List;
63+
import java.util.Locale;
6364
import java.util.Set;
6465
import java.util.concurrent.ExecutionException;
6566
import java.util.function.Consumer;
@@ -104,7 +105,7 @@ public Key<EditorNotificationPanel> getKey() {
104105
/** Whether the editor notification should be shown for this file type. */
105106
private static boolean supportedFileType(File file) {
106107
LanguageClass language =
107-
LanguageClass.fromExtension(FileUtilRt.getExtension(file.getName()).toLowerCase());
108+
LanguageClass.fromExtension(FileUtilRt.getExtension(file.getName()).toLowerCase(Locale.ROOT));
108109
if (language != null && !LanguageSupport.languagesSupportedByCurrentIde().contains(language)) {
109110
return false;
110111
}

base/src/com/google/idea/blaze/base/filecache/RemoteOutputsCache.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import java.util.Arrays;
6767
import java.util.Collection;
6868
import java.util.List;
69+
import java.util.Locale;
6970
import java.util.Map;
7071
import java.util.Objects;
7172
import java.util.Optional;
@@ -185,7 +186,7 @@ private void updateCache(
185186
RemoteArtifactPrefetcher.getInstance()
186187
.downloadArtifacts(
187188
/* projectName= */ project.getName(), /* outputArtifacts= */ artifactsToDownload);
188-
logger.info(String.format("Prefetching %d output artifacts", artifactsToDownload.size()));
189+
logger.info(String.format(Locale.ROOT, "Prefetching %d output artifacts", artifactsToDownload.size()));
189190
FutureUtil.waitForFuture(context, downloadArtifactsFuture)
190191
.timed("PrefetchRemoteOutput", EventType.Prefetching)
191192
.withProgressMessage("Prefetching output artifacts...")

base/src/com/google/idea/blaze/base/ideinfo/ArtifactLocation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ private ArtifactLocation(
3737
this.isExternal = isExternal;
3838
}
3939

40+
@SuppressWarnings("NoInterning")
4041
public static ArtifactLocation fromProto(Common.ArtifactLocation proto) {
4142
return ProjectDataInterner.intern(
4243
new ArtifactLocation(

base/src/com/google/idea/blaze/base/io/FileOperationProvider.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ public Path createTempFile(
9191
return Files.createTempFile(tempDirectory, prefix, suffix, attributes);
9292
}
9393

94+
@SuppressWarnings("NoNioFilesCopy")
9495
public File copy(File source, File target, CopyOption... options) throws IOException {
9596
return Files.copy(source.toPath(), target.toPath(), options).toFile();
9697
}

base/src/com/google/idea/blaze/base/issueparser/BlazeIssueParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ protected IssueOutput createIssue(Matcher matcher) {
439439
*/
440440
static class GenericErrorParser extends SingleLineParser {
441441

442-
// Match either specific blacklisted patterns we don't want, or the generic error message we do.
443-
// Then throw away the blacklisted matches later.
442+
// Match either specific patterns we don't want, or the generic error message we do.
443+
// Then throw away the matches patterns later.
444444
private static final ImmutableList<String> COMMON_PATTERNS = ImmutableList.of(
445445
"(//.+?: Exit [0-9]+\\.)",
446446
"(.*: Process exited with status [0-9]+\\.)",

0 commit comments

Comments
 (0)