Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public boolean derivedFromMustCallAlias() {
}

/**
* Gets the must-call type associated with the given resource alias, falling on back on the
* Gets the must-call type associated with the given resource alias, falling back on the
* declared type if there is no refined type for the alias in the store.
*
* @param alias a resource alias
Expand All @@ -367,7 +367,9 @@ private static AnnotationMirror getMustCallValue(
CFValue value = mcStore == null ? null : mcStore.getValue(reference);
if (value != null) {
AnnotationMirror result =
AnnotationUtils.getAnnotationByClass(value.getAnnotations(), MustCall.class);
mcAtf
.getQualifierHierarchy()
.findAnnotationInHierarchy(value.getAnnotations(), mcAtf.TOP);
if (result != null) {
return result;
}
Expand Down
15 changes: 15 additions & 0 deletions checker/tests/resourceleak/DropOwning.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// test case for https://github.com/typetools/checker-framework/issues/6990

import java.io.Closeable;
import org.checkerframework.checker.mustcall.qual.MustCallUnknown;
import org.checkerframework.checker.mustcall.qual.Owning;

public class DropOwning {

public void f(@Owning Closeable resource) {
drop(resource);
}

// :: error: required.method.not.known
private void drop(@Owning @MustCallUnknown Object resourceCF6990) {}
}
Loading