Applying Felix Müller's patch from LANG-462 to fix a timezone assumption in a test and remove Java 6 interface implementation @Override statements
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1290976 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9d9a50eef1
commit
58d279ce5e
|
@ -461,7 +461,6 @@ 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);
|
||||
}
|
||||
|
@ -469,7 +468,6 @@ 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);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,6 @@ public class FastDateParser implements DateParser, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DateParser#getPattern()
|
||||
*/
|
||||
@Override
|
||||
public String getPattern() {
|
||||
return pattern;
|
||||
}
|
||||
|
@ -152,7 +151,6 @@ public class FastDateParser implements DateParser, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DateParser#getTimeZone()
|
||||
*/
|
||||
@Override
|
||||
public TimeZone getTimeZone() {
|
||||
return timeZone;
|
||||
}
|
||||
|
@ -160,7 +158,6 @@ public class FastDateParser implements DateParser, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DateParser#getLocale()
|
||||
*/
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
return locale;
|
||||
}
|
||||
|
@ -222,7 +219,6 @@ 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);
|
||||
}
|
||||
|
@ -230,7 +226,6 @@ 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) {
|
||||
|
@ -242,7 +237,6 @@ 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);
|
||||
}
|
||||
|
@ -250,7 +244,6 @@ 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));
|
||||
|
|
|
@ -375,7 +375,6 @@ 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);
|
||||
|
@ -392,7 +391,6 @@ 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));
|
||||
}
|
||||
|
@ -400,7 +398,6 @@ 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);
|
||||
|
@ -410,7 +407,6 @@ 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();
|
||||
}
|
||||
|
@ -418,7 +414,6 @@ 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);
|
||||
}
|
||||
|
@ -426,7 +421,6 @@ 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);
|
||||
|
@ -436,7 +430,6 @@ 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);
|
||||
}
|
||||
|
@ -461,7 +454,6 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DatePrinter#getPattern()
|
||||
*/
|
||||
@Override
|
||||
public String getPattern() {
|
||||
return mPattern;
|
||||
}
|
||||
|
@ -469,7 +461,6 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DatePrinter#getTimeZone()
|
||||
*/
|
||||
@Override
|
||||
public TimeZone getTimeZone() {
|
||||
return mTimeZone;
|
||||
}
|
||||
|
@ -477,7 +468,6 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
|||
/* (non-Javadoc)
|
||||
* @see org.apache.commons.lang3.time.DatePrinter#getLocale()
|
||||
*/
|
||||
@Override
|
||||
public Locale getLocale() {
|
||||
return mLocale;
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ public class FastDateParserTest {
|
|||
Date parse = fdf.parse("2003 BC February 0010 PM Saturday 0015 0033 0020 0989 GMT-05:00");
|
||||
assertEquals(cal.getTime(), parse);
|
||||
|
||||
fdf = getInstance("y G M d a E H m s S Z");
|
||||
fdf = getInstance("y G M d a E H m s S Z", NEW_YORK, Locale.US);
|
||||
assertEquals(cal.getTime(), fdf.parse("03 BC 2 10 PM Sat 15 33 20 989 -0500"));
|
||||
|
||||
cal.set(Calendar.ERA, GregorianCalendar.AD);
|
||||
|
|
Loading…
Reference in New Issue