You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2014/08/21 22:20:30 UTC

svn commit: r1619563 - /maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java

Author: rfscholte
Date: Thu Aug 21 20:20:29 2014
New Revision: 1619563

URL: http://svn.apache.org/r1619563
Log:
projectClassLoader is an URLClassLoader, which implements Closeable. instanceof-check not required

Modified:
    maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java

Modified: maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java?rev=1619563&r1=1619562&r2=1619563&view=diff
==============================================================================
--- maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java (original)
+++ maven/plugins/trunk/maven-checkstyle-plugin/src/main/java/org/apache/maven/plugin/checkstyle/exec/DefaultCheckstyleExecutor.java Thu Aug 21 20:20:29 2014
@@ -248,17 +248,14 @@ public class DefaultCheckstyleExecutor
 
         checker.destroy();
 
-        if ( projectClassLoader instanceof Closeable )
+        try
         {
-            try
-            {
-                ( ( Closeable ) projectClassLoader ).close();
-            }
-            catch ( IOException ex ) 
-            {
-                // Nothing we can do - and not detrimental to the build (save running out of file handles).
-                getLogger().info( "Failed to close custom Classloader - this indicated a bug in the code.", ex );
-            }
+            projectClassLoader.close();
+        }
+        catch ( IOException ex )
+        {
+            // Nothing we can do - and not detrimental to the build (save running out of file handles).
+            getLogger().info( "Failed to close custom Classloader - this indicated a bug in the code.", ex );
         }
 
         if ( request.getStringOutputStream() != null )