Vincent Devillers created KNOX-806: -------------------------------------- Summary: Implement Closeable for deallocable resources Key: KNOX-806 URL: https://issues.apache.org/jira/browse/KNOX-806 Project: Apache Knox Issue Type: Improvement Components: ClientDSL Reporter: Vincent Devillers Priority: Minor
org.apache.hadoop.gateway.shell.BasicResponse and org.apache.hadoop.gateway.shell.Hadoop are not java.io.Closeable, which means that we have to do this: {code:java} BasicResponse response = null; String jobId; try { response = Workflow.submit(getHadoop()).text(xmlConfiguration).now(); jobId = JsonPath.read(response.getString(), "$.id"); } finally { if(response != null) { response.close(); } } {code} instead of this: {code:java} String jobId; try (BasicResponse response = Workflow.submit(getHadoop()).text(xmlConfiguration).now()){ jobId = JsonPath.read(response.getString(), "$.id"); } {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)