Skip to content

Commit

Permalink
Test case for issue #4815.
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Jul 20, 2021
1 parent 9161117 commit b080ce9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions checker/tests/resourceleak/Issue4815.java
@@ -0,0 +1,18 @@
// Test case for https://tinyurl.com/cfissue/4815
// @skip-test until the bug is fixed.

import java.util.List;
import org.checkerframework.checker.mustcall.qual.MustCall;
import org.checkerframework.checker.mustcall.qual.Owning;

public class Issue4815 {
public <T extends Component> void initialize(
List<T> list, @Owning @MustCall("initialize") T object) {
object.initialize();
list.add(object);
}

private static class Component {
void initialize() {}
}
}

0 comments on commit b080ce9

Please sign in to comment.