Skip to content

Commit

Permalink
Do not use new Long/Byte/Short/Character etc.
Browse files Browse the repository at this point in the history
They are all deprecated
  • Loading branch information
JervenBolleman authored and pkleef committed Apr 25, 2021
1 parent c49f0ef commit 70c58f0
Show file tree
Hide file tree
Showing 17 changed files with 145 additions and 145 deletions.
14 changes: 7 additions & 7 deletions libsrc/JDBCDriverType4/virtuoso/javax/BaseRowSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,7 @@ public synchronized void setBoolean(int parameterIndex, boolean x)
{
Parameter param = getParam(parameterIndex);

param.value = new Boolean(x);
param.value = Boolean.valueOf(x);
param.jType = Parameter.jObject;
}

Expand All @@ -1013,7 +1013,7 @@ public synchronized void setByte(int parameterIndex, byte x)
{
Parameter param = getParam(parameterIndex);

param.value = new Byte(x);
param.value = Byte.valueOf(x);
param.jType = Parameter.jObject;
}

Expand Down Expand Up @@ -1322,7 +1322,7 @@ public synchronized void setDouble(int parameterIndex, double x)
{
Parameter param = getParam(parameterIndex);

param.value = new Double(x);
param.value = Double.valueOf(x);
param.jType = Parameter.jObject;
}

Expand All @@ -1339,7 +1339,7 @@ public synchronized void setFloat(int parameterIndex, float x)
{
Parameter param = getParam(parameterIndex);

param.value = new Float(x);
param.value = Float.valueOf(x);
param.jType = Parameter.jObject;
}

Expand All @@ -1355,7 +1355,7 @@ public synchronized void setInt(int parameterIndex, int x)
{
Parameter param = getParam(parameterIndex);

param.value = new Integer(x);
param.value = Integer.valueOf(x);
param.jType = Parameter.jObject;
}

Expand All @@ -1371,7 +1371,7 @@ public synchronized void setLong(int parameterIndex, long x)
{
Parameter param = getParam(parameterIndex);

param.value = new Long(x);
param.value = Long.valueOf(x);
param.jType = Parameter.jObject;
}

Expand Down Expand Up @@ -1402,7 +1402,7 @@ public synchronized void setShort(int parameterIndex, short x)
{
Parameter param = getParam(parameterIndex);

param.value = new Short(x);
param.value = Short.valueOf(x);
param.jType = Parameter.jObject;
}

