commit | 9284765f2e87af3fcff4d5656bf143e3ce747a67 | [log] [tgz] |
---|---|---|
author | Søren Gjesse <sgjesse@google.com> | Wed Nov 23 12:04:46 2022 +0100 |
committer | Søren Gjesse <sgjesse@google.com> | Thu Nov 24 07:08:09 2022 +0000 |
tree | 317dcc9c2094d3aeb11549f3628974817d804dfc | |
parent | 39d1d8755d130d70d070c23bd27baf1b04b71ac0 [diff] |
Fix R8 not writing nest annotations when inner class info is not kept Bug: b/130716228 Bug: b/236125275 Change-Id: I2cd7c020a8e4c200fc7e53503d134efe4dd9f070
diff --git a/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java b/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java index 5f0d225..4300df0 100644 --- a/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java +++ b/src/main/java/com/android/tools/r8/dex/ApplicationWriter.java
@@ -769,7 +769,8 @@ List<InnerClassAttribute> innerClasses = clazz.getInnerClasses(); if (enclosingMethod == null && innerClasses.isEmpty() - && clazz.getClassSignature().hasNoSignature()) { + && clazz.getClassSignature().hasNoSignature() + && !clazz.isInANest()) { return; }
diff --git a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java index 8e74901..9829235 100644 --- a/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java +++ b/src/test/java/com/android/tools/r8/desugar/nestaccesscontrol/NestAttributesInDexShrinkingTest.java
@@ -69,12 +69,7 @@ } private void expectNestAttributes(CodeInspector inspector) { - if (parameters.isCfRuntime()) { - inspect(inspector, true); - } else { - // TODO(b/236125275): DEX should also have the nest attributes. - expectNoNestAttributes(inspector); - } + inspect(inspector, true); } private void expectNoNestAttributes(CodeInspector inspector) {