Add missing @Override annotations

This commit is contained in:
Hans Joachim Desserud
2015-09-13 14:52:08 +02:00
parent 6117e25b97
commit 0ecd466c4c
24 changed files with 45 additions and 0 deletions

View File

@@ -479,6 +479,7 @@ public class Engine implements FileFilter {
* @param file a file extension * @param file a file extension
* @return true or false depending on whether or not the file extension is supported * @return true or false depending on whether or not the file extension is supported
*/ */
@Override
public boolean accept(File file) { public boolean accept(File file) {
if (file == null) { if (file == null) {
return false; return false;

View File

@@ -75,6 +75,7 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal
* *
* @return the name of the analyzer. * @return the name of the analyzer.
*/ */
@Override
public String getName() { public String getName() {
return ANALYZER_NAME; return ANALYZER_NAME;
} }
@@ -84,6 +85,7 @@ public class DependencyBundlingAnalyzer extends AbstractAnalyzer implements Anal
* *
* @return the phase that the analyzer is intended to run in. * @return the phase that the analyzer is intended to run in.
*/ */
@Override
public AnalysisPhase getAnalysisPhase() { public AnalysisPhase getAnalysisPhase() {
return ANALYSIS_PHASE; return ANALYSIS_PHASE;
} }

View File

@@ -69,6 +69,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
* *
* @return the name of the analyzer. * @return the name of the analyzer.
*/ */
@Override
public String getName() { public String getName() {
return ANALYZER_NAME; return ANALYZER_NAME;
} }
@@ -78,6 +79,7 @@ public class FalsePositiveAnalyzer extends AbstractAnalyzer {
* *
* @return the phase that the analyzer is intended to run in. * @return the phase that the analyzer is intended to run in.
*/ */
@Override
public AnalysisPhase getAnalysisPhase() { public AnalysisPhase getAnalysisPhase() {
return ANALYSIS_PHASE; return ANALYSIS_PHASE;
} }

View File

@@ -48,6 +48,7 @@ public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
* *
* @return the name of the analyzer. * @return the name of the analyzer.
*/ */
@Override
public String getName() { public String getName() {
return ANALYZER_NAME; return ANALYZER_NAME;
} }
@@ -57,6 +58,7 @@ public class FileNameAnalyzer extends AbstractAnalyzer implements Analyzer {
* *
* @return the phase that the analyzer is intended to run in. * @return the phase that the analyzer is intended to run in.
*/ */
@Override
public AnalysisPhase getAnalysisPhase() { public AnalysisPhase getAnalysisPhase() {
return ANALYSIS_PHASE; return ANALYSIS_PHASE;
} }

View File

@@ -195,6 +195,7 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer {
* *
* @return the phase that the analyzer is intended to run in. * @return the phase that the analyzer is intended to run in.
*/ */
@Override
public AnalysisPhase getAnalysisPhase() { public AnalysisPhase getAnalysisPhase() {
return ANALYSIS_PHASE; return ANALYSIS_PHASE;
} }

View File

@@ -116,6 +116,7 @@ class DriverShim implements Driver {
* @see java.sql.Driver#getParentLogger() * @see java.sql.Driver#getParentLogger()
*/ */
//@Override //@Override
@Override
public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException { public java.util.logging.Logger getParentLogger() throws SQLFeatureNotSupportedException {
//return driver.getParentLogger(); //return driver.getParentLogger();
Method m = null; Method m = null;

View File

@@ -696,6 +696,7 @@ public class Dependency implements Serializable, Comparable<Dependency> {
* @param o a dependency to compare * @param o a dependency to compare
* @return an integer representing the natural ordering * @return an integer representing the natural ordering
*/ */
@Override
public int compareTo(Dependency o) { public int compareTo(Dependency o) {
return this.getFilePath().compareToIgnoreCase(o.getFilePath()); return this.getFilePath().compareToIgnoreCase(o.getFilePath());
} }

View File

@@ -234,6 +234,7 @@ public class Evidence implements Serializable, Comparable<Evidence> {
* @param o the evidence being compared * @param o the evidence being compared
* @return an integer indicating the ordering of the two objects * @return an integer indicating the ordering of the two objects
*/ */
@Override
public int compareTo(Evidence o) { public int compareTo(Evidence o) {
if (o == null) { if (o == null) {
return 1; return 1;

View File

@@ -51,6 +51,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* Used to iterate over highest confidence evidence contained in the collection. * Used to iterate over highest confidence evidence contained in the collection.
*/ */
private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() { private static final Filter<Evidence> HIGHEST_CONFIDENCE = new Filter<Evidence>() {
@Override
public boolean passes(Evidence evidence) { public boolean passes(Evidence evidence) {
return evidence.getConfidence() == Confidence.HIGHEST; return evidence.getConfidence() == Confidence.HIGHEST;
} }
@@ -59,6 +60,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* Used to iterate over high confidence evidence contained in the collection. * Used to iterate over high confidence evidence contained in the collection.
*/ */
private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() { private static final Filter<Evidence> HIGH_CONFIDENCE = new Filter<Evidence>() {
@Override
public boolean passes(Evidence evidence) { public boolean passes(Evidence evidence) {
return evidence.getConfidence() == Confidence.HIGH; return evidence.getConfidence() == Confidence.HIGH;
} }
@@ -67,6 +69,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* Used to iterate over medium confidence evidence contained in the collection. * Used to iterate over medium confidence evidence contained in the collection.
*/ */
private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() { private static final Filter<Evidence> MEDIUM_CONFIDENCE = new Filter<Evidence>() {
@Override
public boolean passes(Evidence evidence) { public boolean passes(Evidence evidence) {
return evidence.getConfidence() == Confidence.MEDIUM; return evidence.getConfidence() == Confidence.MEDIUM;
} }
@@ -75,6 +78,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* Used to iterate over low confidence evidence contained in the collection. * Used to iterate over low confidence evidence contained in the collection.
*/ */
private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() { private static final Filter<Evidence> LOW_CONFIDENCE = new Filter<Evidence>() {
@Override
public boolean passes(Evidence evidence) { public boolean passes(Evidence evidence) {
return evidence.getConfidence() == Confidence.LOW; return evidence.getConfidence() == Confidence.LOW;
} }
@@ -83,6 +87,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* Used to iterate over evidence that has was used (aka read) from the collection. * Used to iterate over evidence that has was used (aka read) from the collection.
*/ */
private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() { private static final Filter<Evidence> EVIDENCE_USED = new Filter<Evidence>() {
@Override
public boolean passes(Evidence evidence) { public boolean passes(Evidence evidence) {
return evidence.isUsed(); return evidence.isUsed();
} }
@@ -222,6 +227,7 @@ public class EvidenceCollection implements Serializable, Iterable<Evidence> {
* *
* @return an Iterator<Evidence>. * @return an Iterator<Evidence>.
*/ */
@Override
public Iterator<Evidence> iterator() { public Iterator<Evidence> iterator() {
return list.iterator(); return list.iterator();
} }

View File

@@ -221,6 +221,7 @@ public class Identifier implements Serializable, Comparable<Identifier> {
* @param o the object being compared * @param o the object being compared
* @return an integer indicating the ordering * @return an integer indicating the ordering
*/ */
@Override
public int compareTo(Identifier o) { public int compareTo(Identifier o) {
if (o == null) { if (o == null) {
return -1; return -1;

View File

@@ -133,6 +133,7 @@ public class Reference implements Serializable, Comparable<Reference> {
* @param o the Reference being compared * @param o the Reference being compared
* @return an integer indicating the ordering of the two objects * @return an integer indicating the ordering of the two objects
*/ */
@Override
public int compareTo(Reference o) { public int compareTo(Reference o) {
if (source.equals(o.source)) { if (source.equals(o.source)) {
if (name.equals(o.name)) { if (name.equals(o.name)) {

View File

@@ -390,6 +390,7 @@ public class Vulnerability implements Serializable, Comparable<Vulnerability> {
* @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than * @return a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than
* the specified vulnerability * the specified vulnerability
*/ */
@Override
public int compareTo(Vulnerability v) { public int compareTo(Vulnerability v) {
return v.getName().compareTo(this.getName()); return v.getName().compareTo(this.getName());
} }

View File

@@ -39,6 +39,7 @@ public class VulnerabilityComparator implements Comparator<Vulnerability>, Seria
* @param o2 a second vulnerability * @param o2 a second vulnerability
* @return the comparison * @return the comparison
*/ */
@Override
public int compare(Vulnerability o1, Vulnerability o2) { public int compare(Vulnerability o1, Vulnerability o2) {
return o2.getName().compareTo(o1.getName()); return o2.getName().compareTo(o1.getName());
} }

View File

@@ -46,6 +46,7 @@ public class VelocityLoggerRedirect implements LogChute {
* *
* @param rsvc the RuntimeServices * @param rsvc the RuntimeServices
*/ */
@Override
public void init(RuntimeServices rsvc) { public void init(RuntimeServices rsvc) {
// do nothing // do nothing
} }
@@ -57,6 +58,7 @@ public class VelocityLoggerRedirect implements LogChute {
* @param level the logging level * @param level the logging level
* @param message the message to be logged * @param message the message to be logged
*/ */
@Override
public void log(int level, String message) { public void log(int level, String message) {
switch (level) { switch (level) {
case TRACE_ID: case TRACE_ID:
@@ -87,6 +89,7 @@ public class VelocityLoggerRedirect implements LogChute {
* @param message the message to be logged * @param message the message to be logged
* @param t a throwable to log * @param t a throwable to log
*/ */
@Override
public void log(int level, String message, Throwable t) { public void log(int level, String message, Throwable t) {
switch (level) { switch (level) {
case TRACE_ID: case TRACE_ID:
@@ -115,6 +118,7 @@ public class VelocityLoggerRedirect implements LogChute {
* @param level the logging level * @param level the logging level
* @return true * @return true
*/ */
@Override
public boolean isLevelEnabled(int level) { public boolean isLevelEnabled(int level) {
return true; return true;
} }

View File

@@ -103,6 +103,7 @@ public class DependencyVersion implements Iterable<String>, Comparable<Dependenc
* *
* @return an iterator for the version parts * @return an iterator for the version parts
*/ */
@Override
public Iterator<String> iterator() { public Iterator<String> iterator() {
return versionParts.iterator(); return versionParts.iterator();
} }

View File

@@ -23,6 +23,7 @@ public abstract class Filter<T> {
public Iterable<T> filter(final Iterable<T> iterable) { public Iterable<T> filter(final Iterable<T> iterable) {
return new Iterable<T>() { return new Iterable<T>() {
@Override
public Iterator<T> iterator() { public Iterator<T> iterator() {
return filter(iterable.iterator()); return filter(iterable.iterator());
} }
@@ -39,10 +40,12 @@ public abstract class Filter<T> {
toNext(); toNext();
} }
@Override
public boolean hasNext() { public boolean hasNext() {
return next != null; return next != null;
} }
@Override
public T next() { public T next() {
if (next == null) { if (next == null) {
throw new NoSuchElementException(); throw new NoSuchElementException();
@@ -52,6 +55,7 @@ public abstract class Filter<T> {
return returnValue; return returnValue;
} }
@Override
public void remove() { public void remove() {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@@ -52,6 +52,7 @@ public class CMakeAnalyzerTest extends BaseDBTestCase {
* *
* @throws Exception if there is a problem * @throws Exception if there is a problem
*/ */
@Override
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();

View File

@@ -47,11 +47,13 @@ public class TokenPairConcatenatingFilterTest extends BaseTokenStreamTestCase {
public static void tearDownClass() { public static void tearDownClass() {
} }
@Override
@Before @Before
public void setUp() throws Exception { public void setUp() throws Exception {
super.setUp(); super.setUp();
} }
@Override
@After @After
public void tearDown() throws Exception { public void tearDown() throws Exception {
super.tearDown(); super.tearDown();

View File

@@ -64,6 +64,7 @@ public class FilterTest {
} }
private static final Filter<String> TEST_FILTER private static final Filter<String> TEST_FILTER
= new Filter<String>() { = new Filter<String>() {
@Override
public boolean passes(String str) { public boolean passes(String str) {
return str.contains("keep"); return str.contains("keep");
} }

View File

@@ -263,6 +263,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
* @param locale the location * @param locale the location
* @return the report name * @return the report name
*/ */
@Override
public String getName(Locale locale) { public String getName(Locale locale) {
return "dependency-check:aggregate"; return "dependency-check:aggregate";
} }
@@ -273,6 +274,7 @@ public class AggregateMojo extends BaseDependencyCheckMojo {
* @param locale The Locale to get the description for * @param locale The Locale to get the description for
* @return the description * @return the description
*/ */
@Override
public String getDescription(Locale locale) { public String getDescription(Locale locale) {
return "Generates an aggregate report of all child Maven projects providing details on any " return "Generates an aggregate report of all child Maven projects providing details on any "
+ "published vulnerabilities within project dependencies. This report is a best " + "published vulnerabilities within project dependencies. This report is a best "

View File

@@ -352,6 +352,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
* @throws MavenReportException if a maven report exception occurs * @throws MavenReportException if a maven report exception occurs
* @deprecated use {@link #generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)} instead. * @deprecated use {@link #generate(org.apache.maven.doxia.sink.Sink, java.util.Locale)} instead.
*/ */
@Override
@Deprecated @Deprecated
public final void generate(@SuppressWarnings("deprecation") org.codehaus.doxia.sink.Sink sink, Locale locale) throws MavenReportException { public final void generate(@SuppressWarnings("deprecation") org.codehaus.doxia.sink.Sink sink, Locale locale) throws MavenReportException {
generate((Sink) sink, locale); generate((Sink) sink, locale);
@@ -519,6 +520,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
* *
* @return the output name * @return the output name
*/ */
@Override
public String getOutputName() { public String getOutputName() {
if ("HTML".equalsIgnoreCase(this.format) || "ALL".equalsIgnoreCase(this.format)) { if ("HTML".equalsIgnoreCase(this.format) || "ALL".equalsIgnoreCase(this.format)) {
return "dependency-check-report"; return "dependency-check-report";
@@ -537,6 +539,7 @@ public abstract class BaseDependencyCheckMojo extends AbstractMojo implements Ma
* *
* @return the category name * @return the category name
*/ */
@Override
public String getCategoryName() { public String getCategoryName() {
return MavenReport.CATEGORY_PROJECT_REPORTS; return MavenReport.CATEGORY_PROJECT_REPORTS;
} }

View File

@@ -95,6 +95,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
* @param locale the location * @param locale the location
* @return the report name * @return the report name
*/ */
@Override
public String getName(Locale locale) { public String getName(Locale locale) {
return "dependency-check"; return "dependency-check";
} }
@@ -105,6 +106,7 @@ public class CheckMojo extends BaseDependencyCheckMojo {
* @param locale The Locale to get the description for * @param locale The Locale to get the description for
* @return the description * @return the description
*/ */
@Override
public String getDescription(Locale locale) { public String getDescription(Locale locale) {
return "Generates a report providing details on any published vulnerabilities within project dependencies. " return "Generates a report providing details on any published vulnerabilities within project dependencies. "
+ "This report is a best effort and may contain false positives and false negatives."; + "This report is a best effort and may contain false positives and false negatives.";

View File

@@ -89,6 +89,7 @@ public class PurgeMojo extends BaseDependencyCheckMojo {
* @param locale the location * @param locale the location
* @return the report name * @return the report name
*/ */
@Override
public String getName(Locale locale) { public String getName(Locale locale) {
return "dependency-check-purge"; return "dependency-check-purge";
} }
@@ -99,6 +100,7 @@ public class PurgeMojo extends BaseDependencyCheckMojo {
* @param locale The Locale to get the description for * @param locale The Locale to get the description for
* @return the description * @return the description
*/ */
@Override
public String getDescription(Locale locale) { public String getDescription(Locale locale) {
return "Purges the local cache of the NVD dataT."; return "Purges the local cache of the NVD dataT.";
} }

View File

@@ -78,6 +78,7 @@ public class UpdateMojo extends BaseDependencyCheckMojo {
* @param locale the location * @param locale the location
* @return the report name * @return the report name
*/ */
@Override
public String getName(Locale locale) { public String getName(Locale locale) {
return "dependency-check-update"; return "dependency-check-update";
} }
@@ -88,6 +89,7 @@ public class UpdateMojo extends BaseDependencyCheckMojo {
* @param locale The Locale to get the description for * @param locale The Locale to get the description for
* @return the description * @return the description
*/ */
@Override
public String getDescription(Locale locale) { public String getDescription(Locale locale) {
return "Updates the local cache of the NVD data from NIST."; return "Updates the local cache of the NVD data from NIST.";
} }