diff options
author | 2015-05-04 12:05:57 +0000 | |
---|---|---|
committer | 2015-05-04 17:51:54 +0000 | |
commit | b313a9750d77ea4ccd3cb591131e2311486cb11a (patch) | |
tree | 990b298339cae32fe0fce5649c3669de3cb1966b /src/main/java/com/google/devtools/build/lib/packages | |
parent | 208df987a0d5a27370691f93b34a5f70f6982cbe (diff) |
Open source a few more analysis tests.
--
MOS_MIGRATED_REVID=92715161
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/packages')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java | 6 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/Package.java | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java b/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java index 2742b1e297..f142c969de 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AbstractAttributeMapper.java @@ -13,6 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.packages; +import com.google.common.annotations.VisibleForTesting; import com.google.common.collect.ImmutableList; import com.google.devtools.build.lib.syntax.Label; @@ -74,7 +75,8 @@ public abstract class AbstractAttributeMapper implements AttributeMap { * @throws IllegalArgumentException if the given attribute doesn't exist with the specified * type. This happens whether or not it's a computed default. */ - protected <T> Attribute.ComputedDefault getComputedDefault(String attributeName, Type<T> type) { + @VisibleForTesting // Should be protected + public <T> Attribute.ComputedDefault getComputedDefault(String attributeName, Type<T> type) { int index = getIndexWithTypeCheck(attributeName, type); Object value = attributes.getAttributeValue(index); if (value instanceof Attribute.ComputedDefault) { @@ -177,7 +179,7 @@ public abstract class AbstractAttributeMapper implements AttributeMap { if (!(attrValue instanceof Type.SelectorList)) { return null; } - if (((Type.SelectorList) attrValue).getOriginalType() != type) { + if (((Type.SelectorList<?>) attrValue).getOriginalType() != type) { throw new IllegalArgumentException("Attribute " + attributeName + " is not of type " + type + " in rule " + ruleLabel); } diff --git a/src/main/java/com/google/devtools/build/lib/packages/Package.java b/src/main/java/com/google/devtools/build/lib/packages/Package.java index b6328a3aaa..1b4db3873d 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/Package.java +++ b/src/main/java/com/google/devtools/build/lib/packages/Package.java @@ -528,8 +528,8 @@ public class Package implements Serializable { * for walking through the dependency graph of a target. * Fails if the target is not a Rule. */ - @VisibleForTesting - Rule getRule(String targetName) { + @VisibleForTesting // Should be package-private + public Rule getRule(String targetName) { return (Rule) targets.get(targetName); } |