diff options
author | 2018-04-20 04:04:06 -0700 | |
---|---|---|
committer | 2018-04-20 04:06:01 -0700 | |
commit | 96d3c91c714544584c9174759bedebf2a6be5e71 (patch) | |
tree | f4864c9aedb05ea3e916acb26d1bba81e8780a40 /src/tools/android/java/com/google/devtools/build/android/xml | |
parent | 1cf50a8696234fda143f5afccbb7023ac2b54e19 (diff) |
Remove use of bare Immutable{List,Map,Set} Builder classes.
Always use the more-qualified class name for clarity at the site of use. There are too many classes named Builder.
PiperOrigin-RevId: 193649193
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/xml')
2 files changed, 7 insertions, 10 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/AttrXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/AttrXmlResourceValue.java index f2645ac0a3..4fc53e173a 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/AttrXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/AttrXmlResourceValue.java @@ -26,7 +26,6 @@ import com.google.common.base.Preconditions; import com.google.common.collect.FluentIterable; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMap.Builder; import com.google.common.collect.Ordering; import com.google.devtools.build.android.AndroidDataWritingVisitor; import com.google.devtools.build.android.AndroidDataWritingVisitor.StartTag; @@ -99,7 +98,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { private static Map<String, String> readSubValues(XMLEventReader reader, QName subTagType) throws XMLStreamException { - Builder<String, String> builder = ImmutableMap.builder(); + ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); while (reader.hasNext() && XmlResourceValues.isTag(XmlResourceValues.peekNextTag(reader), subTagType)) { StartElement element = reader.nextEvent().asStartElement(); @@ -156,7 +155,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { @SuppressWarnings("deprecation") public static XmlResourceValue from(SerializeFormat.DataValueXml proto) throws InvalidProtocolBufferException { - Builder<String, ResourceXmlAttrValue> formats = + ImmutableMap.Builder<String, ResourceXmlAttrValue> formats = ImmutableMap.<String, AttrXmlResourceValue.ResourceXmlAttrValue>builder(); for (Entry<String, SerializeFormat.DataValueXml> entry : proto.getMappedXmlValue().entrySet()) { switch (entry.getKey()) { @@ -200,8 +199,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { } public static XmlResourceValue from(Value proto) throws InvalidProtocolBufferException { - Builder<String, ResourceXmlAttrValue> formats = - ImmutableMap.builder(); + ImmutableMap.Builder<String, ResourceXmlAttrValue> formats = ImmutableMap.builder(); Attribute attribute = proto.getCompoundValue().getAttr(); int formatFlags = attribute.getFormatFlags(); @@ -280,7 +278,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { } } - Builder<String, ResourceXmlAttrValue> formats = ImmutableMap.builder(); + ImmutableMap.Builder<String, ResourceXmlAttrValue> formats = ImmutableMap.builder(); for (String formatName : formatNames) { switch (formatName) { case FLAGS: @@ -455,7 +453,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { public static Entry<String, ResourceXmlAttrValue> asEntryOf(String... keyThenValue) { Preconditions.checkArgument(keyThenValue.length > 0); Preconditions.checkArgument(keyThenValue.length % 2 == 0); - Builder<String, String> builder = ImmutableMap.builder(); + ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); for (int i = 0; i < keyThenValue.length; i += 2) { builder.put(keyThenValue[i], keyThenValue[i + 1]); } @@ -531,7 +529,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { @VisibleForTesting public static Entry<String, ResourceXmlAttrValue> asEntryOf(String... keyThenValue) { - Builder<String, String> builder = ImmutableMap.builder(); + ImmutableMap.Builder<String, String> builder = ImmutableMap.builder(); Preconditions.checkArgument(keyThenValue.length > 0); Preconditions.checkArgument(keyThenValue.length % 2 == 0); for (int i = 0; i < keyThenValue.length; i += 2) { diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/StyleableXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/StyleableXmlResourceValue.java index 3f56cf726e..e8df3d93d6 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/StyleableXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/StyleableXmlResourceValue.java @@ -19,7 +19,6 @@ import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableMap.Builder; import com.google.common.collect.Iterables; import com.google.devtools.build.android.AndroidCompiledDataDeserializer.ReferenceResolver; import com.google.devtools.build.android.AndroidDataWritingVisitor; @@ -96,7 +95,7 @@ public class StyleableXmlResourceValue implements XmlResourceValue { private static Map<FullyQualifiedName, Boolean> createAttrDefinitionMap( FullyQualifiedName[] attrNames, Boolean definitionType) { - Builder<FullyQualifiedName, Boolean> builder = ImmutableMap.builder(); + ImmutableMap.Builder<FullyQualifiedName, Boolean> builder = ImmutableMap.builder(); for (FullyQualifiedName attrName : attrNames) { builder.put(attrName, definitionType); } |