diff options
author | Greg Estren <gregce@google.com> | 2015-03-24 22:25:44 +0000 |
---|---|---|
committer | Lukacs Berki <lberki@google.com> | 2015-03-25 10:31:39 +0000 |
commit | 28075900caf7e62a873436cf00eb886a35372750 (patch) | |
tree | b0f110d04c8b0b4d66b66f19f7d61429d0d8f8be | |
parent | 9dc4027253ded6bba3fb3a230f4e8fe571b4878b (diff) |
More precisely document AttributeMap.get (particularly the possibility
of null values).
--
MOS_MIGRATED_REVID=89443545
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/packages/AttributeMap.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/packages/AttributeMap.java b/src/main/java/com/google/devtools/build/lib/packages/AttributeMap.java index 131ed05972..e389539450 100644 --- a/src/main/java/com/google/devtools/build/lib/packages/AttributeMap.java +++ b/src/main/java/com/google/devtools/build/lib/packages/AttributeMap.java @@ -39,9 +39,14 @@ public interface AttributeMap { Label getLabel(); /** - * Returns the value of the named rule attribute, which must be of the given type. If it does not - * exist or has the wrong type, throws an {@link IllegalArgumentException}. + * Returns the value of the named rule attribute, which must be of the given type. This may + * be null (for example, for an attribute with no default value that isn't explicitly set in + * the rule - see {@link Type#getDefaultValue}). + * + * <p>If the rule doesn't have this attribute with the specified type, throws an + * {@link IllegalArgumentException}. */ + @Nullable <T> T get(String attributeName, Type<T> type); /** |