Reverse recent addition of date formatting. Better solution required.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137486 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6a0ce20988
commit
a1e6b5d617
|
@ -55,9 +55,7 @@ package org.apache.commons.lang.builder;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.lang.reflect.Array;
|
||||
import java.text.DateFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.lang.ObjectUtils;
|
||||
|
@ -87,7 +85,7 @@ import org.apache.commons.lang.SystemUtils;
|
|||
* @author Stephen Colebourne
|
||||
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
|
||||
* @since 1.0
|
||||
* @version $Id: ToStringStyle.java,v 1.18 2003/07/21 19:34:10 ggregory Exp $
|
||||
* @version $Id: ToStringStyle.java,v 1.19 2003/07/21 23:03:53 scolebourne Exp $
|
||||
*/
|
||||
public abstract class ToStringStyle implements Serializable {
|
||||
|
||||
|
@ -191,25 +189,6 @@ public abstract class ToStringStyle implements Serializable {
|
|||
*/
|
||||
private String summaryObjectEndText = ">";
|
||||
|
||||
/**
|
||||
* An optional <code>DateFormat</code>.
|
||||
*/
|
||||
private DateFormat dateFormat = null;
|
||||
|
||||
/**
|
||||
* Gets the <code>DateFormat</code>, which may be <code>null</code>.
|
||||
*/
|
||||
protected DateFormat getDateFormat() {
|
||||
return this.dateFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the <code>DateFormat</code>, which may be <code>null</code>.
|
||||
*/
|
||||
protected void setDateFormat(DateFormat dateFormat) {
|
||||
this.dateFormat = dateFormat;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
@ -435,13 +414,6 @@ public abstract class ToStringStyle implements Serializable {
|
|||
appendSummary(buffer, fieldName, (Object[]) value);
|
||||
}
|
||||
|
||||
} else if (value instanceof Date) {
|
||||
if (detail) {
|
||||
appendDetail(buffer, fieldName, (Date) value);
|
||||
} else {
|
||||
appendSummary(buffer, fieldName, (Object) value);
|
||||
}
|
||||
|
||||
} else {
|
||||
if (detail) {
|
||||
appendDetail(buffer, fieldName, (Object) value);
|
||||
|
@ -464,19 +436,6 @@ public abstract class ToStringStyle implements Serializable {
|
|||
buffer.append(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Append to the <code>toString</code> a <code>Date</code>
|
||||
* value, using the optional <code>DateFormat</code>.</p>
|
||||
*
|
||||
* @param buffer the <code>StringBuffer</code> to populate
|
||||
* @param fieldName the field name, typically not used as already appended
|
||||
* @param value the <code>Date</code> to add to the <code>toString</code>,
|
||||
* not <code>null</code>
|
||||
*/
|
||||
protected void appendDetail(StringBuffer buffer, String fieldName, Date value) {
|
||||
buffer.append(this.getDateFormat() != null ? this.getDateFormat().format(value) : (Object) value);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>Append to the <code>toString</code> a <code>Collection</code>.</p>
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue