File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
src/main/java/org/apache/maven/plugins/checkstyle/exec Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 38
38
import java .util .Properties ;
39
39
import java .util .Set ;
40
40
41
- import org .apache .commons .io .IOUtils ;
42
41
import org .apache .maven .artifact .Artifact ;
43
42
import org .apache .maven .artifact .DependencyResolutionRequiredException ;
44
43
import org .apache .maven .model .Resource ;
@@ -496,7 +495,6 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request )
496
495
throws CheckstyleExecutorException
497
496
{
498
497
Properties p = new Properties ();
499
- InputStream in = null ;
500
498
try
501
499
{
502
500
if ( request .getPropertiesLocation () != null )
@@ -511,10 +509,10 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request )
511
509
512
510
if ( propertiesFile != null )
513
511
{
514
- in = new FileInputStream ( propertiesFile );
515
- p . load ( in );
516
- in . close ( );
517
- in = null ;
512
+ try ( InputStream in = new FileInputStream ( propertiesFile ) )
513
+ {
514
+ p . load ( in );
515
+ }
518
516
}
519
517
}
520
518
@@ -570,10 +568,6 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request )
570
568
{
571
569
throw new CheckstyleExecutorException ( "Failed to get overriding properties" , e );
572
570
}
573
- finally
574
- {
575
- IOUtils .closeQuietly ( in );
576
- }
577
571
if ( request .getSuppressionsFileExpression () != null )
578
572
{
579
573
String suppressionsFilePath = getSuppressionsFilePath ( request );
You can’t perform that action at this time.
0 commit comments