diff options
author | 2016-04-06 01:45:07 +0000 | |
---|---|---|
committer | 2016-04-07 11:42:50 +0000 | |
commit | b94a6d1593efb1052f9d7b70d21b9658797cb005 (patch) | |
tree | 42dc2330c20d780e3a784a5a70e56cac649602ae /src/tools/android | |
parent | 3820e8dead9ea9f223a6d948f522c0e2f8a85b95 (diff) |
Fix the java compile for non-compatible type inference between java 7 and 8.
--
MOS_MIGRATED_REVID=119116506
Diffstat (limited to 'src/tools/android')
7 files changed, 28 insertions, 21 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/ArrayXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/ArrayXmlResourceValue.java index 329ae85405..2e1a10330f 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/ArrayXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/ArrayXmlResourceValue.java @@ -122,7 +122,8 @@ public class ArrayXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of(String.format("<!-- %s -->", source), arrayType.openTag(key)) + FluentIterable.from( + ImmutableList.of(String.format("<!-- %s -->", source), arrayType.openTag(key))) .append(FluentIterable.from(values).transform(ITEM_TO_XML)) .append(arrayType.closeTag())); } 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 61dfdefd6a..d245294cb4 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 @@ -231,10 +231,11 @@ public class AttrXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { ImmutableList<String> formatKeys = Ordering.natural().immutableSortedCopy(formats.keySet()); FluentIterable<String> iterable = - FluentIterable.of( - String.format("<!-- %s -->", source), - String.format( - "<attr name='%s' format='%s'>", key.name(), Joiner.on('|').join(formatKeys))); + FluentIterable.from( + ImmutableList.of( + String.format("<!-- %s -->", source), + String.format( + "<attr name='%s' format='%s'>", key.name(), Joiner.on('|').join(formatKeys)))); for (String formatKey : formatKeys) { iterable = formats.get(formatKey).appendTo(iterable); } @@ -246,7 +247,7 @@ public class AttrXmlResourceValue implements XmlResourceValue { FluentIterable<String> appendTo(FluentIterable<String> iterable); } - // TODO(corysmith): The ResourceXmlAttrValue implementors, other than enum and flag, share a + // TODO(corysmith): The ResourceXmlAttrValue implementors, other than enum and flag, share a // lot of boilerplate. Determine how to reduce it. /** Represents an Android Enum Attribute resource. */ @VisibleForTesting diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/IdXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/IdXmlResourceValue.java index 309971005f..2938256af4 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/IdXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/IdXmlResourceValue.java @@ -14,7 +14,7 @@ package com.google.devtools.build.android.xml; import com.google.common.base.MoreObjects; -import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; import com.google.devtools.build.android.AndroidDataWritingVisitor; import com.google.devtools.build.android.FullyQualifiedName; import com.google.devtools.build.android.XmlResourceValue; @@ -46,7 +46,7 @@ public class IdXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of( + ImmutableList.of( String.format("<!-- %s -->", source), String.format("<item type='id' name='%s'/>", key.name()))); } diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/PluralXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/PluralXmlResourceValue.java index 8df051797a..e47b5611c0 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/PluralXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/PluralXmlResourceValue.java @@ -16,6 +16,7 @@ package com.google.devtools.build.android.xml; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.android.AndroidDataWritingVisitor; import com.google.devtools.build.android.FullyQualifiedName; @@ -68,9 +69,10 @@ public class PluralXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of( - String.format("<!-- %s -->", source), - String.format("<plurals name='%s'>", key.name())) + FluentIterable.from( + ImmutableList.of( + String.format("<!-- %s -->", source), + String.format("<plurals name='%s'>", key.name()))) .append(FluentIterable.from(values.entrySet()).transform(ENTRY_TO_PLURAL)) .append("</plurals>")); } diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/SimpleXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/SimpleXmlResourceValue.java index 4df442f35f..dadba36c9f 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/SimpleXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/SimpleXmlResourceValue.java @@ -14,7 +14,7 @@ package com.google.devtools.build.android.xml; import com.google.common.base.MoreObjects; -import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; import com.google.devtools.build.android.AndroidDataWritingVisitor; import com.google.devtools.build.android.FullyQualifiedName; import com.google.devtools.build.android.XmlResourceValue; @@ -115,7 +115,7 @@ public class SimpleXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of( + ImmutableList.of( String.format("<!-- %s -->", source), String.format( "<%s name='%s'>%s</%s>", diff --git a/src/tools/android/java/com/google/devtools/build/android/xml/StyleXmlResourceValue.java b/src/tools/android/java/com/google/devtools/build/android/xml/StyleXmlResourceValue.java index 2067a01f77..ce11bbbda1 100644 --- a/src/tools/android/java/com/google/devtools/build/android/xml/StyleXmlResourceValue.java +++ b/src/tools/android/java/com/google/devtools/build/android/xml/StyleXmlResourceValue.java @@ -16,6 +16,7 @@ package com.google.devtools.build.android.xml; import com.google.common.base.Function; import com.google.common.base.MoreObjects; import com.google.common.collect.FluentIterable; +import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.devtools.build.android.AndroidDataWritingVisitor; import com.google.devtools.build.android.FullyQualifiedName; @@ -73,11 +74,12 @@ public class StyleXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of( - String.format("<!-- %s -->", source), - parent == null || parent.isEmpty() - ? String.format("<style name='%s'>", key.name()) - : String.format("<style name='%s' parent='%s'>", key.name(), parent)) + FluentIterable.from( + ImmutableList.of( + String.format("<!-- %s -->", source), + parent == null || parent.isEmpty() + ? String.format("<style name='%s'>", key.name()) + : String.format("<style name='%s' parent='%s'>", key.name(), parent))) .append(FluentIterable.from(values.entrySet()).transform(ENTRY_TO_ITEM)) .append("</style>")); } 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 76011237f7..4f8fadc081 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 @@ -85,9 +85,10 @@ public class StyleableXmlResourceValue implements XmlResourceValue { FullyQualifiedName key, Path source, AndroidDataWritingVisitor mergedDataWriter) { mergedDataWriter.writeToValuesXml( key, - FluentIterable.of( - String.format("<!-- %s -->", source), - String.format("<declare-styleable name='%s'>", key.name())) + FluentIterable.from( + ImmutableList.of( + String.format("<!-- %s -->", source), + String.format("<declare-styleable name='%s'>", key.name()))) .append(FluentIterable.from(attrs).transform(ITEM_TO_ATTR)) .append("</declare-styleable>")); } |