Add missing @Override.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1309977 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Gary D. Gregory 2012-04-05 17:53:39 +00:00
parent 8c29c67486
commit b819343483
53 changed files with 205 additions and 0 deletions

View File

@ -257,6 +257,7 @@ final class CharRange implements Iterable<Character>, Serializable {
* @return an iterator to the chars represented by this range
* @since 2.5
*/
@Override
public Iterator<Character> iterator() {
return new CharacterIterator(this);
}
@ -325,6 +326,7 @@ final class CharRange implements Iterable<Character>, Serializable {
*
* @return {@code true} if the iterator has yet to reach the character date
*/
@Override
public boolean hasNext() {
return hasNext;
}
@ -334,6 +336,7 @@ final class CharRange implements Iterable<Character>, Serializable {
*
* @return {@code Character} for the next character
*/
@Override
public Character next() {
if (hasNext == false) {
throw new NoSuchElementException();
@ -349,6 +352,7 @@ final class CharRange implements Iterable<Character>, Serializable {
* @throws UnsupportedOperationException
* @see java.util.Iterator#remove()
*/
@Override
public void remove() {
throw new UnsupportedOperationException();
}

View File

@ -485,6 +485,7 @@ public final class Range<T> implements Serializable {
* @param obj2 right hand side of comparison
* @return negative, 0, positive comparison value
*/
@Override
public int compare(Object obj1, Object obj2) {
return ((Comparable) obj1).compareTo(obj2);
}

View File

@ -1013,6 +1013,7 @@ public class CompareToBuilder implements Builder<Integer> {
* @see #toComparison()
* @since 3.0
*/
@Override
public Integer build() {
return Integer.valueOf(toComparison());
}

View File

@ -920,6 +920,7 @@ public class EqualsBuilder implements Builder<Boolean> {
*
* @since 3.0
*/
@Override
public Boolean build() {
return Boolean.valueOf(isEquals());
}

View File

@ -940,6 +940,7 @@ public class HashCodeBuilder implements Builder<Integer> {
*
* @since 3.0
*/
@Override
public Integer build() {
return Integer.valueOf(toHashCode());
}

View File

@ -1073,6 +1073,7 @@ public class ToStringBuilder implements Builder<String> {
*
* @since 3.0
*/
@Override
public String build() {
return toString();
}

View File

@ -77,6 +77,7 @@ public abstract class AtomicInitializer<T> implements ConcurrentInitializer<T> {
* @throws ConcurrentException if an error occurred during initialization of
* the object
*/
@Override
public T get() throws ConcurrentException {
T result = reference.get();

View File

@ -69,6 +69,7 @@ public abstract class AtomicSafeInitializer<T> implements
* @throws ConcurrentException if the initialization of the object causes an
* exception
*/
@Override
public final T get() throws ConcurrentException {
T result;

View File

@ -206,6 +206,7 @@ public abstract class BackgroundInitializer<T> implements
* background processing
* @throws IllegalStateException if {@link #start()} has not been called
*/
@Override
public T get() throws ConcurrentException {
try {
return getFuture().get();
@ -320,6 +321,7 @@ public abstract class BackgroundInitializer<T> implements
* @return the result object
* @throws Exception if an error occurs
*/
@Override
public T call() throws Exception {
try {
return initialize();

View File

@ -200,6 +200,7 @@ public class BasicThreadFactory implements ThreadFactory {
* @param r the {@code Runnable} to be executed by the new thread
* @return the newly created thread
*/
@Override
public Thread newThread(Runnable r) {
Thread t = getWrappedFactory().newThread(r);
initializeThread(t);
@ -372,6 +373,7 @@ public class BasicThreadFactory implements ThreadFactory {
*
* @return the new {@code BasicThreadFactory}
*/
@Override
public BasicThreadFactory build() {
BasicThreadFactory factory = new BasicThreadFactory(this);
reset();

View File

@ -347,6 +347,7 @@ public class ConcurrentUtils {
* the constant object managed by this {@code Future} implementation is
* always available.
*/
@Override
public boolean isDone() {
return true;
}
@ -354,6 +355,7 @@ public class ConcurrentUtils {
/**
* {@inheritDoc} This implementation just returns the constant value.
*/
@Override
public T get() {
return value;
}
@ -362,6 +364,7 @@ public class ConcurrentUtils {
* {@inheritDoc} This implementation just returns the constant value; it
* does not block, therefore the timeout has no meaning.
*/
@Override
public T get(long timeout, TimeUnit unit) {
return value;
}
@ -370,6 +373,7 @@ public class ConcurrentUtils {
* {@inheritDoc} This implementation always returns <b>false</b>; there
* is no background process which could be cancelled.
*/
@Override
public boolean isCancelled() {
return false;
}
@ -378,6 +382,7 @@ public class ConcurrentUtils {
* {@inheritDoc} The cancel operation is not supported. This
* implementation always returns <b>false</b>.
*/
@Override
public boolean cancel(boolean mayInterruptIfRunning) {
return false;
}

View File

@ -76,6 +76,7 @@ public class ConstantInitializer<T> implements ConcurrentInitializer<T> {
* @return the object managed by this initializer
* @throws ConcurrentException if an error occurs
*/
@Override
public T get() throws ConcurrentException {
return getObject();
}

View File

@ -88,6 +88,7 @@ public abstract class LazyInitializer<T> implements ConcurrentInitializer<T> {
* @throws ConcurrentException if an error occurred during initialization of
* the object
*/
@Override
public T get() throws ConcurrentException {
// use a temporary variable to reduce the number of reads of the
// volatile field

View File

@ -400,6 +400,7 @@ public class TimedSemaphore {
*/
protected ScheduledFuture<?> startTimer() {
return getExecutorService().scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
endOfPeriod();
}

View File

@ -304,6 +304,7 @@ public class EventListenerSupport<L> implements Serializable {
* @return the result of the method call
* @throws Throwable if an error occurs
*/
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
for (L listener : listeners) {
method.invoke(listener, args);

View File

@ -106,6 +106,7 @@ public class EventUtils {
* @return the result of the method call
* @throws Throwable if an error occurs
*/
@Override
public Object invoke(final Object proxy, final Method method, final Object[] parameters) throws Throwable {
if (eventTypes.isEmpty() || eventTypes.contains(method.getName())) {
if (hasMatchingParametersMethod(method)) {

View File

@ -164,6 +164,7 @@ public class ContextedException extends Exception implements ExceptionContext {
* @param value information needed to understand exception, may be {@code null}
* @return {@code this}, for method chaining, not {@code null}
*/
@Override
public ContextedException addContextValue(String label, Object value) {
exceptionContext.addContextValue(label, value);
return this;
@ -182,6 +183,7 @@ public class ContextedException extends Exception implements ExceptionContext {
* @param value information needed to understand exception, may be {@code null}
* @return {@code this}, for method chaining, not {@code null}
*/
@Override
public ContextedException setContextValue(String label, Object value) {
exceptionContext.setContextValue(label, value);
return this;
@ -190,6 +192,7 @@ public class ContextedException extends Exception implements ExceptionContext {
/**
* {@inheritDoc}
*/
@Override
public List<Object> getContextValues(String label) {
return this.exceptionContext.getContextValues(label);
}
@ -197,6 +200,7 @@ public class ContextedException extends Exception implements ExceptionContext {
/**
* {@inheritDoc}
*/
@Override
public Object getFirstContextValue(String label) {
return this.exceptionContext.getFirstContextValue(label);
}
@ -204,6 +208,7 @@ public class ContextedException extends Exception implements ExceptionContext {
/**
* {@inheritDoc}
*/
@Override
public List<Pair<String, Object>> getContextEntries() {
return this.exceptionContext.getContextEntries();
}
@ -211,6 +216,7 @@ public class ContextedException extends Exception implements ExceptionContext {
/**
* {@inheritDoc}
*/
@Override
public Set<String> getContextLabels() {
return exceptionContext.getContextLabels();
}
@ -240,6 +246,7 @@ public class ContextedException extends Exception implements ExceptionContext {
/**
* {@inheritDoc}
*/
@Override
public String getFormattedExceptionMessage(String baseMessage) {
return exceptionContext.getFormattedExceptionMessage(baseMessage);
}

View File

@ -164,6 +164,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
* @param value information needed to understand exception, may be {@code null}
* @return {@code this}, for method chaining, not {@code null}
*/
@Override
public ContextedRuntimeException addContextValue(String label, Object value) {
exceptionContext.addContextValue(label, value);
return this;
@ -182,6 +183,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
* @param value information needed to understand exception, may be {@code null}
* @return {@code this}, for method chaining, not {@code null}
*/
@Override
public ContextedRuntimeException setContextValue(String label, Object value) {
exceptionContext.setContextValue(label, value);
return this;
@ -190,6 +192,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
/**
* {@inheritDoc}
*/
@Override
public List<Object> getContextValues(String label) {
return this.exceptionContext.getContextValues(label);
}
@ -197,6 +200,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
/**
* {@inheritDoc}
*/
@Override
public Object getFirstContextValue(String label) {
return this.exceptionContext.getFirstContextValue(label);
}
@ -204,6 +208,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
/**
* {@inheritDoc}
*/
@Override
public List<Pair<String, Object>> getContextEntries() {
return this.exceptionContext.getContextEntries();
}
@ -211,6 +216,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
/**
* {@inheritDoc}
*/
@Override
public Set<String> getContextLabels() {
return exceptionContext.getContextLabels();
}
@ -240,6 +246,7 @@ public class ContextedRuntimeException extends RuntimeException implements Excep
/**
* {@inheritDoc}
*/
@Override
public String getFormattedExceptionMessage(String baseMessage) {
return exceptionContext.getFormattedExceptionMessage(baseMessage);
}

View File

@ -49,6 +49,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public DefaultExceptionContext addContextValue(String label, Object value) {
contextValues.add(new ImmutablePair<String, Object>(label, value));
return this;
@ -57,6 +58,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public DefaultExceptionContext setContextValue(String label, Object value) {
for (final Iterator<Pair<String, Object>> iter = contextValues.iterator(); iter.hasNext();) {
final Pair<String, Object> p = iter.next();
@ -71,6 +73,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public List<Object> getContextValues(String label) {
final List<Object> values = new ArrayList<Object>();
for (final Pair<String, Object> pair : contextValues) {
@ -84,6 +87,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public Object getFirstContextValue(String label) {
for (final Pair<String, Object> pair : contextValues) {
if (StringUtils.equals(label, pair.getKey())) {
@ -96,6 +100,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public Set<String> getContextLabels() {
final Set<String> labels = new HashSet<String>();
for (final Pair<String, Object> pair : contextValues) {
@ -107,6 +112,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
/**
* {@inheritDoc}
*/
@Override
public List<Pair<String, Object>> getContextEntries() {
return contextValues;
}
@ -117,6 +123,7 @@ public class DefaultExceptionContext implements ExceptionContext, Serializable {
* @param baseMessage the base exception message <b>without</b> context information appended
* @return the exception message <b>with</b> context information appended, never null
*/
@Override
public String getFormattedExceptionMessage(String baseMessage){
StringBuilder buffer = new StringBuilder(256);
if (baseMessage != null) {

View File

@ -879,6 +879,7 @@ public final class Fraction extends Number implements Comparable<Fraction> {
* @throws ClassCastException if the object is not a <code>Fraction</code>
* @throws NullPointerException if the object is <code>null</code>
*/
@Override
public int compareTo(Fraction other) {
if (this==other) {
return 0;

View File

@ -74,6 +74,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
*
* @return the value as a Boolean, never null
*/
@Override
public Boolean getValue() {
return Boolean.valueOf(this.value);
}
@ -93,6 +94,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Boolean value) {
this.value = value.booleanValue();
}
@ -174,6 +176,7 @@ public class MutableBoolean implements Mutable<Boolean>, Serializable, Comparabl
* @return negative if this is less, zero if equal, positive if greater
* where false is less than true
*/
@Override
public int compareTo(MutableBoolean other) {
boolean anotherVal = other.value;
return value == anotherVal ? 0 : (value ? 1 : -1);

View File

@ -83,6 +83,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
*
* @return the value as a Byte, never null
*/
@Override
public Byte getValue() {
return Byte.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.byteValue();
}
@ -264,6 +266,7 @@ public class MutableByte extends Number implements Comparable<MutableByte>, Muta
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableByte other) {
byte anotherVal = other.value;
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);

View File

@ -83,6 +83,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
*
* @return the value as a Double, never null
*/
@Override
public Double getValue() {
return Double.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.doubleValue();
}
@ -293,6 +295,7 @@ public class MutableDouble extends Number implements Comparable<MutableDouble>,
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableDouble other) {
double anotherVal = other.value;
return Double.compare(value, anotherVal);

View File

@ -83,6 +83,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
*
* @return the value as a Float, never null
*/
@Override
public Float getValue() {
return Float.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.floatValue();
}
@ -294,6 +296,7 @@ public class MutableFloat extends Number implements Comparable<MutableFloat>, Mu
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableFloat other) {
float anotherVal = other.value;
return Float.compare(value, anotherVal);

View File

@ -83,6 +83,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
*
* @return the value as a Integer, never null
*/
@Override
public Integer getValue() {
return Integer.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.intValue();
}
@ -254,6 +256,7 @@ public class MutableInt extends Number implements Comparable<MutableInt>, Mutabl
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableInt other) {
int anotherVal = other.value;
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);

View File

@ -83,6 +83,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
*
* @return the value as a Long, never null
*/
@Override
public Long getValue() {
return Long.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.longValue();
}
@ -254,6 +256,7 @@ public class MutableLong extends Number implements Comparable<MutableLong>, Muta
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableLong other) {
long anotherVal = other.value;
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);

View File

@ -60,6 +60,7 @@ public class MutableObject<T> implements Mutable<T>, Serializable {
*
* @return the value, may be null
*/
@Override
public T getValue() {
return this.value;
}
@ -69,6 +70,7 @@ public class MutableObject<T> implements Mutable<T>, Serializable {
*
* @param value the value to set
*/
@Override
public void setValue(T value) {
this.value = value;
}

View File

@ -83,6 +83,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
*
* @return the value as a Short, never null
*/
@Override
public Short getValue() {
return Short.valueOf(this.value);
}
@ -102,6 +103,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
* @param value the value to set, not null
* @throws NullPointerException if the object is null
*/
@Override
public void setValue(Number value) {
this.value = value.shortValue();
}
@ -264,6 +266,7 @@ public class MutableShort extends Number implements Comparable<MutableShort>, Mu
* @param other the other mutable to compare to, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(MutableShort other) {
short anotherVal = other.value;
return value < anotherVal ? -1 : (value == anotherVal ? 0 : 1);

View File

@ -182,6 +182,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
*
* @return the length
*/
@Override
public int length() {
return size;
}
@ -302,6 +303,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
* @return the character at the index
* @throws IndexOutOfBoundsException if the index is invalid
*/
@Override
public char charAt(int index) {
if (index < 0 || index >= length()) {
throw new StringIndexOutOfBoundsException(index);
@ -470,6 +472,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
* @return this, to enable chaining
* @since 3.0
*/
@Override
public StrBuilder append(CharSequence seq) {
if (seq == null) {
return appendNull();
@ -487,6 +490,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
* @return this, to enable chaining
* @since 3.0
*/
@Override
public StrBuilder append(CharSequence seq, int startIndex, int length) {
if (seq == null) {
return appendNull();
@ -721,6 +725,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
* @return this, to enable chaining
* @since 3.0
*/
@Override
public StrBuilder append(char ch) {
int len = length();
ensureCapacity(len + 1);
@ -2005,6 +2010,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable {
* {@inheritDoc}
* @since 3.0
*/
@Override
public CharSequence subSequence(int startIndex, int endIndex) {
if (startIndex < 0) {
throw new StringIndexOutOfBoundsException(startIndex);

View File

@ -500,6 +500,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @return true if there are more tokens
*/
@Override
public boolean hasNext() {
checkTokenized();
return tokenPos < tokens.length;
@ -511,6 +512,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
* @return the next String token
* @throws NoSuchElementException if there are no more elements
*/
@Override
public String next() {
if (hasNext()) {
return tokens[tokenPos++];
@ -523,6 +525,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @return the next token index
*/
@Override
public int nextIndex() {
return tokenPos;
}
@ -532,6 +535,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @return true if there are previous tokens
*/
@Override
public boolean hasPrevious() {
checkTokenized();
return tokenPos > 0;
@ -542,6 +546,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @return the previous token
*/
@Override
public String previous() {
if (hasPrevious()) {
return tokens[--tokenPos];
@ -554,6 +559,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @return the previous token index
*/
@Override
public int previousIndex() {
return tokenPos - 1;
}
@ -563,6 +569,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
*
* @throws UnsupportedOperationException always
*/
@Override
public void remove() {
throw new UnsupportedOperationException("remove() is unsupported");
}
@ -572,6 +579,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
* @param obj this parameter ignored.
* @throws UnsupportedOperationException always
*/
@Override
public void set(String obj) {
throw new UnsupportedOperationException("set() is unsupported");
}
@ -581,6 +589,7 @@ public class StrTokenizer implements ListIterator<String>, Cloneable {
* @param obj this parameter ignored.
* @throws UnsupportedOperationException always
*/
@Override
public void add(String obj) {
throw new UnsupportedOperationException("add() is unsupported");
}

View File

@ -1800,6 +1800,7 @@ public class DateUtils {
*
* @return <code>true</code> if the iterator has yet to reach the end date
*/
@Override
public boolean hasNext() {
return spot.before(endFinal);
}
@ -1809,6 +1810,7 @@ public class DateUtils {
*
* @return Object calendar for the next date
*/
@Override
public Calendar next() {
if (spot.equals(endFinal)) {
throw new NoSuchElementException();
@ -1823,6 +1825,7 @@ public class DateUtils {
* @throws UnsupportedOperationException
* @see java.util.Iterator#remove()
*/
@Override
public void remove() {
throw new UnsupportedOperationException();
}

View File

@ -393,6 +393,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @return the formatted string
* @since 2.1
*/
@Override
public String format(long millis) {
return format(new Date(millis));
}
@ -403,6 +404,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @param date the date to format
* @return the formatted string
*/
@Override
public String format(Date date) {
return printer.format(date);
}
@ -413,6 +415,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @param calendar the calendar to format
* @return the formatted string
*/
@Override
public String format(Calendar calendar) {
return printer.format(calendar);
}
@ -426,6 +429,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @return the specified string buffer
* @since 2.1
*/
@Override
public StringBuffer format(long millis, StringBuffer buf) {
return printer.format(millis, buf);
}
@ -438,6 +442,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @param buf the buffer to format into
* @return the specified string buffer
*/
@Override
public StringBuffer format(Date date, StringBuffer buf) {
return printer.format(date, buf);
}
@ -450,6 +455,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
* @param buf the buffer to format into
* @return the specified string buffer
*/
@Override
public StringBuffer format(Calendar calendar, StringBuffer buf) {
return printer.format(calendar, buf);
}
@ -461,6 +467,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
/* (non-Javadoc)
* @see DateParser#parse(java.lang.String)
*/
@Override
public Date parse(String source) throws ParseException {
return parser.parse(source);
}
@ -468,6 +475,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
/* (non-Javadoc)
* @see DateParser#parse(java.lang.String, java.text.ParsePosition)
*/
@Override
public Date parse(String source, ParsePosition pos) {
return parser.parse(source, pos);
}
@ -487,6 +495,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
*
* @return the pattern, {@link java.text.SimpleDateFormat} compatible
*/
@Override
public String getPattern() {
return printer.getPattern();
}
@ -498,6 +507,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
*
* @return the time zone
*/
@Override
public TimeZone getTimeZone() {
return printer.getTimeZone();
}
@ -507,6 +517,7 @@ public class FastDateFormat extends Format implements DateParser, DatePrinter {
*
* @return the locale
*/
@Override
public Locale getLocale() {
return printer.getLocale();
}

View File

@ -144,6 +144,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#getPattern()
*/
@Override
public String getPattern() {
return pattern;
}
@ -151,6 +152,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#getTimeZone()
*/
@Override
public TimeZone getTimeZone() {
return timeZone;
}
@ -158,6 +160,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#getLocale()
*/
@Override
public Locale getLocale() {
return locale;
}
@ -219,6 +222,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String)
*/
@Override
public Object parseObject(String source) throws ParseException {
return parse(source);
}
@ -226,6 +230,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String)
*/
@Override
public Date parse(String source) throws ParseException {
Date date= parse(source, new ParsePosition(0));
if(date==null) {
@ -237,6 +242,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#parseObject(java.lang.String, java.text.ParsePosition)
*/
@Override
public Object parseObject(String source, ParsePosition pos) {
return parse(source, pos);
}
@ -244,6 +250,7 @@ public class FastDateParser implements DateParser, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DateParser#parse(java.lang.String, java.text.ParsePosition)
*/
@Override
public Date parse(String source, ParsePosition pos) {
int offset= pos.getIndex();
Matcher matcher= parsePattern.matcher(source.substring(offset));
@ -336,6 +343,7 @@ public class FastDateParser implements DateParser, Serializable {
* ignore case comparison of keys
*/
private static final Comparator<KeyValue> IGNORE_CASE_COMPARATOR = new Comparator<KeyValue> () {
@Override
public int compare(KeyValue left, KeyValue right) {
return left.key.compareToIgnoreCase(right.key);
}
@ -565,6 +573,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean isNumber() {
char c= formatField.charAt(0);
if(c=='\'') {
@ -576,6 +585,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
escapeRegex(regex, formatField, true);
return false;
@ -584,6 +594,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
}
}
@ -605,6 +616,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean isNumber() {
return false;
}
@ -612,6 +624,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
regex.append('(');
for(KeyValue textKeyValue : parser.getDisplayNames(field)) {
@ -624,6 +637,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
KeyValue[] textKeyValues= parser.getDisplayNames(field);
int idx= Arrays.binarySearch(textKeyValues, new KeyValue(value, -1), IGNORE_CASE_COMPARATOR);
@ -657,6 +671,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean isNumber() {
return true;
}
@ -664,6 +679,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
if(parser.isNextNumber()) {
regex.append("(\\d{").append(parser.getFieldWidth()).append("}+)");
@ -677,6 +693,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
cal.set(field, modify(Integer.parseInt(value)));
}
@ -742,6 +759,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean isNumber() {
return false;
}
@ -749,6 +767,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public boolean addRegex(FastDateParser parser, StringBuilder regex) {
regex.append(validTimeZoneChars);
return true;
@ -757,6 +776,7 @@ public class FastDateParser implements DateParser, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void setCalendar(FastDateParser parser, Calendar cal, String value) {
TimeZone tz;
if(value.charAt(0)=='+' || value.charAt(0)=='-') {
@ -781,6 +801,7 @@ public class FastDateParser implements DateParser, Serializable {
private static final Strategy TEXT_MONTH_STRATEGY = new TextStrategy(Calendar.MONTH);
private static final Strategy NUMBER_MONTH_STRATEGY = new NumberStrategy(Calendar.MONTH) {
@Override
public int modify(int iValue) {
return iValue-1;
}
@ -793,11 +814,13 @@ public class FastDateParser implements DateParser, Serializable {
private static final Strategy DAY_OF_WEEK_IN_MONTH_STRATEGY = new NumberStrategy(Calendar.DAY_OF_WEEK_IN_MONTH);
private static final Strategy HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY);
private static final Strategy MODULO_HOUR_OF_DAY_STRATEGY = new NumberStrategy(Calendar.HOUR_OF_DAY) {
@Override
public int modify(int iValue) {
return iValue%24;
}
};
private static final Strategy MODULO_HOUR_STRATEGY = new NumberStrategy(Calendar.HOUR) {
@Override
public int modify(int iValue) {
return iValue%12;
}

View File

@ -375,6 +375,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
* @param pos the position - ignored
* @return the buffer passed in
*/
@Override
public StringBuffer format(Object obj, StringBuffer toAppendTo, FieldPosition pos) {
if (obj instanceof Date) {
return format((Date) obj, toAppendTo);
@ -391,6 +392,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(long)
*/
@Override
public String format(long millis) {
return format(new Date(millis));
}
@ -398,6 +400,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date)
*/
@Override
public String format(Date date) {
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
c.setTime(date);
@ -407,6 +410,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar)
*/
@Override
public String format(Calendar calendar) {
return format(calendar, new StringBuffer(mMaxLengthEstimate)).toString();
}
@ -414,6 +418,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(long, java.lang.StringBuffer)
*/
@Override
public StringBuffer format(long millis, StringBuffer buf) {
return format(new Date(millis), buf);
}
@ -421,6 +426,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Date, java.lang.StringBuffer)
*/
@Override
public StringBuffer format(Date date, StringBuffer buf) {
Calendar c = new GregorianCalendar(mTimeZone, mLocale); // hard code GregorianCalendar
c.setTime(date);
@ -430,6 +436,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#format(java.util.Calendar, java.lang.StringBuffer)
*/
@Override
public StringBuffer format(Calendar calendar, StringBuffer buf) {
return applyRules(calendar, buf);
}
@ -454,6 +461,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#getPattern()
*/
@Override
public String getPattern() {
return mPattern;
}
@ -461,6 +469,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()
*/
@Override
public TimeZone getTimeZone() {
return mTimeZone;
}
@ -468,6 +477,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/* (non-Javadoc)
* @see org.apache.commons.lang3.time.DatePrinter#getLocale()
*/
@Override
public Locale getLocale() {
return mLocale;
}
@ -593,6 +603,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 1;
}
@ -600,6 +611,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValue);
}
@ -624,6 +636,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return mValue.length();
}
@ -631,6 +644,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValue);
}
@ -658,6 +672,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
int max = 0;
for (int i=mValues.length; --i >= 0; ) {
@ -672,6 +687,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
buffer.append(mValues[calendar.get(mField)]);
}
@ -695,6 +711,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 4;
}
@ -702,6 +719,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
@ -709,6 +727,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
if (value < 10) {
buffer.append((char)(value + '0'));
@ -738,6 +757,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 2;
}
@ -745,6 +765,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
}
@ -752,6 +773,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
if (value < 10) {
buffer.append((char)(value + '0'));
@ -787,6 +809,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 4;
}
@ -794,6 +817,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
@ -801,6 +825,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
if (value < 100) {
for (int i = mSize; --i >= 2; ) {
@ -842,6 +867,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 2;
}
@ -849,6 +875,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(mField));
}
@ -856,6 +883,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
if (value < 100) {
buffer.append((char)(value / 10 + '0'));
@ -882,6 +910,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 2;
}
@ -889,6 +918,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.YEAR) % 100);
}
@ -896,6 +926,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
buffer.append((char)(value / 10 + '0'));
buffer.append((char)(value % 10 + '0'));
@ -918,6 +949,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 2;
}
@ -925,6 +957,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
appendTo(buffer, calendar.get(Calendar.MONTH) + 1);
}
@ -932,6 +965,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public final void appendTo(StringBuffer buffer, int value) {
buffer.append((char)(value / 10 + '0'));
buffer.append((char)(value % 10 + '0'));
@ -957,6 +991,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return mRule.estimateLength();
}
@ -964,6 +999,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
int value = calendar.get(Calendar.HOUR);
if (value == 0) {
@ -975,6 +1011,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, int value) {
mRule.appendTo(buffer, value);
}
@ -999,6 +1036,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return mRule.estimateLength();
}
@ -1006,6 +1044,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
int value = calendar.get(Calendar.HOUR_OF_DAY);
if (value == 0) {
@ -1017,6 +1056,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, int value) {
mRule.appendTo(buffer, value);
}
@ -1074,6 +1114,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return Math.max(mStandard.length(), mDaylight.length());
}
@ -1081,6 +1122,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
if (mTimeZone.useDaylightTime() && calendar.get(Calendar.DST_OFFSET) != 0) {
buffer.append(mDaylight);
@ -1112,6 +1154,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public int estimateLength() {
return 5;
}
@ -1119,6 +1162,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
/**
* {@inheritDoc}
*/
@Override
public void appendTo(StringBuffer buffer, Calendar calendar) {
int offset = calendar.get(Calendar.ZONE_OFFSET) + calendar.get(Calendar.DST_OFFSET);

View File

@ -96,6 +96,7 @@ public final class ImmutablePair<L, R> extends Pair<L, R> {
* @return never
* @throws UnsupportedOperationException as this operation is not supported
*/
@Override
public R setValue(R value) {
throw new UnsupportedOperationException();
}

View File

@ -114,6 +114,7 @@ public class MutablePair<L, R> extends Pair<L, R> {
* @param value the right value to set, not null
* @return the old value for the right element
*/
@Override
public R setValue(R value) {
R result = getRight();
setRight(value);

View File

@ -87,6 +87,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
*
* @return the left element as the key, may be null
*/
@Override
public final L getKey() {
return getLeft();
}
@ -99,6 +100,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
*
* @return the right element as the value, may be null
*/
@Override
public R getValue() {
return getRight();
}
@ -111,6 +113,7 @@ public abstract class Pair<L, R> implements Map.Entry<L, R>, Comparable<Pair<L,
* @param other the other pair, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(Pair<L, R> other) {
return new CompareToBuilder().append(getLeft(), other.getLeft())
.append(getRight(), other.getRight()).toComparison();

View File

@ -91,6 +91,7 @@ public abstract class Triple<L, M, R> implements Comparable<Triple<L, M, R>>, Se
* @param other the other triple, not null
* @return negative if this is less, zero if equal, positive if greater
*/
@Override
public int compareTo(Triple<L, M, R> other) {
return new CompareToBuilder().append(getLeft(), other.getLeft())
.append(getMiddle(), other.getMiddle())

View File

@ -451,6 +451,7 @@ public class AnnotationUtilsTest {
InvocationHandler generatedTestInvocationHandler = new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ("equals".equals(method.getName()) && method.getParameterTypes().length == 1) {
return Boolean.valueOf(proxy == args[0]);

View File

@ -228,12 +228,15 @@ public class ArrayUtilsTest extends TestCase {
} catch (IllegalArgumentException ex) {}
map = ArrayUtils.toMap(new Object[] {new Map.Entry<Object, Object>() {
@Override
public Object getKey() {
return "foo";
}
@Override
public Object getValue() {
return "bar";
}
@Override
public Object setValue(Object value) {
throw new UnsupportedOperationException();
}

View File

@ -489,14 +489,17 @@ public class ObjectUtilsTest {
this.value = value;
}
@Override
public char charAt(int arg0) {
return value.charAt(arg0);
}
@Override
public int length() {
return value.length();
}
@Override
public CharSequence subSequence(int arg0, int arg1) {
return value.subSequence(arg0, arg1);
}
@ -509,6 +512,7 @@ public class ObjectUtilsTest {
static final class CharSequenceComparator implements Comparator<CharSequence> {
@Override
public int compare(CharSequence o1, CharSequence o2) {
return o1.toString().compareTo(o2.toString());
}

View File

@ -67,6 +67,7 @@ public class RangeTest {
public void testComparableConstructors() {
Comparable c =
new Comparable() {
@Override
public int compareTo(Object other) {
return 1;
}
@ -80,6 +81,7 @@ public class RangeTest {
@Test
public void testIsWithCompare(){
Comparator<Integer> c = new Comparator<Integer>(){
@Override
public int compare(Integer o1, Integer o2) {
return 0; // all integers are equal
}
@ -98,6 +100,7 @@ public class RangeTest {
public void testBetweenWithCompare(){
// TODO add tests with a better comparator
Comparator<Integer> c = new Comparator<Integer>(){
@Override
public int compare(Integer o1, Integer o2) {
return 0; // all integers are equal
}

View File

@ -453,14 +453,17 @@ public class StringUtilsEqualsIndexOfTest extends TestCase {
this.seq = seq;
}
@Override
public char charAt(int index) {
return seq.charAt(index);
}
@Override
public int length() {
return seq.length();
}
@Override
public CharSequence subSequence(int start, int end) {
return new CustomCharSequence(seq.subSequence(start, end));
}
@ -474,6 +477,7 @@ public class StringUtilsEqualsIndexOfTest extends TestCase {
return seq.equals(other.seq);
}
@Override
public String toString() {
return seq.toString();
}

View File

@ -57,6 +57,7 @@ public class CompareToBuilderTest {
public int getA() {
return a;
}
@Override
public int compareTo(TestObject rhs) {
return a < rhs.a ? -1 : a > rhs.a ? +1 : 0;
}

View File

@ -90,6 +90,7 @@ public class ReflectionToStringBuilderConcurrencyTest {
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
// Consumes toStrings
Callable<Integer> consumer = new Callable<Integer>() {
@Override
public Integer call() {
for (int i = 0; i < REPEAT; i++) {
String s = ReflectionToStringBuilder.toString(holder);
@ -100,6 +101,7 @@ public class ReflectionToStringBuilderConcurrencyTest {
};
// Produces changes in the list
Callable<Integer> producer = new Callable<Integer>() {
@Override
public Integer call() {
for (int i = 0; i < DATA_SIZE; i++) {
list.remove(list.get(0));

View File

@ -67,6 +67,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest {
this.testFixture = testFixture;
}
@Override
public void run() {
if (random.nextBoolean()) {
testFixture.add();
@ -84,6 +85,7 @@ public class ReflectionToStringBuilderMutateInspectConcurrencyTest {
this.testFixture = testFixture;
}
@Override
public void run() {
ReflectionToStringBuilder.toString(testFixture);
}

View File

@ -90,6 +90,7 @@ public class ToStringStyleConcurrencyTest {
final ExecutorService threadPool = Executors.newFixedThreadPool(2);
// Consumes toStrings
Callable<Integer> consumer = new Callable<Integer>() {
@Override
public Integer call() {
for (int i = 0; i < REPEAT; i++) {
// Calls ToStringStyle

View File

@ -91,6 +91,7 @@ public class CallableBackgroundInitializerTest extends TestCase {
/**
* Records this invocation and returns the test result.
*/
@Override
public Integer call() throws Exception {
callCount++;
return RESULT;

View File

@ -147,6 +147,7 @@ public class EventListenerSupportTest extends TestCase
EventListenerSupport<VetoableChangeListener> listenerSupport = EventListenerSupport.create(VetoableChangeListener.class);
listenerSupport.addListener(new VetoableChangeListener() {
@Override
public void vetoableChange(PropertyChangeEvent e) {
}
});
@ -220,6 +221,7 @@ public class EventListenerSupportTest extends TestCase
{
listenerSupport.addListener(new VetoableChangeListener()
{
@Override
public void vetoableChange(PropertyChangeEvent e)
{
listenerSupport.removeListener(this);
@ -231,6 +233,7 @@ public class EventListenerSupportTest extends TestCase
{
return new VetoableChangeListener()
{
@Override
public void vetoableChange(PropertyChangeEvent e)
{
calledListeners.add(this);

View File

@ -83,6 +83,7 @@ public class EventUtilsTest extends TestCase
{
EventUtils.addEventListener(src, PropertyChangeListener.class, new PropertyChangeListener()
{
@Override
public void propertyChange(PropertyChangeEvent e)
{
// Do nothing!
@ -201,6 +202,7 @@ public class EventUtilsTest extends TestCase
return count == null ? 0 : count.intValue();
}
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
{
Integer count = eventCounts.get(method.getName());

View File

@ -115,10 +115,12 @@ public class MethodUtilsTest {
}
private static class TestMutable implements Mutable<Object> {
@Override
public Object getValue() {
return null;
}
@Override
public void setValue(Object value) {
}
}

View File

@ -412,6 +412,7 @@ public class ExtendedMessageFormatTest extends TestCase {
*/
private static class LowerCaseFormatFactory implements FormatFactory {
private static final Format LOWER_INSTANCE = new LowerCaseFormat();
@Override
public Format getFormat(String name, String arguments, Locale locale) {
return LOWER_INSTANCE;
}
@ -421,6 +422,7 @@ public class ExtendedMessageFormatTest extends TestCase {
*/
private static class UpperCaseFormatFactory implements FormatFactory {
private static final Format UPPER_INSTANCE = new UpperCaseFormat();
@Override
public Format getFormat(String name, String arguments, Locale locale) {
return UPPER_INSTANCE;
}
@ -429,6 +431,7 @@ public class ExtendedMessageFormatTest extends TestCase {
* {@link FormatFactory} implementation to override date format "short" to "default".
*/
private static class OverrideShortDateFormatFactory implements FormatFactory {
@Override
public Format getFormat(String name, String arguments, Locale locale) {
return !"short".equals(arguments) ? null
: locale == null ? DateFormat

View File

@ -281,6 +281,7 @@ public class FastDateFormatTest {
for(int i= 0; i<NTHREADS; ++i) {
pool.submit(new Runnable() {
@Override
public void run() {
for(int i= 0; i<NROUNDS; ++i) {
try {