This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-resources-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new b8da318 Use try with resources in integhration test (#58)
b8da318 is described below
commit b8da318893fbb75b467782a634557e3fb0c9d77d
Author: Elliotte Rusty Harold <[email protected]>
AuthorDate: Mon Mar 27 10:11:18 2023 -0400
Use try with resources in integhration test (#58)
---
src/it/MRESOURCES-99/verify.groovy | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/it/MRESOURCES-99/verify.groovy
b/src/it/MRESOURCES-99/verify.groovy
index c1944a4..b0b2e7d 100644
--- a/src/it/MRESOURCES-99/verify.groovy
+++ b/src/it/MRESOURCES-99/verify.groovy
@@ -23,8 +23,6 @@ import java.util.List;
import java.util.Collections;
import java.util.Arrays;
-import org.codehaus.plexus.util.*;
-
boolean result = true;
File target = new File( basedir, "target" );
@@ -43,23 +41,14 @@ if ( !someResource.exists() || someResource.isDirectory() )
Properties props = new Properties();
-FileInputStream fis = null;
-try
-{
- fis = new FileInputStream( someResource );
+try (FileInputStream fis = new FileInputStream( someResource )) {
props.load( fis );
- fis.close();
- fis = null;
}
catch ( IOException ex )
{
System.err.println( "Failure during reading the properties " +
someResource.getAbsolutePath() );
return false;
}
-finally
-{
- IOUtil.close( fis );
-}
def keysWhichHaveToExist = [
"timestamp",