Expand Down
38 changes: 19 additions & 19 deletions libsrc/JDBCDriverType4/virtuoso/javax/OPLCachedRowSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2349,7 +2349,7 @@ public synchronized void updateBoolean(int columnIndex, boolean x) throws SQLExc
Row r = this.getRowForUpdate(columnIndex, "'updateBoolean(...)'");
switch(rowSMD.getColumnType(columnIndex)) {
case Types.BOOLEAN:
r.setColData(columnIndex, new Boolean(x));
r.setColData(columnIndex, Boolean.valueOf(x));
break;
case Types.BIT:
case Types.TINYINT:
Expand All @@ -2361,7 +2361,7 @@ public synchronized void updateBoolean(int columnIndex, boolean x) throws SQLExc
case Types.DOUBLE:
case Types.DECIMAL:
case Types.NUMERIC:
r.setColData(columnIndex, new Integer((x ?1:0)));
r.setColData(columnIndex, Integer.valueOf((x ?1:0)));
break;
case Types.CHAR:
case Types.VARCHAR:
Expand Down Expand Up @@ -2389,7 +2389,7 @@ public synchronized void updateBoolean(int columnIndex, boolean x) throws SQLExc
* @exception SQLException if a database-access error occurs
*/
public void updateByte(int columnIndex, byte x) throws SQLException {
updateNumber(columnIndex, new Byte(x), "'byte'", "'updateByte(...)'");
updateNumber(columnIndex, Byte.valueOf(x), "'byte'", "'updateByte(...)'");
}

/**
Expand All @@ -2405,7 +2405,7 @@ public void updateByte(int columnIndex, byte x) throws SQLException {
* @exception SQLException if a database-access error occurs
*/
public void updateShort(int columnIndex, short x) throws SQLException {
updateNumber(columnIndex, new Short(x), "'short'", "'updateShort(...)'");
updateNumber(columnIndex, Short.valueOf(x), "'short'", "'updateShort(...)'");
}

/**
Expand All @@ -2421,7 +2421,7 @@ public void updateShort(int columnIndex, short x) throws SQLException {
* @exception SQLException if a database-access error occurs
*/
public void updateInt(int columnIndex, int x) throws SQLException {
updateNumber(columnIndex, new Integer(x), "'int'", "'updateInt(...)'");
updateNumber(columnIndex, Integer.valueOf(x), "'int'", "'updateInt(...)'");
}

/**
Expand All @@ -2437,7 +2437,7 @@ public void updateInt(int columnIndex, int x) throws SQLException {
* @exception SQLException if a database-access error occurs
*/
public void updateLong(int columnIndex, long x) throws SQLException {
updateNumber(columnIndex, new Long(x), "'long'", "'updateLong(...)'");
updateNumber(columnIndex, Long.valueOf(x), "'long'", "'updateLong(...)'");
}

/**
Expand All @@ -2453,7 +2453,7 @@ public void updateLong(int columnIndex, long x) throws SQLException {
* @exception SQLException if a database-access error occurs
*/
public void updateFloat(int columnIndex, float x) throws SQLException {
updateNumber(columnIndex, new Float(x), "'float'", "'updateFloat(...)'");
updateNumber(columnIndex, Float.valueOf(x), "'float'", "'updateFloat(...)'");
}

/**
Expand All @@ -2469,7 +2469,7 @@ public void updateFloat(int columnIndex, float x) throws SQLException {
* @exception SQLException if a database-access error occurs
*/
public void updateDouble(int columnIndex, double x) throws SQLException {
updateNumber(columnIndex, new Double(x), "'double'", "'updateDouble(...)'");
updateNumber(columnIndex, Double.valueOf(x), "'double'", "'updateDouble(...)'");
}

/**
Expand Down Expand Up @@ -2510,7 +2510,7 @@ public synchronized void updateString(int columnIndex, String x) throws SQLExcep
else
switch(rowSMD.getColumnType(columnIndex)) {
case Types.BOOLEAN:
r.setColData(columnIndex, new Boolean(x));
r.setColData(columnIndex, Boolean.parseBoolean(x));
break;
case Types.BIT:
case Types.TINYINT:
Expand Down Expand Up @@ -5273,7 +5273,7 @@ private synchronized void updateNumber(int columnIndex, Number val, String typeN
Row r = this.getRowForUpdate(columnIndex, funcName);
switch(rowSMD.getColumnType(columnIndex)) {
case Types.BOOLEAN:
r.setColData(columnIndex, new Boolean((val.intValue()!=0? true:false)));
r.setColData(columnIndex, Boolean.valueOf((val.intValue()!=0? true:false)));
break;
case Types.BIT:
case Types.TINYINT:
Expand Down Expand Up @@ -5688,14 +5688,14 @@ private Scanner(String sql) {
query = sql.toCharArray();
end = query.length - 1;

keywords.put("SELECT", new Integer(Token.T_SELECT));
keywords.put("FROM", new Integer(Token.T_FROM));
keywords.put("WHERE", new Integer(Token.T_WHERE));
keywords.put("ORDER", new Integer(Token.T_ORDER));
keywords.put("BY", new Integer(Token.T_BY));
keywords.put("GROUP", new Integer(Token.T_GROUP));
keywords.put("UNION", new Integer(Token.T_UNION));
keywords.put("HAVING", new Integer(Token.T_HAVING));
keywords.put("SELECT", Integer.valueOf(Token.T_SELECT));
keywords.put("FROM", Integer.valueOf(Token.T_FROM));
keywords.put("WHERE", Integer.valueOf(Token.T_WHERE));
keywords.put("ORDER", Integer.valueOf(Token.T_ORDER));
keywords.put("BY", Integer.valueOf(Token.T_BY));
keywords.put("GROUP", Integer.valueOf(Token.T_GROUP));
keywords.put("UNION", Integer.valueOf(Token.T_UNION));
keywords.put("HAVING", Integer.valueOf(Token.T_HAVING));
}

// select_stmt = SELECT [ ALL | DISTINCT ] select_item { "," select_item }
Expand Down Expand Up @@ -6269,7 +6269,7 @@ private boolean doUpdate(OPLCachedRowSet crs) throws SQLException {
tmpSQL.append(", ");
tmpSQL.append(rsmd.getColumnName(i));
tmpSQL.append(" = ? ");
setData.add(new Integer(i));
setData.add(Integer.valueOf(i));
}

tmpSQL.append(" WHERE ");
Expand Down
8 changes: 4 additions & 4 deletions libsrc/JDBCDriverType4/virtuoso/jdbc/ConnectionWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void setAutoCommit(boolean autoCommit) throws SQLException {
check_conn();

if (r_AutoCommit == null) // save the initial autoCommit state
r_AutoCommit = new Boolean(getAutoCommit());
r_AutoCommit = Boolean.valueOf(getAutoCommit());

rconn.setAutoCommit(autoCommit);
} catch (SQLException ex) {
Expand Down Expand Up @@ -210,7 +210,7 @@ public void setReadOnly(boolean readOnly) throws SQLException {
check_conn();

if (r_ReadOnly == null) // save the initial readOnly state
r_ReadOnly = new Boolean(isReadOnly());
r_ReadOnly = Boolean.valueOf(isReadOnly());

rconn.setReadOnly(readOnly);
} catch (SQLException ex) {
Expand Down Expand Up @@ -258,7 +258,7 @@ public void setTransactionIsolation(int level) throws SQLException {
check_conn();

if (r_TxnIsolation == null) // save the initial TxnIsolation state
r_TxnIsolation = new Integer(getTransactionIsolation());
r_TxnIsolation = Integer.valueOf(getTransactionIsolation());

rconn.setTransactionIsolation(level);
} catch (SQLException ex) {
Expand Down Expand Up @@ -370,7 +370,7 @@ public void setHoldability(int holdability)
check_conn();

if (r_Holdability == null) // save the initial holdability state
r_Holdability = new Integer(getHoldability());
r_Holdability = Integer.valueOf(getHoldability());

rconn.setHoldability(holdability);
} catch (SQLException ex) {
Expand Down
6 changes: 3 additions & 3 deletions libsrc/JDBCDriverType4/virtuoso/jdbc/Driver.java
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ protected Properties urlToInfo(String url, Properties _info)
{
host = "localhost";
port = "1111";
fbs = new Integer(VirtuosoTypes.DEFAULTPREFETCH);
sendbs = new Integer(32768);
recvbs = new Integer(32768);
fbs = Integer.valueOf(VirtuosoTypes.DEFAULTPREFETCH);
sendbs = Integer.valueOf(32768);
recvbs = Integer.valueOf(32768);

Properties props = new Properties();

Expand Down
42 changes: 21 additions & 21 deletions libsrc/JDBCDriverType4/virtuoso/jdbc/VirtuosoBlob.java
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ public byte[] getBytes(long pos, int length) throws VirtuosoException
// we should go from start
//System.out.println ("vb: rewind pos:" + pos + " ofs:" + bh_offset());
rewind();
// init_read_len = new Long ((pos - 1) *
// init_read_len = Long.valueOf ((pos - 1) *
// (dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? -1 : 1));
init_read_len = new Long (pos - 1);
init_read_len = Long.valueOf (pos - 1);
}
else if (pos - 1 > bh_offset ())
init_read_len = new Long (pos - bh_offset() - 1);
// init_read_len = new Long ((pos - bh_offset() - 1) *
init_read_len = Long.valueOf (pos - bh_offset() - 1);
// init_read_len = Long.valueOf ((pos - bh_offset() - 1) *
// (dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? -1 : 1));
***/
if (pos - 1 < bh_offset ())
Expand All @@ -298,7 +298,7 @@ else if (pos - 1 > bh_offset ())
}

