-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaEE stub not working for Resource Leak Checker #5472
Comments
There is a serious problem in In the mean time, I'll open a PR that works around this problem in the short term by changing the |
Is there any chance we could fix the |
It's possible you were planning to do that and the workaround is just a super-fast temporary fix.
That's correct, but I didn't have time to look into that this morning. It
might also require expertise from either Mike or Suzanne, too, because it's
probably a framework level issue. I opened the workaround PR to unblock you.
…On Tue, Dec 27, 2022, 12:11 PM Manu Sridharan ***@***.***> wrote:
There is a serious problem in AnnotatedTypeFactory#getDeclAnnotation,
which (when called from MustCallConsistencyAnalyzer) is not producing the
@NotOwning annotation from the stub file, contrary to its specification
(checked via print-line debugging). I don't know what the cause of that
problem is, but we should investigate further.
In the mean time, I'll open a PR that works around this problem in the
short term by changing the @NotOwning annotations to @MustCall({}),
delegating the work to the Must Call Checker.
Is there any chance we could fix the
AnnotatedTypeFactory#getDeclAnnotation method instead of doing a
workaround? My concern is that I'm not really sure where else the RLC is
currently relying on reading annotations from stub files and it is not
working. It's possible you were planning to do that and the workaround is
just a super-fast temporary fix.
—
Reply to this email directly, view it on GitHub
<#5472 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6G5NQA6NGNXDCG2YNIUF3WPMPL5ANCNFSM6AAAAAATKARJOQ>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
The underlying problem is that `@NotOwning` and `@Owning` are owned by the Must Call Checker, not the Resource Leak Checker. So, only the Must Call Checker has access to such annotations if (and only if) they were written in stub files. I fixed both the problem described in typetools#5472 and all other uses of `getDeclAnnotation(elt)` involving `Owning` or `NotOwning` in the consistency analyzer.
Input:
In
JavaEE.astub
we have marked thegetWriter()
method as@NotOwning
:https://github.com/typetools/checker-framework/blob/master/checker/src/main/java/org/checkerframework/checker/mustcall/JavaEE.astub#L17-L17
And yet, compiling the above gives an error with 3.28.0:
I used the following
javax.servlet-api-3.1.0.jar
in the classpath:https://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
The text was updated successfully, but these errors were encountered: