File tree Expand file tree Collapse file tree
src/main/java/org/checkerframework/checker/resourceleak Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ public boolean derivedFromMustCallAlias() {
353353 }
354354
355355 /**
356- * Gets the must-call type associated with the given resource alias, falling on back on the
356+ * Gets the must-call type associated with the given resource alias, falling back on the
357357 * declared type if there is no refined type for the alias in the store.
358358 *
359359 * @param alias a resource alias
@@ -367,7 +367,9 @@ private static AnnotationMirror getMustCallValue(
367367 CFValue value = mcStore == null ? null : mcStore .getValue (reference );
368368 if (value != null ) {
369369 AnnotationMirror result =
370- AnnotationUtils .getAnnotationByClass (value .getAnnotations (), MustCall .class );
370+ mcAtf
371+ .getQualifierHierarchy ()
372+ .findAnnotationInHierarchy (value .getAnnotations (), mcAtf .TOP );
371373 if (result != null ) {
372374 return result ;
373375 }
Original file line number Diff line number Diff line change 1+ // test case for https://github.com/typetools/checker-framework/issues/6990
2+
3+ import java .io .Closeable ;
4+ import org .checkerframework .checker .mustcall .qual .MustCallUnknown ;
5+ import org .checkerframework .checker .mustcall .qual .Owning ;
6+
7+ public class DropOwning {
8+
9+ public void f (@ Owning Closeable resource ) {
10+ drop (resource );
11+ }
12+
13+ // :: error: required.method.not.known
14+ private void drop (@ Owning @ MustCallUnknown Object resourceCF6990 ) {}
15+ }
You can’t perform that action at this time.
0 commit comments