@@ -726,7 +726,7 @@ public void testBoolean(int prepareThreshold) throws SQLException {
726726 pstmt .setObject (2 , BigDecimal .ONE , Types .BOOLEAN );
727727 pstmt .setObject (3 , 0L , Types .BOOLEAN );
728728 pstmt .setObject (4 , 0x1 , Types .BOOLEAN );
729- pstmt .setObject (5 , new Float ( 0 ) , Types .BOOLEAN );
729+ pstmt .setObject (5 , ( float ) 0 , Types .BOOLEAN );
730730 pstmt .setObject (5 , 1.0d , Types .BOOLEAN );
731731 pstmt .setObject (5 , 0.0f , Types .BOOLEAN );
732732 pstmt .setObject (6 , Integer .valueOf ("1" ), Types .BOOLEAN );
@@ -859,11 +859,11 @@ public void testSetFloatInteger() throws SQLException {
859859 pstmt .executeUpdate ();
860860 pstmt .close ();
861861
862- Integer maxInteger = new Integer ( 2147483647 ) ;
863- Integer minInteger = new Integer ( -2147483648 ) ;
862+ Integer maxInteger = 2147483647 ;
863+ Integer minInteger = -2147483648 ;
864864
865- Double maxFloat = new Double ( 2147483647 ) ;
866- Double minFloat = new Double ( -2147483648 ) ;
865+ Double maxFloat = 2147483647.0 ;
866+ Double minFloat = ( double ) -2147483648 ;
867867
868868 pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
869869 pstmt .setObject (1 , maxInteger , Types .FLOAT );
@@ -896,8 +896,8 @@ public void testSetFloatString() throws SQLException {
896896
897897 String maxStringFloat = "1.0E37" ;
898898 String minStringFloat = "1.0E-37" ;
899- Double maxFloat = new Double ( 1.0E37 ) ;
900- Double minFloat = new Double ( 1.0E-37 ) ;
899+ Double maxFloat = 1.0E37 ;
900+ Double minFloat = 1.0E-37 ;
901901
902902 pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
903903 pstmt .setObject (1 , maxStringFloat , Types .FLOAT );
@@ -939,8 +939,8 @@ public void testSetFloatBigDecimal() throws SQLException {
939939
940940 BigDecimal maxBigDecimalFloat = new BigDecimal ("1.0E37" );
941941 BigDecimal minBigDecimalFloat = new BigDecimal ("1.0E-37" );
942- Double maxFloat = new Double ( 1.0E37 ) ;
943- Double minFloat = new Double ( 1.0E-37 ) ;
942+ Double maxFloat = 1.0E37 ;
943+ Double minFloat = 1.0E-37 ;
944944
945945 pstmt = con .prepareStatement ("insert into float_tab values (?,?,?)" );
946946 pstmt .setObject (1 , maxBigDecimalFloat , Types .FLOAT );
@@ -971,10 +971,10 @@ public void testSetTinyIntFloat() throws SQLException {
971971 pstmt .executeUpdate ();
972972 pstmt .close ();
973973
974- Integer maxInt = new Integer ( 127 ) ;
975- Integer minInt = new Integer ( -127 ) ;
976- Float maxIntFloat = new Float ( 127 ) ;
977- Float minIntFloat = new Float ( -127 ) ;
974+ Integer maxInt = 127 ;
975+ Integer minInt = -127 ;
976+ Float maxIntFloat = 127F ;
977+ Float minIntFloat = ( float ) -127 ;
978978
979979 pstmt = con .prepareStatement ("insert into tiny_int values (?,?,?)" );
980980 pstmt .setObject (1 , maxIntFloat , Types .TINYINT );
@@ -1027,10 +1027,10 @@ public void testSetSmallIntFloat() throws SQLException {
10271027 pstmt .executeUpdate ();
10281028 pstmt .close ();
10291029
1030- Integer maxInt = new Integer ( 32767 ) ;
1031- Integer minInt = new Integer ( -32768 ) ;
1032- Float maxIntFloat = new Float ( 32767 ) ;
1033- Float minIntFloat = new Float ( -32768 ) ;
1030+ Integer maxInt = 32767 ;
1031+ Integer minInt = -32768 ;
1032+ Float maxIntFloat = 32767F ;
1033+ Float minIntFloat = ( float ) -32768 ;
10341034
10351035 pstmt = con .prepareStatement ("insert into small_int values (?,?,?)" );
10361036 pstmt .setObject (1 , maxIntFloat , Types .SMALLINT );
@@ -1060,10 +1060,10 @@ public void testSetIntFloat() throws SQLException {
10601060 pstmt .executeUpdate ();
10611061 pstmt .close ();
10621062
1063- Integer maxInt = new Integer ( 1000 ) ;
1064- Integer minInt = new Integer ( -1000 ) ;
1065- Float maxIntFloat = new Float ( 1000 ) ;
1066- Float minIntFloat = new Float ( -1000 ) ;
1063+ Integer maxInt = 1000 ;
1064+ Integer minInt = -1000 ;
1065+ Float maxIntFloat = 1000F ;
1066+ Float minIntFloat = ( float ) -1000 ;
10671067
10681068 pstmt = con .prepareStatement ("insert into int_tab values (?,?,?)" );
10691069 pstmt .setObject (1 , maxIntFloat , Types .INTEGER );
@@ -1094,8 +1094,8 @@ public void testSetBooleanDouble() throws SQLException {
10941094 pstmt .executeUpdate ();
10951095 pstmt .close ();
10961096
1097- Double dBooleanTrue = new Double ( 1 ) ;
1098- Double dBooleanFalse = new Double ( 0 ) ;
1097+ Double dBooleanTrue = 1.0 ;
1098+ Double dBooleanFalse = ( double ) 0 ;
10991099
11001100 pstmt = con .prepareStatement ("insert into double_tab values (?,?,?)" );
11011101 pstmt .setObject (1 , Boolean .TRUE , Types .DOUBLE );
@@ -1349,7 +1349,7 @@ public void testUnknownSetObject() throws SQLException {
13491349 @ Test
13501350 public void testSetObjectCharacter () throws SQLException {
13511351 PreparedStatement ps = con .prepareStatement ("INSERT INTO texttable(te) VALUES (?)" );
1352- ps .setObject (1 , new Character ( 'z' ) );
1352+ ps .setObject (1 , 'z' );
13531353 ps .executeUpdate ();
13541354 ps .close ();
13551355 }
@@ -1362,7 +1362,7 @@ public void testSetObjectCharacter() throws SQLException {
13621362 @ Test
13631363 public void testStatementDescribe () throws SQLException {
13641364 PreparedStatement pstmt = con .prepareStatement ("SELECT ?::int" );
1365- pstmt .setObject (1 , new Integer ( 2 ) , Types .OTHER );
1365+ pstmt .setObject (1 , 2 , Types .OTHER );
13661366 for (int i = 0 ; i < 10 ; i ++) {
13671367 ResultSet rs = pstmt .executeQuery ();
13681368 assertTrue (rs .next ());
0 commit comments