]> source.dussan.org Git - sonarqube.git/commitdiff
Fix violations
authorEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 1 Feb 2012 22:08:05 +0000 (02:08 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Wed, 1 Feb 2012 22:19:18 +0000 (02:19 +0400)
sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/CPDListener.java
sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java
sonar-duplications/src/main/java/org/sonar/duplications/internal/pmd/PmdBlockChunker.java

index 7daa9716999584df365c56a10acc57acb93eb816..8832c31ea2fa51ede0d33fc56354038933bcd39a 100644 (file)
@@ -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);
 
index 8291e574d1eaebc461bdf4e2f51f19757202951d..794851b04d332e076532c4b21b5bcd6725c7bf11 100644 (file)
@@ -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);
         }
       }
     }
index 58713b204f5036a83afe04953d6ef3cdf9de4458..81ef62d7b5230ed56b5b5f4b0334a83a38384b2d 100644 (file)
@@ -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.
  */