Skip to content

missing close() call not reported in certain cases #3069

@dfa1

Description

@dfa1

I'm trying to debug an issue with rocksdbjni in a large codebase.

The missing close call is not detected for any concrete class of org.rocksdb.AbstractNativeReference:

    FileInputStream fi = new FileInputStream("asd"); <-- reported as "Stream not closed on all paths"
    ReadOptions readOptions = new ReadOptions(); <-- not reported at all

ReadOptions is a AbstractNativeReference is AutoCloseable like this:

image

is there a special flag to enable to detect such cases? I tried with
EXPERIMENTAL OBL_UNSATISFIED_OBLIGATION but it is not working with spotbugs version 4.7.3

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