Ignore missing desugar conversion types
Change-Id: I26190763946897eb4d2f2112028bd2d385fa48e4
diff --git a/src/main/java/com/android/tools/r8/graph/DexItemFactory.java b/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
index f8aa084..4cb631b 100644
--- a/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
+++ b/src/main/java/com/android/tools/r8/graph/DexItemFactory.java
@@ -422,9 +422,27 @@
public final DexType reflectiveOperationExceptionType =
createStaticallyKnownType(reflectiveOperationExceptionDescriptor);
public final DexType kotlinMetadataType = createStaticallyKnownType(kotlinMetadataDescriptor);
+
+ public final DexType doubleSummaryStatisticsConversionsType =
+ createStaticallyKnownType("Ljava/util/DoubleSummaryStatisticsConversions;");
+ public final DexType intSummaryStatisticsConversionsType =
+ createStaticallyKnownType("Ljava/util/IntSummaryStatisticsConversions;");
+ public final DexType longSummaryStatisticsConversionsType =
+ createStaticallyKnownType("Ljava/util/LongSummaryStatisticsConversions;");
+ public final DexType optionalConversionsType =
+ createStaticallyKnownType("Ljava/util/OptionalConversions;");
public final DexType timeConversionsType =
createStaticallyKnownType("Ljava/time/TimeConversions;");
+ public Iterable<DexType> getConversionTypes() {
+ return ImmutableList.of(
+ doubleSummaryStatisticsConversionsType,
+ intSummaryStatisticsConversionsType,
+ longSummaryStatisticsConversionsType,
+ optionalConversionsType,
+ timeConversionsType);
+ }
+
public final DexType javaIoFileType = createStaticallyKnownType("Ljava/io/File;");
public final DexType javaMathBigIntegerType = createStaticallyKnownType("Ljava/math/BigInteger;");
public final DexType javaNioByteOrderType = createStaticallyKnownType("Ljava/nio/ByteOrder;");
diff --git a/src/main/java/com/android/tools/r8/shaking/MissingClasses.java b/src/main/java/com/android/tools/r8/shaking/MissingClasses.java
index 0fe1645..1def3a9 100644
--- a/src/main/java/com/android/tools/r8/shaking/MissingClasses.java
+++ b/src/main/java/com/android/tools/r8/shaking/MissingClasses.java
@@ -122,19 +122,22 @@
}
private static Collection<DexType> getAllowedMissingClasses(DexItemFactory dexItemFactory) {
- return ImmutableList.of(
- dexItemFactory.annotationDefault,
- dexItemFactory.annotationMethodParameters,
- dexItemFactory.annotationSourceDebugExtension,
- dexItemFactory.annotationSynthesizedClass,
- dexItemFactory.annotationSynthesizedClassMap,
- dexItemFactory.annotationThrows,
- dexItemFactory.serializedLambdaType,
- // TODO(b/176133674) StringConcatFactory is backported, but the class is reported as
- // missing because the enqueuer runs prior to backporting and thus sees the non-desugared
- // code.
- dexItemFactory.stringConcatFactoryType,
- dexItemFactory.timeConversionsType);
+ return ImmutableList.<DexType>builder()
+ .add(
+ dexItemFactory.annotationDefault,
+ dexItemFactory.annotationMethodParameters,
+ dexItemFactory.annotationSourceDebugExtension,
+ dexItemFactory.annotationSynthesizedClass,
+ dexItemFactory.annotationSynthesizedClassMap,
+ dexItemFactory.annotationThrows,
+ dexItemFactory.serializedLambdaType,
+ // TODO(b/176133674) StringConcatFactory is backported, but the class is reported as
+ // missing because the enqueuer runs prior to backporting and thus sees the
+ // non-desugared
+ // code.
+ dexItemFactory.stringConcatFactoryType)
+ .addAll(dexItemFactory.getConversionTypes())
+ .build();
}
private Predicate<DexType> isCompilerSynthesizedAllowedMissingClasses(AppView<?> appView) {