if (pos - 1 > bh_offset ())
init_read_len = new Long (pos - bh_offset() - 1);
init_read_len = Long.valueOf (pos - bh_offset() - 1);


if (init_read_len != null)
Expand All @@ -309,15 +309,15 @@ else if (pos - 1 > bh_offset ())
{
// skip the desired number of bytes
Object[] args = new Object[9];
args[0] = new Long(this.bh_current_page);
args[0] = Long.valueOf(this.bh_current_page);
args[1] = init_read_len;
args[2] = new Long(this.bh_position);
args[3] = new Long(this.key_id);
args[4] = new Long(this.frag_no);
args[5] = new Long(this.dir_page);
args[2] = Long.valueOf(this.bh_position);
args[3] = Long.valueOf(this.key_id);
args[4] = Long.valueOf(this.frag_no);
args[5] = Long.valueOf(this.dir_page);
args[6] = this.pages;
args[7] = this.dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? new Long (1) : new Long(0);
args[8] = new Long (this.bh_timestamp);
args[7] = this.dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? Long.valueOf (1) : Long.valueOf(0);
args[8] = Long.valueOf (this.bh_timestamp);
//System.out.println ("vb: init read FUTURE: " + this.bh_current_page + " " + init_read_len + " " + this.bh_position);
VirtuosoFuture future = connection.getFuture(VirtuosoFuture.getdata,args, -1);
curr = future.nextResult();
Expand Down Expand Up @@ -369,17 +369,17 @@ else if (val instanceof String)
synchronized (connection)
{
Object[] args = new Object[9];
args[0] = new Long(this.bh_current_page);
// args[1] = new Long(length *
args[0] = Long.valueOf(this.bh_current_page);
// args[1] = Long.valueOf(length *
// (dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? -1 : 1));
args[1] = new Long(length);
args[2] = new Long(this.bh_position);
args[3] = new Long(this.key_id);
args[4] = new Long(this.frag_no);
args[5] = new Long(this.dir_page);
args[1] = Long.valueOf(length);
args[2] = Long.valueOf(this.bh_position);
args[3] = Long.valueOf(this.key_id);
args[4] = Long.valueOf(this.frag_no);
args[5] = Long.valueOf(this.dir_page);
args[6] = this.pages;
args[7] = this.dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? new Long (1) : new Long(0);
args[8] = new Long (this.bh_timestamp);
args[7] = this.dtp == VirtuosoTypes.DV_BLOB_WIDE_HANDLE ? Long.valueOf (1) : Long.valueOf(0);
args[8] = Long.valueOf (this.bh_timestamp);
//System.out.println ("vb: FUTURE: " + this.bh_current_page + " " + length + " " + this.bh_position);
VirtuosoFuture future = connection.getFuture(VirtuosoFuture.getdata,args, -1);
curr = future.nextResult();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ public void registerOutParameter(int parameterIndex, int sqlType, int scale) thr
return;
case Types.BIGINT:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Long(Long.MAX_VALUE),parameterIndex - 1);
objparams.setElementAt(Long.valueOf(Long.MAX_VALUE),parameterIndex - 1);
return;
case Types.LONGVARBINARY:
case Types.VARBINARY:
case Types.BINARY:
return;
case Types.BIT:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Boolean(false),parameterIndex - 1);
objparams.setElementAt(Boolean.FALSE,parameterIndex - 1);
return;
case Types.BLOB:
case Types.CLOB:
Expand Down Expand Up @@ -175,7 +175,7 @@ public void registerOutParameter(int parameterIndex, int sqlType, int scale) thr
case Types.FLOAT:
case Types.DOUBLE:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Double(Double.MAX_VALUE),parameterIndex - 1);
objparams.setElementAt(Double.valueOf(Double.MAX_VALUE),parameterIndex - 1);
return;
case Types.OTHER:
case Types.JAVA_OBJECT:
Expand All @@ -188,16 +188,16 @@ public void registerOutParameter(int parameterIndex, int sqlType, int scale) thr
return;
case Types.REAL:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Float(Float.MAX_VALUE),parameterIndex - 1);
objparams.setElementAt(Float.valueOf(Float.MAX_VALUE),parameterIndex - 1);
return;
case Types.SMALLINT:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Short(Short.MAX_VALUE),parameterIndex - 1);
objparams.setElementAt(Short.valueOf(Short.MAX_VALUE),parameterIndex - 1);
return;
case Types.INTEGER:
case Types.TINYINT:
if (objparams.elementAt(parameterIndex - 1) == null)
objparams.setElementAt(new Integer(Integer.MAX_VALUE),parameterIndex - 1);
objparams.setElementAt(Integer.valueOf(Integer.MAX_VALUE),parameterIndex - 1);
return;
}
;
Expand Down
Loading

0 comments on commit 70c58f0

Please sign in to comment.