Author: krosenvold Date: Thu Nov 19 06:19:36 2015 New Revision: 1715100 URL: http://svn.apache.org/viewvc?rev=1715100&view=rev Log: Fixed file handle leak in testcase
Modified: maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java Modified: maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java?rev=1715100&r1=1715099&r2=1715100&view=diff ============================================================================== --- maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java (original) +++ maven/plugins/trunk/maven-changes-plugin/src/test/java/org/apache/maven/plugin/jira/JiraUnicodeTestCase.java Thu Nov 19 06:19:36 2015 @@ -48,7 +48,13 @@ public class JiraUnicodeTestCase JiraMojo mojo = (JiraMojo) lookupMojo( "jira-report", pom ); InputStream testJiraXmlStream = JiraUnicodeTestCase.class.getResourceAsStream( "unicode-jira-results.xml" ); - String jiraXml = IOUtils.toString( testJiraXmlStream, "utf-8" ); + String jiraXml = null; + try { + jiraXml = IOUtils.toString(testJiraXmlStream, "utf-8"); + } finally { + testJiraXmlStream.close(); + } + MockJiraDownloader mockDownloader = new MockJiraDownloader(); mockDownloader.setJiraXml( jiraXml ); mojo.setMockDownloader( mockDownloader );