From a2b9dfbd4ea1087fcb0e6b49c08361e2e8cd2c02 Mon Sep 17 00:00:00 2001 From: "Gary D. Gregory" Date: Thu, 30 Oct 2014 14:04:49 +0000 Subject: [PATCH] Add missing '@Override' annotations Add missing '@Override' annotations to implementations of interface methods git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1635504 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/commons/csv/CSVParser.java | 5 +++++ src/main/java/org/apache/commons/csv/CSVPrinter.java | 2 ++ src/test/java/org/apache/commons/csv/TokenMatchers.java | 3 +++ 3 files changed, 10 insertions(+) diff --git a/src/main/java/org/apache/commons/csv/CSVParser.java b/src/main/java/org/apache/commons/csv/CSVParser.java index 21dd6c7b..d5723464 100644 --- a/src/main/java/org/apache/commons/csv/CSVParser.java +++ b/src/main/java/org/apache/commons/csv/CSVParser.java @@ -302,6 +302,7 @@ public final class CSVParser implements Iterable, Closeable { * @throws IOException * If an I/O error occurs */ + @Override public void close() throws IOException { if (this.lexer != null) { this.lexer.close(); @@ -424,6 +425,7 @@ public final class CSVParser implements Iterable, Closeable { * If the parser is closed a call to {@code next()} will throw a * NoSuchElementException.

*/ + @Override public Iterator iterator() { return new Iterator() { private CSVRecord current; @@ -437,6 +439,7 @@ public final class CSVParser implements Iterable, Closeable { } } + @Override public boolean hasNext() { if (CSVParser.this.isClosed()) { return false; @@ -448,6 +451,7 @@ public final class CSVParser implements Iterable, Closeable { return this.current != null; } + @Override public CSVRecord next() { if (CSVParser.this.isClosed()) { throw new NoSuchElementException("CSVParser has been closed"); @@ -466,6 +470,7 @@ public final class CSVParser implements Iterable, Closeable { return next; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/main/java/org/apache/commons/csv/CSVPrinter.java b/src/main/java/org/apache/commons/csv/CSVPrinter.java index 4e099af5..5a449628 100644 --- a/src/main/java/org/apache/commons/csv/CSVPrinter.java +++ b/src/main/java/org/apache/commons/csv/CSVPrinter.java @@ -83,6 +83,7 @@ public final class CSVPrinter implements Flushable, Closeable { // printing implementation // ====================================================== + @Override public void close() throws IOException { if (out instanceof Closeable) { ((Closeable) out).close(); @@ -95,6 +96,7 @@ public final class CSVPrinter implements Flushable, Closeable { * @throws IOException * If an I/O error occurs */ + @Override public void flush() throws IOException { if (out instanceof Flushable) { ((Flushable) out).flush(); diff --git a/src/test/java/org/apache/commons/csv/TokenMatchers.java b/src/test/java/org/apache/commons/csv/TokenMatchers.java index 296bc25b..cfe522e8 100644 --- a/src/test/java/org/apache/commons/csv/TokenMatchers.java +++ b/src/test/java/org/apache/commons/csv/TokenMatchers.java @@ -30,6 +30,7 @@ final class TokenMatchers { public static Matcher hasType(final Token.Type expectedType) { return new TypeSafeDiagnosingMatcher() { + @Override public void describeTo(final Description description) { description.appendText("token has type "); description.appendValue(expectedType); @@ -48,6 +49,7 @@ final class TokenMatchers { public static Matcher hasContent(final String expectedContent) { return new TypeSafeDiagnosingMatcher() { + @Override public void describeTo(final Description description) { description.appendText("token has content "); description.appendValue(expectedContent); @@ -66,6 +68,7 @@ final class TokenMatchers { public static Matcher isReady() { return new TypeSafeDiagnosingMatcher() { + @Override public void describeTo(final Description description) { description.appendText("token is ready "); }