Open lazaroclapp opened 3 years ago
The unit test doesn't get refactored because the check uses compiledWithFix
to filter suggested fixes, and the test doesn't compile after the refactoring is applied:
Caller.java:4: error: cannot find symbol
Client client = Client.client(() -> "text".text());
^
I think this might be a known limitation of the handling of lambdas.
The original issue might be separate. Was the latest version of the error-prone-annotations
artifact on the classpath for that compilation?
The crash should be fixed by dc7252bda054c3de2c349b173aca0133b2afb283.
I'll keep this open to track https://github.com/google/error-prone/issues/2347#issuecomment-844562624.
Few updates:
master
with the patch listed above, it does solve the problem within our original build! Thanks so much! 😃 (I am happy with this resolution and will enable this checker in our build when an EP release incorporating this fix is available)Client
class and the class using it are in two different build targets? (See below for some info on the classpath of both targets) Not sure, though.Was the latest version of the
error-prone-annotations
artifact on the classpath for that compilation?
It's not in -classpath
, but it is in -processorpath
for the failing javac
invocation. (It would be in -classpath
for the compilation of the target that actually includes the annotated method)
Note that we fork error-prone-annotations
because of #2122, but our artifact is identical to the 2.7.1 error-prone-annotations
except for removing usages of the @IncompatibleModifiers
meta-annotation. In particular, @InlineMe
should be unchanged there.
Description of the problem / feature request:
I am seeing the following crash on
InlineMeInliner
for Error Prone 2.7.1.This is on code edited after simply following the suggestions of
InlineMeSuggester
:Code samples below (identifier names changed, but AST structure is similar).
This gets reported on the call-site for:
Where that version of
client(...)
has been@Deprecated
and marked with@InlineMe
as follows:I can confirm, stepping through the build with a debugger, that when this line is hit when processing
imports={"com.example.Client"}
,a.type
happens to beBottomType
/<nulltype>
(even though the value does show an array containing the string"com.example.Client"
). We are using the EP javac on a JDK 8 JVM.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I tried to make a repro case as a test case for Error Prone here, but while there is indeed a problem in that the rewriting doesn't happen (and thus the test fails), it doesn't crash with the same exception. I'll be working on a stand alone project gradle that attempts to show the issue without our build system in the way and update this issue if that works.
What version of Error Prone are you using?
2.7.1
Have you found anything relevant by searching the web?
Nothing that quite matches, either as an Error Prone or a JDK bug.