aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/cmdline
diff options
context:
space:
mode:
authorGravatar dannark <dannark@google.com>2018-06-22 11:44:27 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-06-22 11:46:15 -0700
commitda327bbeaf01ac109bf6262cda765c99228eddee (patch)
tree5677f7f9136eac0616e3df3fd68153b0d53c4fff /src/main/java/com/google/devtools/build/lib/cmdline
parentecc922017637b19cbd98381f4a0067b5422d2d31 (diff)
Remove Label.parseAbsolute(string, boolean). The goal is to get rid of all label methods that don't explicitly pass a repository mapping.
RELNOTES: None PiperOrigin-RevId: 201717665
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/cmdline')
-rw-r--r--src/main/java/com/google/devtools/build/lib/cmdline/Label.java30
1 files changed, 8 insertions, 22 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
index 9899f2c7b3..b81efab5f4 100644
--- a/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
+++ b/src/main/java/com/google/devtools/build/lib/cmdline/Label.java
@@ -99,28 +99,12 @@ public final class Label
*
* <p>Treats labels in the default repository as being in the main repository instead.
*/
- public static Label parseAbsolute(String absName) throws LabelSyntaxException {
- return parseAbsolute(absName, true);
- }
-
- /**
- * Factory for Labels from absolute string form. e.g.
- *
- * <pre>
- * //foo/bar
- * //foo/bar:quux
- * {@literal @}foo
- * {@literal @}foo//bar
- * {@literal @}foo//bar:baz
- * </pre>
- *
- * @param defaultToMain Treat labels in the default repository as being in the main one instead.
- */
@Deprecated
- // TODO(dannark): Remove usages of this method, use other parseAbsolute() instead
- public static Label parseAbsolute(String absName, boolean defaultToMain)
- throws LabelSyntaxException {
- return parseAbsolute(absName, defaultToMain, /* repositoryMapping= */ ImmutableMap.of());
+ // TODO(b/110698008): deprecate this method and only have parseAbsolute() methods that pass
+ // a repositoryMapping
+ public static Label parseAbsolute(String absName) throws LabelSyntaxException {
+ return parseAbsolute(
+ absName, /* defaultToMain= */ true, /* repositoryMapping= */ ImmutableMap.of());
}
/**
@@ -185,9 +169,11 @@ public final class Label
*
* <p>Do not use this when the argument is not hard-wired.
*/
+ @Deprecated
+ // TODO(b/110698008): create parseAbsoluteUnchecked that passes repositoryMapping
public static Label parseAbsoluteUnchecked(String absName, boolean defaultToMain) {
try {
- return parseAbsolute(absName, defaultToMain);
+ return parseAbsolute(absName, defaultToMain, /* repositoryMapping= */ ImmutableMap.of());
} catch (LabelSyntaxException e) {
throw new IllegalArgumentException(e);
}