aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications/src/main/java
diff options
context:
space:
mode:
authorEvgeny Mandrikov <mandrikov@gmail.com>2012-05-23 02:25:19 +0600
committerEvgeny Mandrikov <mandrikov@gmail.com>2012-05-23 02:25:19 +0600
commit46605e701878daa426e851a1bd26f5fe2e73649c (patch)
tree88bcfb4b0026aaa9fa6729ba70c04f0a35b79bd0 /sonar-duplications/src/main/java
parent2580f03cb0b6e1d5de27b449daa21e1fad89ba5e (diff)
downloadsonarqube-46605e701878daa426e851a1bd26f5fe2e73649c.tar.gz
sonarqube-46605e701878daa426e851a1bd26f5fe2e73649c.zip
Fix some quality flaws
Diffstat (limited to 'sonar-duplications/src/main/java')
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java
index a94049aa940..578722b6a50 100644
--- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java
+++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java
@@ -23,6 +23,8 @@
*/
package net.sourceforge.pmd.cpd;
+import com.google.common.io.Closeables;
+
import java.io.*;
import java.lang.ref.SoftReference;
import java.util.ArrayList;
@@ -69,13 +71,7 @@ public class SourceCode {
} catch (Exception e) {
throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage(), e);
} finally {
- try {
- if (lnr != null) {
- lnr.close();
- }
- } catch (Exception e) {
- throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage(), e);
- }
+ Closeables.closeQuietly(lnr);
}
}
}