Expose a BaseActivity methods to work around compiler/desugar bug.
This is a follow-up to commit 5d19b09512dd7a1bccce3142b97589d89ad68e56 which made a corresponding change in SetupWizard. OpenJDK 9's LambdaMetaFactory's behavior differs from OpenJDK 8's when a lambda or method reference (this::methodname) references a supertype's protected method: OpenJDK 9 will generate a invokevirtual call to the (inherited) child method whereas OpenJDK 8 generates an invokevirtual call to the parent method. If the child class is in a different package, this call fails in the desugared lambda class (which lives in the child package) because the lambda class is a non-subclass in the child's package and therefore doesn't have access to the parent's protected method. Surprisingly, this invocation succeeds at OpenJDK 9 runtime even when invoking java -Xverify. This behavior change was likely introduced upstream in [1] but the corresponding bug [2] doesn't seem to exist. It is therefore not clear whether this is a bug in LambdaMetaFactory, desugar, or an integration bug between desugar and LambdaMetaFactory (perhaps a misunderstanding of the semantics of the "owner" attribute). Subclasses refer to protected BaseActivity methods via "this::popDir" and "this::focusSidebar". This CL adds overrides to those methods in the subclass. This makes the method available to other classes in the same package (such as the desugared method reference/lambda), fixing compilation. [1] http://hg.openjdk.java.net/jdk9/dev/jdk/rev/a3b3c7b6464d [2] https://bugs.openjdk.java.net/browse/JDK-8175806 Bug: 62218600 Test: make checkbuild (with OpenJDK 9 toolchain) Change-Id: I7353dff1083c625cbde7ef1348c24e2848e6c0d2
Loading
Please register or sign in to comment