boolean (PsiExpression expression) { if (!isResourceCreation(expression)) { return true; } if (CLOSE.test(ExpressionUtils.getCallForQualifier(expression))) return true; final PsiVariable variable = ResourceInspection.getVariable(expression); if (variable instanceof PsiResourceVariable || isResourceEscaping(variable, expression)) return true; if (variable == null) return false; return ContainerUtil.or(ImplicitResourceCloser.EP_NAME.getExtensionList(), closer -> closer.isSafelyClosed(variable)); }