aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Alex Humesky <ahumesky@google.com>2017-03-20 21:19:25 +0000
committerGravatar Yue Gan <yueg@google.com>2017-03-21 12:51:54 +0000
commit7eaed58705e0446fd0e722619f8bd8b758c71ac1 (patch)
tree856f35e36111e8943a98ac8db5861f523eb76034
parent5cb6554c0990a8aa9c0155e5d59f0b5ae331befc (diff)
Clarifies some javadoc in Rule and AttributeContainer.
-- PiperOrigin-RevId: 150675067 MOS_MIGRATED_REVID=150675067
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java9
-rw-r--r--src/main/java/com/google/devtools/build/lib/packages/Rule.java9
2 files changed, 13 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java b/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
index d7856e8cf7..80889a9594 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/AttributeContainer.java
@@ -85,13 +85,18 @@ public class AttributeContainer {
}
/**
- * Returns true iff the given attribute exists for this rule and its value
- * is explicitly set in the BUILD file (as opposed to its default value).
+ * {@see #isAttributeValueExplicitlySpecified(String)}
*/
public boolean isAttributeValueExplicitlySpecified(Attribute attribute) {
return isAttributeValueExplicitlySpecified(attribute.getName());
}
+ /**
+ * Returns true iff the value of the specified attribute is explicitly set in the BUILD file.
+ * This returns true also if the value explicity specified in the BUILD file is the same as the
+ * attribute's default value. In addition, this method return false if the rule has no attribute
+ * with the given name.
+ */
public boolean isAttributeValueExplicitlySpecified(String attributeName) {
Integer idx = ruleClass.getAttributeIndex(attributeName);
return idx != null && getExplicit(idx);
diff --git a/src/main/java/com/google/devtools/build/lib/packages/Rule.java b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
index 34b6ab5fb6..2b6810b68c 100644
--- a/src/main/java/com/google/devtools/build/lib/packages/Rule.java
+++ b/src/main/java/com/google/devtools/build/lib/packages/Rule.java
@@ -328,15 +328,18 @@ public final class Rule implements Target, DependencyFilter.AttributeInfoProvide
return ruleClass.hasAttr(attrName, type);
}
+ /**
+ * {@see #isAttributeValueExplicitlySpecified(String)}
+ */
@Override
public boolean isAttributeValueExplicitlySpecified(Attribute attribute) {
return attributes.isAttributeValueExplicitlySpecified(attribute);
}
/**
- * Returns true iff the value of the specified attribute is explicitly set in the BUILD file (as
- * opposed to its default value). This also returns true if the value from the BUILD file is the
- * same as the default value. In addition, this method return false if the rule has no attribute
+ * Returns true iff the value of the specified attribute is explicitly set in the BUILD file.
+ * This returns true also if the value explicity specified in the BUILD file is the same as the
+ * attribute's default value. In addition, this method return false if the rule has no attribute
* with the given name.
*/
public boolean isAttributeValueExplicitlySpecified(String attrName) {