aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java26
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java10
2 files changed, 3 insertions, 33 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java
index 0ea36aa52a..4b32382a40 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/ConfiguredRuleClassProvider.java
@@ -20,9 +20,6 @@ import static com.google.devtools.build.lib.packages.RuleClass.Builder.RuleClass
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Preconditions;
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
@@ -542,13 +539,8 @@ public class ConfiguredRuleClassProvider implements RuleClassProvider {
}
@Override
- public Label getLabel(String labelValue) {
- return LABELS.getUnchecked(labelValue);
- }
-
- @Override
public Label getToolsLabel(String labelValue) {
- return getLabel(toolsRepository + labelValue);
+ return Label.parseAbsoluteUnchecked(toolsRepository + labelValue);
}
@Override
@@ -566,22 +558,6 @@ public class ConfiguredRuleClassProvider implements RuleClassProvider {
}
/**
- * Used to make the label instances unique, so that we don't create a new
- * instance for every rule.
- */
- private static final LoadingCache<String, Label> LABELS = CacheBuilder.newBuilder().build(
- new CacheLoader<String, Label>() {
- @Override
- public Label load(String from) {
- try {
- return Label.parseAbsolute(from);
- } catch (LabelSyntaxException e) {
- throw new IllegalArgumentException(from, e);
- }
- }
- });
-
- /**
* Default content that should be added at the beginning of the WORKSPACE file.
*/
private final String defaultWorkspaceFilePrefix;
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java
index bd76287fd1..6c4705b749 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleDefinitionEnvironment.java
@@ -23,14 +23,8 @@ import javax.annotation.Nullable;
*/
public interface RuleDefinitionEnvironment {
/**
- * Parses the given string as a label and returns the label, by calling {@link
- * Label#parseAbsolute}. Throws a {@link IllegalArgumentException} if the parsing fails.
- */
- Label getLabel(String labelValue);
-
- /**
- * Prepends the tools repository path to the given string and parses the result
- * using {@link RuleDefinitionEnvironment#getLabel}
+ * Prepends the tools repository path to the given string and parses the result using {@link
+ * Label#parseAbsoluteUnchecked}.
*/
Label getToolsLabel(String labelValue);