From 42511df4e534c9113bdbe17dad19d7007c6f7ee5 Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 2 Feb 2012 02:08:05 +0400 Subject: Fix violations --- .../src/main/java/net/sourceforge/pmd/cpd/CPDListener.java | 10 +++++----- .../src/main/java/net/sourceforge/pmd/cpd/SourceCode.java | 8 ++++---- .../org/sonar/duplications/internal/pmd/PmdBlockChunker.java | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) (limited to 'sonar-duplications/src/main/java') 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. */ -- cgit v1.2.3