@Test public void testClone() { StringBuffer value = new StringBuffer("x"); Constant c1 = new Constant(value, DataTypeManager.DefaultDataClasses.OBJECT); Constant copy = (Constant) c1.clone(); assertEquals("Cloned object not equal to original: ", c1, copy); value.append("y"); assertTrue("Original object has not changed, but should have", ((StringBuffer)c1.getValue()).toString().equals("xy")); assertTrue("Cloned object has not changed, but should have", ((StringBuffer)copy.getValue()).toString().equals("xy")); }
public Object clone() { Constant copy = new Constant(getValue(), getType()); copy.multiValued = multiValued; copy.bindEligible = bindEligible; return copy; }
Constant implements Expression, Comparable<Constant> { public Object clone() { Constant copy = new Constant(getValue(), getType()); copy.multiValued = multiValued; copy.bindEligible = bindEligible; return copy; } }
Constant implements Expression, Comparable<Constant> { public Object clone() { Constant copy = new Constant(getValue(), getType()); copy.multiValued = multiValued; copy.bindEligible = bindEligible; return copy; } Constant(Object value, Class<?> type);  Constant(Object value); }
Constant implements Expression, Comparable<Constant> { public Object clone() { Constant copy = new Constant(getValue(), getType()); copy.multiValued = multiValued; copy.bindEligible = bindEligible; return copy; } Constant(Object value, Class<?> type);  Constant(Object value); Class<?> getType(); void setType(Class<?> type); Object getValue(); boolean isNull(); void setMultiValued(List<?> value); boolean isMultiValued(); void acceptVisitor(LanguageVisitor visitor); boolean equals(Object obj); int hashCode(); Object clone(); String toString(); @Override int compareTo(Constant o); boolean isBindEligible(); void setBindEligible(boolean bindEligible); }
Constant implements Expression, Comparable<Constant> { public Object clone() { Constant copy = new Constant(getValue(), getType()); copy.multiValued = multiValued; copy.bindEligible = bindEligible; return copy; } Constant(Object value, Class<?> type);  Constant(Object value); Class<?> getType(); void setType(Class<?> type); Object getValue(); boolean isNull(); void setMultiValued(List<?> value); boolean isMultiValued(); void acceptVisitor(LanguageVisitor visitor); boolean equals(Object obj); int hashCode(); Object clone(); String toString(); @Override int compareTo(Constant o); boolean isBindEligible(); void setBindEligible(boolean bindEligible); static final Constant NULL_CONSTANT; static final Comparator<Object> COMPARATOR; }