diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-02 02:08:05 +0400 |
---|---|---|
committer | Evgeny Mandrikov <mandrikov@gmail.com> | 2012-02-02 02:19:18 +0400 |
commit | 42511df4e534c9113bdbe17dad19d7007c6f7ee5 (patch) | |
tree | f16acd9768269d8568edee7b9fd4a805ff297809 /sonar-duplications | |
parent | 86e42511e25364b5523600187516986b841d4c66 (diff) | |
download | sonarqube-42511df4e534c9113bdbe17dad19d7007c6f7ee5.tar.gz sonarqube-42511df4e534c9113bdbe17dad19d7007c6f7ee5.zip |
Fix violations
Diffstat (limited to 'sonar-duplications')
3 files changed, 10 insertions, 11 deletions
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/CPDListener.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/CPDListener.java index 7daa9716999..8832c31ea2f 100644 --- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/CPDListener.java +++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/CPDListener.java @@ -27,11 +27,11 @@ import java.io.File; public interface CPDListener { - public static final int INIT = 0; - public static final int HASH = 1; - public static final int MATCH = 2; - public static final int GROUPING = 3; - public static final int DONE = 4; + int INIT = 0; + int HASH = 1; + int MATCH = 2; + int GROUPING = 3; + int DONE = 4; void addedFile(int fileCount, File file); 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 8291e574d1e..794851b04d3 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 @@ -67,14 +67,14 @@ public class SourceCode { } return lines; } catch (Exception e) { - e.printStackTrace(); - throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage()); + throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage(), e); } finally { try { - if (lnr != null) + if (lnr != null) { lnr.close(); + } } catch (Exception e) { - throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage()); + throw new RuntimeException("Problem while reading " + getFileName() + ":" + e.getMessage(), e); } } } diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/PmdBlockChunker.java b/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/PmdBlockChunker.java index 58713b204f5..81ef62d7b52 100644 --- a/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/PmdBlockChunker.java +++ b/sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/PmdBlockChunker.java @@ -21,14 +21,13 @@ package org.sonar.duplications.internal.pmd; import com.google.common.collect.Lists; import org.sonar.duplications.block.Block; -import org.sonar.duplications.block.BlockChunker; import org.sonar.duplications.block.ByteArray; import java.util.Collections; import java.util.List; /** - * Differences with {@link BlockChunker}: + * Differences with {@link org.sonar.duplications.block.BlockChunker}: * works with {@link TokensLine}, * sets {@link Block#setStartUnit(int)} and {@link Block#setEndUnit(int)} - indexes of first and last token for this block. */ |