aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools/android/java/com/google/devtools/build/android/xml
diff options
context:
space:
mode:
authorGravatar apell <apell@google.com>2017-05-24 18:42:42 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-05-26 09:34:51 +0200
commitcf623c32ee369efbced6f1558eb07d5979213228 (patch)
treef0371c6dc0402daea71aa0ecfde4885e265c580e /src/tools/android/java/com/google/devtools/build/android/xml
parent4521882c2e67bcc76d1b191e73ae8058995e0ef5 (diff)
Fix bug with combining resource attributes. Attributes were reporting that they were over-writable in all cases instead of differentiating by attribute type.
RELNOTES: None. PiperOrigin-RevId: 156999284
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/xml')
-rw-r--r--src/tools/android/java/com/google/devtools/build/android/xml/ResourcesAttribute.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/ResourcesAttribute.java b/src/tools/android/java/com/google/devtools/build/android/xml/ResourcesAttribute.java
index 9202d599b5..a54667ecdb 100644
--- a/src/tools/android/java/com/google/devtools/build/android/xml/ResourcesAttribute.java
+++ b/src/tools/android/java/com/google/devtools/build/android/xml/ResourcesAttribute.java
@@ -48,7 +48,11 @@ public class ResourcesAttribute implements XmlResourceValue {
}
};
- private static enum AttributeType {
+ /**
+ * Represents the semantic meaning of an xml attribute and how it is combined with other
+ * attributes of the same type.
+ */
+ public static enum AttributeType {
UNCOMBINABLE(null, null),
TOOLS_IGNORE("{http://schemas.android.com/tools}ignore", COMMA_SEPARATED_COMBINER),
TOOLS_MENU("{http://schemas.android.com/tools}menu", COMMA_SEPARATED_COMBINER),
@@ -74,6 +78,10 @@ public class ResourcesAttribute implements XmlResourceValue {
this.name = name;
this.combiner = combiner;
}
+
+ public boolean isCombining() {
+ return this != UNCOMBINABLE;
+ }
}
public static ResourcesAttribute of(FullyQualifiedName fqn, String name, String value) {
@@ -94,7 +102,6 @@ public class ResourcesAttribute implements XmlResourceValue {
private final String value;
private ResourcesAttribute(AttributeType type, String name, String value) {
-
this.type = type;
this.name = name;
this.value = value;
@@ -148,7 +155,7 @@ public class ResourcesAttribute implements XmlResourceValue {
}
public boolean isCombining() {
- return type != AttributeType.UNCOMBINABLE;
+ return type.isCombining();
}
@Override