Update of /cvsroot/firebird/interclient/20/dev/packages/interbase/interclient
In directory usw-pr-cvs1:/tmp/cvs-serv12929
Modified Files:
PreparedStatement.java
Log Message:
Changed construction of BigDecimal objects for longs to use correct factory method instead of nonexistent constructor. Problem discovered and fix by Michael Wyraz (mic...@ev...)
Index: PreparedStatement.java
===================================================================
RCS file: /cvsroot/firebird/interclient/20/dev/packages/interbase/interclient/PreparedStatement.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -U3 -r1.2 -r1.3
--- PreparedStatement.java 2001/02/03 08:32:31 1.2
+++ PreparedStatement.java 2001/06/18 13:59:45 1.3
@@ -72,8 +72,10 @@
private final static java.math.BigDecimal bdMaxDoubleValue = new java.math.BigDecimal (Double.MAX_VALUE);
private final static java.math.BigDecimal bdMinDoubleValue = new java.math.BigDecimal (-Double.MAX_VALUE);
// CJL-IB6 add limits for new long types
- private final static java.math.BigDecimal bdMaxLongValue = new java.math.BigDecimal (Long.MAX_VALUE);
- private final static java.math.BigDecimal bdMinLongValue = new java.math.BigDecimal (Long.MIN_VALUE);
+ // michael wyraz, 2001-06-12:
+ //Changed to valueOf factory method from nonexistent constructor.
+ private final static java.math.BigDecimal bdMaxLongValue = java.math.BigDecimal.valueOf(Long.MAX_VALUE);
+ private final static java.math.BigDecimal bdMinLongValue = java.math.BigDecimal.valueOf(Long.MIN_VALUE);
// CJL-IB6 end change
// Called by Connection.close() to mark open statements as closed.
@@ -488,7 +490,9 @@
case IBTypes.DECIMAL_INTEGER__:
case IBTypes.DECIMAL_INT64__:
// CJL-IB6 end change
- scaledUpBd = new java.math.BigDecimal (x);
+ // michael wyraz, 2001-06-12:
+ //Changed to valueOf factory method from nonexistent constructor.
+ scaledUpBd = java.math.BigDecimal.valueOf(x);
scaledUpBd = scaledUpBd.movePointRight (inputScales_[parameterIndex-1]);
scaledUpBd = scaledUpBd.setScale (0, java.math.BigDecimal.ROUND_HALF_DOWN);
}
@@ -577,7 +581,9 @@
case IBTypes.DECIMAL_INTEGER__:
case IBTypes.DECIMAL_INT64__:
// CJL-IB6 end change
- scaledUpBd = new java.math.BigDecimal (x);
+ // michael wyraz, 2001-06-12:
+ //Changed to valueOf factory method from nonexistent constructor.
+ scaledUpBd = java.math.BigDecimal.valueOf(x);
scaledUpBd = scaledUpBd.movePointRight (inputScales_[parameterIndex-1]);
scaledUpBd = scaledUpBd.setScale (0, java.math.BigDecimal.ROUND_HALF_DOWN);
}
|