Skip to content

[java] CloseResource: Allow to ignore managed resources #6436

@gcuisinier

Description

@gcuisinier

Rule: CloseResource

Is your feature request related to a problem? Please describe.
When using Writer/Reader from HttpServletRequest/Response, the underlying object should be managed by the Servlet Server and so we should not explicitly close them.

Maybe it can be the case for other managed objects.

Describe the solution you'd like
Allow to setup an array of whitelisted method to create Resource, that will not need to check if it has been closed.

Describe alternatives you've considered
None
Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions