diff options
author | David Gageot <david@gageot.net> | 2012-04-27 17:05:35 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2012-04-27 17:05:35 +0200 |
commit | b150482f1f4ea43bc42b324994d1d1e852de6320 (patch) | |
tree | 4638118d9a32405ad844c127f38e381d9ef37ae8 /sonar-duplications/src/main/java | |
parent | 328e826a6a151128783ee7a3939e206202c6a990 (diff) | |
download | sonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.tar.gz sonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.zip |
Code cleaning : Add @Override annotations
Diffstat (limited to 'sonar-duplications/src/main/java')
4 files changed, 9 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(); } |