Deprecate shortClassName in favour of useShortClassName for consistency

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/lang/trunk@137611 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2003-08-16 12:56:25 +00:00
parent e84bafdfe5
commit 96de49e7ae
3 changed files with 50 additions and 6 deletions

View File

@ -66,7 +66,7 @@
* @author Stephen Colebourne
* @author Pete Gieser
* @since 1.0
* @version $Id: StandardToStringStyle.java,v 1.11 2003/08/16 12:41:23 scolebourne Exp $
* @version $Id: StandardToStringStyle.java,v 1.12 2003/08/16 12:56:25 scolebourne Exp $
*/
public class StandardToStringStyle extends ToStringStyle {
@ -99,22 +99,44 @@ public void setUseClassName(boolean useClassName) {
//---------------------------------------------------------------------
/**
* <p>Gets whether to output short or long class names.</p>
*
* @return the current useShortClassName flag
*/
public boolean isUseShortClassName() {
return super.isUseShortClassName();
}
/**
* <p>Gets whether to output short or long class names.</p>
*
* @return the current shortClassName flag
* @deprecated Use {@link #isUseShortClassName()}
* Method will be removed in Commons Lang 3.0.
*/
public boolean isShortClassName() {
return super.isShortClassName();
return super.isUseShortClassName();
}
/**
* <p>Sets whether to output short or long class names.</p>
*
* @param useShortClassName the new useShortClassName flag
*/
public void setUseShortClassName(boolean useShortClassName) {
super.setUseShortClassName(useShortClassName);
}
/**
* <p>Sets whether to output short or long class names.</p>
*
* @param shortClassName the new shortClassName flag
* @deprecated Use {@link #setUseShortClassName(boolean)}
* Method will be removed in Commons Lang 3.0.
*/
public void setShortClassName(boolean shortClassName) {
super.setShortClassName(shortClassName);
super.setUseShortClassName(shortClassName);
}
//---------------------------------------------------------------------

View File

@ -87,7 +87,7 @@
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @author Pete Gieser
* @since 1.0
* @version $Id: ToStringStyle.java,v 1.22 2003/08/14 00:10:42 scolebourne Exp $
* @version $Id: ToStringStyle.java,v 1.23 2003/08/16 12:56:25 scolebourne Exp $
*/
public abstract class ToStringStyle implements Serializable {
@ -1455,19 +1455,41 @@ protected void setUseClassName(boolean useClassName) {
//---------------------------------------------------------------------
/**
* <p>Gets whether to output short or long class names.</p>
*
* @return the current useShortClassName flag
*/
protected boolean isUseShortClassName() {
return useShortClassName;
}
/**
* <p>Gets whether to output short or long class names.</p>
*
* @return the current shortClassName flag
* @deprecated Use {@link #isUseShortClassName()}
* Method will be removed in Commons Lang 3.0.
*/
protected boolean isShortClassName() {
return useShortClassName;
}
/**
* <p>Sets whether to output short or long class names.</p>
*
* @param useShortClassName the new useShortClassName flag
*/
protected void setUseShortClassName(boolean useShortClassName) {
this.useShortClassName = useShortClassName;
}
/**
* <p>Sets whether to output short or long class names.</p>
*
* @param shortClassName the new shortClassName flag
* @deprecated Use {@link #setUseShortClassName(boolean)}
* Method will be removed in Commons Lang 3.0.
*/
protected void setShortClassName(boolean shortClassName) {
this.useShortClassName = shortClassName;

View File

@ -65,7 +65,7 @@
* Unit tests {@link org.apache.commons.lang.ToStringStyle}.
*
* @author <a href="mailto:scolebourne@joda.org">Stephen Colebourne</a>
* @version $Id: StandardToStringStyleTest.java,v 1.3 2003/05/21 23:49:15 scolebourne Exp $
* @version $Id: StandardToStringStyleTest.java,v 1.4 2003/08/16 12:56:25 scolebourne Exp $
*/
public class StandardToStringStyleTest extends TestCase {
@ -75,7 +75,7 @@ public class StandardToStringStyleTest extends TestCase {
private static final StandardToStringStyle STYLE = new StandardToStringStyle();
static {
STYLE.setShortClassName(true);
STYLE.setUseShortClassName(true);
STYLE.setUseIdentityHashCode(false);
STYLE.setArrayStart("[");
STYLE.setArraySeparator(", ");