diff options
author | Greg Estren <gregce@google.com> | 2017-02-14 21:30:29 +0000 |
---|---|---|
committer | Dmitry Lomov <dslomov@google.com> | 2017-02-15 10:04:56 +0000 |
commit | 564940d73ab135f2dd0573623b8934ed1cd7b9d1 (patch) | |
tree | b886fabd6a057ef9c3d2e75fd2af6cfc9faf0f98 /src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java | |
parent | f98361fe0f7af3d549838f940e4af32b73888755 (diff) |
Remove type checking requirement from AttributeMap.has.
This overrides the traditional has(String name, Type<>T> type)
with has(String name) and removes the type check outright from
isConfigurable.
Ideally we'd remove the old version in this same change. But there
are enough uses of it that that's not a risk-free change and
is safer as followup changes.
--
PiperOrigin-RevId: 147513593
MOS_MIGRATED_REVID=147513593
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java index 6d95f55b24..db7d6f0f3c 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/AspectAwareAttributeMapper.java @@ -86,12 +86,8 @@ class AspectAwareAttributeMapper implements AttributeMap { } @Override - public <T> boolean isConfigurable(String attributeName, Type<T> type) { - if (ruleAttributes.has(attributeName, type)) { - return ruleAttributes.isConfigurable(attributeName, type); - } - // Any scenario aside from a "select(...)" in a BUILD file is not configurable. - return false; + public boolean isConfigurable(String attributeName) { + return ruleAttributes.isConfigurable(attributeName); } @Override @@ -154,7 +150,16 @@ class AspectAwareAttributeMapper implements AttributeMap { } @Override - public boolean has(String attrName, Type<?> type) { + public boolean has(String attrName) { + if (ruleAttributes.has(attrName)) { + return true; + } else { + return aspectAttributes.containsKey(attrName); + } + } + + @Override + public <T> boolean has(String attrName, Type<T> type) { if (ruleAttributes.has(attrName, type)) { return true; } else { |