aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-duplications
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-04-27 17:05:35 +0200
committerDavid Gageot <david@gageot.net>2012-04-27 17:05:35 +0200
commitb150482f1f4ea43bc42b324994d1d1e852de6320 (patch)
tree4638118d9a32405ad844c127f38e381d9ef37ae8 /sonar-duplications
parent328e826a6a151128783ee7a3939e206202c6a990 (diff)
downloadsonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.tar.gz
sonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.zip
Code cleaning : Add @Override annotations
Diffstat (limited to 'sonar-duplications')
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/SourceCode.java4
-rw-r--r--sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java2
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/cpd/CodeLoaderWithoutCache.java1
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/cpd/FileCodeLoaderWithoutCache.java2
-rw-r--r--sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java1
5 files changed, 10 insertions, 0 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 e0fa7964913..a94049aa940 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
@@ -89,10 +89,12 @@ public class SourceCode {
this.encoding = encoding;
}
+ @Override
public Reader getReader() throws Exception {
return new InputStreamReader(new FileInputStream(file), encoding);
}
+ @Override
public String getFileName() {
return this.file.getAbsolutePath();
}
@@ -114,10 +116,12 @@ public class SourceCode {
this.name = name;
}
+ @Override
public Reader getReader() {
return new StringReader(source_code);
}
+ @Override
public String getFileName() {
return name;
}
diff --git a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
index 868b8e2eeea..f36a4328ba8 100644
--- a/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
+++ b/sonar-duplications/src/main/java/net/sourceforge/pmd/cpd/TokenEntry.java
@@ -114,6 +114,7 @@ public class TokenEntry implements Comparable<TokenEntry> {
return this.index;
}
+ @Override
public int hashCode() {
return hashCode;
}
@@ -122,6 +123,7 @@ public class TokenEntry implements Comparable<TokenEntry> {
this.hashCode = hashCode;
}
+ @Override
public boolean equals(Object o) {
if (!(o instanceof TokenEntry)) {
return false;
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/CodeLoaderWithoutCache.java b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/CodeLoaderWithoutCache.java
index 69c5ccff673..1b004e62a37 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/CodeLoaderWithoutCache.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/CodeLoaderWithoutCache.java
@@ -26,6 +26,7 @@ import net.sourceforge.pmd.cpd.SourceCode.CodeLoader;
public abstract class CodeLoaderWithoutCache extends CodeLoader {
+ @Override
public final List<String> getCode() {
return load();
}
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/FileCodeLoaderWithoutCache.java b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/FileCodeLoaderWithoutCache.java
index 802727e1c82..e6036839ad2 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/cpd/FileCodeLoaderWithoutCache.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/cpd/FileCodeLoaderWithoutCache.java
@@ -35,10 +35,12 @@ public class FileCodeLoaderWithoutCache extends CodeLoaderWithoutCache {
this.encoding = encoding;
}
+ @Override
public Reader getReader() throws Exception {
return new InputStreamReader(new FileInputStream(file), encoding);
}
+ @Override
public String getFileName() {
return this.file.getAbsolutePath();
}
diff --git a/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java b/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java
index 8be95fdcc4c..0d1f45d852e 100644
--- a/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java
+++ b/sonar-duplications/src/test/java/org/sonar/duplications/detector/CloneGroupMatcher.java
@@ -40,6 +40,7 @@ public class CloneGroupMatcher extends TypeSafeMatcher<CloneGroup> {
this.expectedParts = expectedParts;
}
+ @Override
public boolean matchesSafely(CloneGroup cloneGroup) {
// Check length
if (expectedLen != cloneGroup.getCloneUnitLength()) {