Buggy code:
public final class SQLDouble extends NumberDataType { public int getInt ( ) throws StandardException { } public byte getByte ( ) throws StandardException { } public short getShort ( ) throws StandardException { } public long getLong ( ) throws StandardException { } public float getFloat ( ) throws StandardException { } public double getDouble ( ) { } public BigDecimal getBigDecimal ( ) { if ( isNull ( ) ) return null ; <START_BUG> return new BigDecimal ( value ) ; <END_BUG> } public boolean getBoolean ( ) { } public String getString ( ) { } public Object getObject ( ) { } public void setValue ( Object theValue ) throws StandardException { } protected void setFrom ( DataValueDescriptor theValue ) throws StandardException { } public int getLength ( ) { } public String getTypeName ( ) { } public int getTypeFormatId ( ) { } public boolean isNull ( ) { } public void writeExternal ( ObjectOutput out ) throws IOException { } public void readExternal ( ObjectInput in ) throws IOException { } public void readExternalFromArray ( ArrayInputStream in ) throws IOException { } public void restoreToNull ( ) { } protected int typeCompare ( DataValueDescriptor arg ) throws StandardException { } public DataValueDescriptor getClone ( ) { } public DataValueDescriptor getNewNull ( ) { } public void setValueFromResultSet ( ResultSet resultSet , int colNumber , boolean isNullable ) throws SQLException , StandardException { } public final void setInto ( PreparedStatement ps , int position ) throws SQLException { } public final void setInto ( ResultSet rs , int position ) throws SQLException , StandardException { } public SQLDouble ( ) { } public SQLDouble ( double val ) throws StandardException { } public SQLDouble ( Double obj ) throws StandardException { } private SQLDouble ( double val , boolean startsnull ) throws StandardException { } public void setValue ( String theValue ) throws StandardException { } public void setValue ( double theValue ) throws StandardException { } public void setValue ( float theValue ) throws StandardException { } public void setValue ( long theValue ) { } public void setValue ( int theValue ) { } public void setValue ( short theValue ) { } public void setValue ( byte theValue ) { } public void setValue ( Number theValue ) throws StandardException { } public void setBigDecimal ( Number bigDecimal ) throws StandardException { } public void setValue ( boolean theValue ) { } public int typePrecedence ( ) { } public BooleanDataValue equals ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public BooleanDataValue notEquals ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public BooleanDataValue lessThan ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public BooleanDataValue greaterThan ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public BooleanDataValue lessOrEquals ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public BooleanDataValue greaterOrEquals ( DataValueDescriptor left , DataValueDescriptor right ) throws StandardException { } public NumberDataValue plus ( NumberDataValue addend1 , NumberDataValue addend2 , NumberDataValue result ) throws StandardException { } public NumberDataValue minus ( NumberDataValue left , NumberDataValue right , NumberDataValue result ) throws StandardException { } public NumberDataValue times ( NumberDataValue left , NumberDataValue right , NumberDataValue result ) throws StandardException { } public NumberDataValue divide ( NumberDataValue dividend , NumberDataValue divisor , NumberDataValue result ) throws StandardException { } public NumberDataValue minus ( NumberDataValue result ) throws StandardException { } protected boolean isNegative ( ) { } public String toString ( ) { } public int hashCode ( ) { } static final int DOUBLE_LENGTH = 32 ; private static final int BASE_MEMORY_USAGE = ClassSize . estimateBaseFromCatalog ( SQLDouble . class ) ; public int estimateMemoryUsage ( ) { } private double value ; private boolean isnull ; }

Fix:
return new BigDecimal ( Double . toString ( value ) ) ;