Skip to content

RLC unsoundness at (pseudo?) assignments to @MustCallUnknown #6990

@Calvin-L

Description

@Calvin-L

The RLC reports no violations on this code, although the resource parameter is clearly dropped without being closed:

import org.checkerframework.checker.mustcall.qual.MustCallUnknown;
import org.checkerframework.checker.mustcall.qual.Owning;

import java.io.Closeable;

public class DropOwning {

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

  private void drop(@Owning @MustCallUnknown Object resource) {
  }

}

The manual suggests that this code should result in a required.method.not.known warning, although that doesn't seem to be the case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions