package org.apache.jmeter.testelement.property;

/**
 * @author Administrator
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 */
public class BooleanProperty extends AbstractProperty
{
    boolean value;
    
    public BooleanProperty(String name,boolean v)
    {
        super(name);
        value = v;
    }
    
    public BooleanProperty()
    {
        super();
    }
    
    public void setObjectValue(Object v)
    {
        if(v instanceof Boolean)
        {
            value = ((Boolean)v).booleanValue();
        }
        else
        {
            value = Boolean.valueOf(v.toString()).booleanValue();
        }
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getStringValue()
     */
    public String getStringValue()
    {
        return Boolean.toString(value);
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getObjectValue()
     */
    public Object getObjectValue()
    {
        return new Boolean(value);
    }

    /**
     * @see java.lang.Object#clone()
     */
    public Object clone()
    {
        BooleanProperty prop = (BooleanProperty)super.clone();
        prop.value = value;
        return prop;
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getBooleanValue()
     */
    public boolean getBooleanValue()
    {
        return super.getBooleanValue();
    }

}

package org.apache.jmeter.testelement.property;

/**
 * @author Administrator
 *
 * To change this generated comment edit the template variable "typecomment":
 * Window>Preferences>Java>Templates.
 */
public class BooleanProperty extends AbstractProperty
{
    boolean value;
    
    public BooleanProperty(String name,boolean v)
    {
        super(name);
        value = v;
    }
    
    public BooleanProperty()
    {
        super();
    }
    
    public void setObjectValue(Object v)
    {
        if(v instanceof Boolean)
        {
            value = ((Boolean)v).booleanValue();
        }
        else
        {
            value = Boolean.valueOf(v.toString()).booleanValue();
        }
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getStringValue()
     */
    public String getStringValue()
    {
        return value ? "true" : "false";
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getObjectValue()
     */
    public Object getObjectValue()
    {
        return new Boolean(value);
    }

    /**
     * @see java.lang.Object#clone()
     */
    public Object clone()
    {
        BooleanProperty prop = (BooleanProperty)super.clone();
        prop.value = value;
        return prop;
    }

    /**
     * @see org.apache.jmeter.testelement.property.JMeterProperty#getBooleanValue()
     */
    public boolean getBooleanValue()
    {
        return super.getBooleanValue();
    }

}

Fix for 1.3.1 jre PR: Obtained from: Submitted by: Reviewed by: CVS: ---------------------------------------------------------------------- CVS: PR: CVS: If this change addresses a PR in the problem report tracking CVS: database, then enter the PR number(s) here. CVS: Obtained from: CVS: If this change has been taken from another system, such as NCSA, CVS: then name the system in this line, otherwise delete it. CVS: Submitted by: CVS: If this code has been contributed to Apache by someone else; i.e., CVS: they sent us a patch or a new module, then include their name/email CVS: address here. If this is your work then delete this line. CVS: Reviewed by: CVS: If we are doing pre-commit code reviews and someone else has CVS: reviewed your changes, include their name(s) here. CVS: If you have not had it reviewed then delete this line.