Fixed
Status Update
Comments
gh...@google.com <gh...@google.com> #2
I can reproduce this (thanks for the repro project!)
It looks like the problem is that the desugared api list from r8 contains this entry:
java/util/Collection#removeIf(Ljava/util/function/Predicate;)Z
but the bytecode here doesn't match -- it's java/util/ArrayList. Collection isn't a directly implemented interface or a direct super class, it's an interface on the super super class. The most efficient thing runtime wise would be for the signature list to inline this method on all implemented subclasses. But I should probably at least for now go and make the desugared API lookup do something similar to what it does for API lookup -- search through all super classes and interfaces as well. This isn't a new problem, so I'm very surprised this hasn't come up before (or it has, and I've forgotten).
Description
While doing some other work in
ReplaceStringQuickFix
I was able to induce the following exception during intention preview:I think part of the problem is this line in
ReplaceStringQuickFix
:That line has the effect of changing the PsiFile back to a physical file (replacing the non-physical file synthesized by the intention preview code). The line was originally added to support applying Lint fixes to a different file than the one being edited (ag/12351963).
Probably we can disable intention preview in this case.