As for the moment we are not making cross-file or cross-method analysis (it is planned), we are not able to tell if it is the responsibility of the method to close a Closeable/AutoCloseable retrieved using method invocation. There is no existing annotation neither which would provide the information. I changed the non-compliant example and compliant solution to something that we can actually detect.
\[~michael.gumowski], would it be appropriate to map this rule to the CodePro rule https://developers.google.com/java-dev-tools/codepro/doc/features/audit/audit_rules_com.instantiations.assist.eclipse.auditGroup.possibleErrors#com.instantiations.assist.eclipse.audit.closeInFinally[Close In Finally]?
I'm asking first for an answer based on the current implementation.
And if that answer's "no" my second question is whether we should go ahead & do the mapping & extend the implementation.
As a followup, there is also this CodePro rule: https://developers.google.com/java-dev-tools/codepro/doc/features/audit/audit_rules_com.instantiations.assist.eclipse.auditGroup.jdbc#com.instantiations.assist.eclipse.audit.closeOrder[Close Order]