remove unecessary boxing/unboxing - no functional change

This commit is contained in:
Mark Struberg 2021-04-04 17:54:25 +02:00
parent b0ba9c3e60
commit a7708636e3
227 changed files with 809 additions and 828 deletions

View File

@ -147,7 +147,7 @@ public class AccountDataBean implements Serializable {
}
public static AccountDataBean getRandomInstance() {
return new AccountDataBean(new Integer(TradeConfig.rndInt(100000)), //accountID
return new AccountDataBean(TradeConfig.rndInt(100000), //accountID
TradeConfig.rndInt(10000), //loginCount
TradeConfig.rndInt(10000), //logoutCount
new java.util.Date(), //lastLogin

View File

@ -119,7 +119,7 @@ public class HoldingDataBean implements Serializable {
public static HoldingDataBean getRandomInstance() {
return new HoldingDataBean(
new Integer(TradeConfig.rndInt(100000)), //holdingID
TradeConfig.rndInt(100000), //holdingID
TradeConfig.rndQuantity(), //quantity
TradeConfig.rndBigDecimal(1000.0f), //purchasePrice
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), //purchaseDate

View File

@ -169,7 +169,7 @@ public class OrderDataBean implements Serializable
public static OrderDataBean getRandomInstance() {
return new OrderDataBean(
new Integer(TradeConfig.rndInt(100000)),
TradeConfig.rndInt(100000),
TradeConfig.rndBoolean() ? "buy" : "sell",
"open",
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)),

View File

@ -133,7 +133,7 @@ public class TradeAction extends TradeJPADirect {
setAttribute(sb, "Page", "Buy");
try {
OrderDataBean orderData = buy(userID, symbol, new Double(
quantity).doubleValue(), TradeConfig.orderProcessingMode);
quantity), TradeConfig.orderProcessingMode);
setAttribute(sb, "orderData", orderData);
setAttribute(sb, "results", results);
} catch (java.lang.IllegalArgumentException e) {

View File

@ -388,7 +388,7 @@ public class TradeConfig {
return (new Float(random() * i)).intValue();
}
public static float rndFloat(int i) {
return (new Float(random() * i)).floatValue();
return new Float(random() * i);
}
public static BigDecimal rndBigDecimal(float f) {
return (new BigDecimal(random() * f)).setScale(
@ -465,7 +465,7 @@ public class TradeConfig {
if (deck == null) {
deck = new ArrayList(numUsers);
for (int i = 0; i < numUsers; i++)
deck.add(i, new Integer(i));
deck.add(i, i);
java.util.Collections.shuffle(deck, r0);
}
if (card >= numUsers)

View File

@ -522,7 +522,7 @@ public class TradeJPADirect {
Query updateStatus = entityManager.createNativeQuery(
"UPDATE orderejb o SET o.orderStatus = 'completed' WHERE "
+ "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID = ?");
updateStatus.setParameter(1, accountid.intValue());
updateStatus.setParameter(1, accountid);
updateStatus.executeUpdate();
}
if (entityManager != null) {

View File

@ -272,8 +272,8 @@ public class ReverseMappingToolTask
// load customizer properties
Properties customProps = new Properties();
File propsFile = Files.getFile(customizerProperties, loader);
if (propsFile != null && (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(propsFile))).booleanValue()) {
if (propsFile != null && AccessController.doPrivileged(
J2DoPrivHelper.existsAction(propsFile))) {
FileInputStream fis = null;
try {
fis = AccessController.doPrivileged(

View File

@ -164,7 +164,7 @@ public class JDBCFetchConfigurationImpl
&& mode != EagerFetchModes.EAGER_NONE
&& mode != EagerFetchModes.EAGER_JOIN
&& mode != EagerFetchModes.EAGER_PARALLEL)
throw new IllegalArgumentException(_loc.get("bad-fetch-mode", Integer.valueOf(mode)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-fetch-mode", mode).getMessage());
if (mode == DEFAULT) {
JDBCConfiguration conf = getJDBCConfiguration();
@ -197,7 +197,7 @@ public class JDBCFetchConfigurationImpl
&& mode != EagerFetchModes.EAGER_NONE
&& mode != EagerFetchModes.EAGER_JOIN
&& mode != EagerFetchModes.EAGER_PARALLEL)
throw new IllegalArgumentException(_loc.get("bad-fetch-mode", Integer.valueOf(mode)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-fetch-mode", mode).getMessage());
if (mode == DEFAULT) {
JDBCConfiguration conf = getJDBCConfiguration();
@ -220,7 +220,7 @@ public class JDBCFetchConfigurationImpl
&& type != ResultSet.TYPE_FORWARD_ONLY
&& type != ResultSet.TYPE_SCROLL_INSENSITIVE
&& type != ResultSet.TYPE_SCROLL_SENSITIVE)
throw new IllegalArgumentException(_loc.get("bad-resultset-type", Integer.valueOf(type)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-resultset-type", type).getMessage());
if (type == DEFAULT) {
JDBCConfiguration conf = getJDBCConfiguration();
@ -242,7 +242,7 @@ public class JDBCFetchConfigurationImpl
&& direction != ResultSet.FETCH_FORWARD
&& direction != ResultSet.FETCH_REVERSE
&& direction != ResultSet.FETCH_UNKNOWN)
throw new IllegalArgumentException(_loc.get("bad-fetch-direction", Integer.valueOf(direction))
throw new IllegalArgumentException(_loc.get("bad-fetch-direction", direction)
.getMessage());
if (direction == DEFAULT) {
@ -265,7 +265,7 @@ public class JDBCFetchConfigurationImpl
&& size != LRSSizes.SIZE_QUERY
&& size != LRSSizes.SIZE_LAST
&& size != LRSSizes.SIZE_UNKNOWN)
throw new IllegalArgumentException(_loc.get("bad-lrs-size", Integer.valueOf(size)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-lrs-size", size).getMessage());
if (size == DEFAULT) {
JDBCConfiguration conf = getJDBCConfiguration();
@ -287,7 +287,7 @@ public class JDBCFetchConfigurationImpl
&& syntax != JoinSyntaxes.SYNTAX_SQL92
&& syntax != JoinSyntaxes.SYNTAX_TRADITIONAL
&& syntax != JoinSyntaxes.SYNTAX_DATABASE)
throw new IllegalArgumentException(_loc.get("bad-join-syntax", Integer.valueOf(syntax)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-join-syntax", syntax).getMessage());
if (syntax == DEFAULT) {
JDBCConfiguration conf = getJDBCConfiguration();
@ -417,7 +417,7 @@ public class JDBCFetchConfigurationImpl
&& level != Connection.TRANSACTION_READ_COMMITTED
&& level != Connection.TRANSACTION_REPEATABLE_READ
&& level != Connection.TRANSACTION_SERIALIZABLE)
throw new IllegalArgumentException(_loc.get("bad-level", Integer.valueOf(level)).getMessage());
throw new IllegalArgumentException(_loc.get("bad-level", level).getMessage());
if (level == DEFAULT)
_state.isolationLevel = -1;

View File

@ -353,7 +353,7 @@ public class JDBCStoreManager implements StoreManager, JDBCStore {
&& !((OpenJPAId) oid).hasSubclasses()) {
Boolean custom = customLoad(sm, mapping, state, fetch);
if (custom != null)
return custom.booleanValue();
return custom;
res = getInitializeStateResult(sm, mapping, fetch,
Select.SUBS_EXACT);
if (res == null && !selectPrimaryKey(sm, mapping, fetch))
@ -367,7 +367,7 @@ public class JDBCStoreManager implements StoreManager, JDBCStore {
mapping = mappings[0];
Boolean custom = customLoad(sm, mapping, state, fetch);
if (custom != null)
return custom.booleanValue();
return custom;
res = getInitializeStateResult(sm, mapping, fetch,
Select.SUBS_ANY_JOINABLE);
if (res == null && !selectPrimaryKey(sm, mapping, fetch))

View File

@ -915,7 +915,7 @@ public class JDBCStoreQuery
Boolean where = trimVal.getWhere();
if (where == null) { //trim both
return trimLeading(trimTrailing(valStr, trimCharObj), trimCharObj);
} else if (where.booleanValue()) { // trim leading
} else if (where) { // trim leading
return trimLeading(valStr, trimCharObj);
} else { // trim trailing
return trimTrailing(valStr, trimCharObj);
@ -964,13 +964,13 @@ public class JDBCStoreQuery
Object val = getValue(absVal.getValue(), ob, params, sm);
Class c = val.getClass();
if (c == Integer.class)
return Integer.valueOf(java.lang.Math.abs(((Integer) val).intValue()));
return Math.abs(((Integer) val).intValue());
else if (c == Float.class)
return Float.valueOf(java.lang.Math.abs(((Float) val).floatValue()));
return Math.abs(((Float) val).floatValue());
else if (c == Double.class)
return Double.valueOf(java.lang.Math.abs(((Double) val).doubleValue()));
return Math.abs(((Double) val).doubleValue());
else if (c == Long.class)
return Long.valueOf(java.lang.Math.abs(((Long) val).longValue()));
return Math.abs(((Long) val).longValue());
throw new UnsupportedException();
}
@ -981,13 +981,13 @@ public class JDBCStoreQuery
Object val = getValue(sqrtVal.getValue(), ob, params, sm);
Class c = val.getClass();
if (c == Integer.class)
return Double.valueOf(java.lang.Math.sqrt(((Integer) val).doubleValue()));
return Math.sqrt(((Integer) val).doubleValue());
else if (c == Float.class)
return Double.valueOf(java.lang.Math.sqrt(((Float) val).floatValue()));
return Math.sqrt(((Float) val).floatValue());
else if (c == Double.class)
return Double.valueOf(java.lang.Math.sqrt(((Double) val).doubleValue()));
return Math.sqrt(((Double) val).doubleValue());
else if (c == Long.class)
return Double.valueOf(java.lang.Math.sqrt(((Long) val).doubleValue()));
return Math.sqrt(((Long) val).doubleValue());
throw new UnsupportedException();
}

View File

@ -163,7 +163,7 @@ public class PreparedSQLStoreQuery extends SQLStoreQuery {
Set<Map.Entry<Object,Object>> userSet = userParams.entrySet();
for (Map.Entry<Object,Object> userEntry : userSet) {
int idx = ((Integer)userEntry.getKey()).intValue();
int idx = (Integer) userEntry.getKey();
array[idx] = userEntry.getValue();
}
return array;

View File

@ -86,7 +86,7 @@ public abstract class SelectResultObjectProvider
ra = _sel.supportsRandomAccess(_fetch.getReadLockLevel() > 0);
_ra = (ra) ? Boolean.TRUE : Boolean.FALSE;
}
return _ra.booleanValue();
return _ra;
}
@Override

View File

@ -52,7 +52,7 @@ class ContainsExpression
if (count == null)
count = 0;
else
count = count.intValue() + 1;
count = count + 1;
contains.put(path, count);
sql.setContainsId(count.toString());

View File

@ -68,7 +68,7 @@ class OrExpression
entry = (Map.Entry) itr.next();
val2 = (Integer) entry.getValue();
val1 = (Integer) contains.get(entry.getKey());
if (val1 == null || val2.intValue() > val1.intValue())
if (val1 == null || val2 > val1)
contains.put(entry.getKey(), val2);
}
return ret;

View File

@ -170,7 +170,7 @@ public class Trim
if (_where == null) {
func = dict.trimBothFunction;
dict.assertSupport(func != null, "TrimBothFunction");
} else if (_where.booleanValue()) {
} else if (_where) {
func = dict.trimLeadingFunction;
dict.assertSupport(func != null, "TrimLeadingFunction");
} else {

View File

@ -418,7 +418,7 @@ public class ClassMapping
try {
strategy.setClassMapping(this);
if (adapt != null)
strategy.map(adapt.booleanValue());
strategy.map(adapt);
} catch (RuntimeException re) {
// reset strategy
_strategy = orig;

View File

@ -113,7 +113,7 @@ public class Discriminator
try {
strategy.setDiscriminator(this);
if (adapt != null)
strategy.map(adapt.booleanValue());
strategy.map(adapt);
} catch (RuntimeException re) {
// reset strategy
_strategy = orig;

View File

@ -71,7 +71,7 @@ public class DiscriminatorMappingInfo extends MappingInfo {
case JavaTypes.INT:
return Integer.valueOf(_value);
case JavaTypes.CHAR:
return Character.valueOf(_value.charAt(_value.indexOf('\'')+1));
return _value.charAt(_value.indexOf('\'') + 1);
case JavaTypes.STRING:
default:
return _value;

View File

@ -144,7 +144,7 @@ public class FieldMapping
try {
strategy.setFieldMapping(this);
if (adapt != null)
strategy.map(adapt.booleanValue());
strategy.map(adapt);
} catch (RuntimeException re) {
// reset strategy
_strategy = orig;
@ -1280,7 +1280,7 @@ public class FieldMapping
*/
public boolean isBidirectionalJoinTableMappingOwner() {
if (_bidirectionalJoinTableOwner != null)
return _bidirectionalJoinTableOwner.booleanValue();
return _bidirectionalJoinTableOwner;
_bidirectionalJoinTableOwner = false;
ForeignKey fk = getForeignKey();
@ -1313,7 +1313,7 @@ public class FieldMapping
}
}
}
return _bidirectionalJoinTableOwner.booleanValue();
return _bidirectionalJoinTableOwner;
}
/**
@ -1323,7 +1323,7 @@ public class FieldMapping
*/
public boolean isBidirectionalJoinTableMappingNonOwner() {
if (_bidirectionalJoinTableNonOwner != null)
return _bidirectionalJoinTableNonOwner.booleanValue();
return _bidirectionalJoinTableNonOwner;
_bidirectionalJoinTableNonOwner = false;
ForeignKey fk = getForeignKey();
@ -1358,7 +1358,7 @@ public class FieldMapping
}
}
}
return _bidirectionalJoinTableNonOwner.booleanValue();
return _bidirectionalJoinTableNonOwner;
}
public boolean isBiMTo1JT() {

View File

@ -54,18 +54,18 @@ public class JavaSQLTypes
public static final int TIMESTAMP = 1011;
public static final int JDBC_DEFAULT = 1012;
private static final Byte ZERO_BYTE = Byte.valueOf((byte) 0);
private static final Character ZERO_CHAR = Character.valueOf((char) 0);
private static final Double ZERO_DOUBLE = Double.valueOf(0d);
private static final Float ZERO_FLOAT = Float.valueOf(0f);
private static final Short ZERO_SHORT = Short.valueOf((short) 0);
private static final Byte ZERO_BYTE = (byte) 0;
private static final Character ZERO_CHAR = (char) 0;
private static final Double ZERO_DOUBLE = 0d;
private static final Float ZERO_FLOAT = 0f;
private static final Short ZERO_SHORT = (short) 0;
private static final BigDecimal ZERO_BIGDECIMAL = new BigDecimal(0d);
private static final Byte NONZERO_BYTE = new Byte((byte) 1);
private static final Character NONZERO_CHAR = Character.valueOf((char) 'a');
private static final Double NONZERO_DOUBLE = Double.valueOf(1d);
private static final Float NONZERO_FLOAT = Float.valueOf(1f);
private static final Short NONZERO_SHORT = Short.valueOf((short) 1);
private static final Byte NONZERO_BYTE = (byte) 1;
private static final Character NONZERO_CHAR = (char) 'a';
private static final Double NONZERO_DOUBLE = 1d;
private static final Float NONZERO_FLOAT = 1f;
private static final Short NONZERO_SHORT = (short) 1;
private static final BigInteger NONZERO_BIGINTEGER = new BigInteger("1");
private static final BigDecimal NONZERO_BIGDECIMAL = new BigDecimal(1d);

View File

@ -590,9 +590,9 @@ public class MappingDefaultsImpl
switch (disc.getJavaType()) {
case JavaTypes.INT:
return Integer.valueOf(alias.hashCode());
return alias.hashCode();
case JavaTypes.CHAR:
return Character.valueOf(alias.charAt(0));
return alias.charAt(0);
case JavaTypes.STRING:
default:
return alias;

View File

@ -810,7 +810,7 @@ public abstract class MappingInfo implements Serializable {
if (defStr != null)
col.setDefaultString(defStr);
if (notNull != null)
col.setNotNull(notNull.booleanValue());
col.setNotNull(notNull);
// add other details if adapting
if (adapt) {

View File

@ -1951,8 +1951,8 @@ public class ReverseMappingTool
File customFile = Files.getFile
(opts.removeProperty("customizerProperties", "cp", null), null);
Properties customProps = new Properties();
if (customFile != null && (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(customFile))).booleanValue()) {
if (customFile != null && AccessController.doPrivileged(
J2DoPrivHelper.existsAction(customFile))) {
FileInputStream fis = null;
try {
fis = AccessController.doPrivileged(

View File

@ -104,7 +104,7 @@ public class Version
try {
strategy.setVersion(this);
if (adapt != null)
strategy.map(adapt.booleanValue());
strategy.map(adapt);
} catch (RuntimeException re) {
// reset strategy
_strategy = orig;

View File

@ -107,7 +107,7 @@ public class EnumValueHandler extends AbstractValueHandler {
if (val == null)
return null;
if (_ordinal)
return Integer.valueOf(((Enum) val).ordinal());
return ((Enum) val).ordinal();
return ((Enum) val).name();
}

View File

@ -212,7 +212,7 @@ public class LRSProxyCollection
throw SQLExceptions.getStore(se, _store.getDBDictionary());
}
}
return _next.booleanValue();
return _next;
}
@Override

View File

@ -361,13 +361,13 @@ class LRSProxyMap
if (_next == null) {
try {
_next = (_res[0].next()) ? Boolean.TRUE : Boolean.FALSE;
if (_next.booleanValue() && _res[1] != _res[0])
if (_next && _res[1] != _res[0])
_res[1].next();
} catch (SQLException se) {
throw SQLExceptions.getStore(se, _store.getDBDictionary());
}
}
return _next.booleanValue();
return _next;
}
@Override

View File

@ -62,7 +62,7 @@ public class NumberVersionStrategy
@Override
protected int getJavaType() {
if (_javaType == null && vers.getClassMapping().getVersionFieldMapping() != null) {
_javaType = Integer.valueOf(vers.getClassMapping().getVersionFieldMapping().getTypeCode());
_javaType = vers.getClassMapping().getVersionFieldMapping().getTypeCode();
} else {
return JavaTypes.INT;
}

View File

@ -350,7 +350,7 @@ public class PrimitiveFieldStrategy
if (autoInc == null)
sm.storeBoolean(idx, false);
else if (autoInc instanceof Boolean)
sm.storeBoolean(idx, ((Boolean) autoInc).booleanValue());
sm.storeBoolean(idx, (Boolean) autoInc);
else
sm.storeBoolean(idx, ((Number) autoInc).intValue() != 0);
break;
@ -364,7 +364,7 @@ public class PrimitiveFieldStrategy
if (autoInc == null)
sm.storeChar(idx, (char) 0);
else if (autoInc instanceof Character)
sm.storeChar(idx, ((Character) autoInc).charValue());
sm.storeChar(idx, (Character) autoInc);
else if (autoInc instanceof String)
sm.storeChar(idx, ((String) autoInc).charAt(0));
else

View File

@ -36,7 +36,7 @@ class PrimitiveWrapperArrays {
if (vm.getType().getComponentType() == Character.class) {
Character[] objectArray = new Character[array.length];
for (int i = 0; i < array.length; i++)
objectArray[i] = Character.valueOf(array[i]);
objectArray[i] = array[i];
return objectArray;
}
return array;
@ -50,7 +50,7 @@ class PrimitiveWrapperArrays {
Character[] charOb = (Character[]) ob;
char[] chars = new char[charOb.length];
for (int i = 0; i < charOb.length; i++)
chars[i] = charOb[i] == null ? 0 : charOb[i].charValue();
chars[i] = charOb[i] == null ? 0 : charOb[i];
return chars;
}
return (char[]) ob;
@ -65,7 +65,7 @@ class PrimitiveWrapperArrays {
if (vm.getType().getComponentType() == Byte.class) {
Byte[] objectArray = new Byte[array.length];
for (int i = 0; i < array.length; i++)
objectArray[i] = Byte.valueOf(array[i]);
objectArray[i] = array[i];
return objectArray;
}
return array;
@ -79,7 +79,7 @@ class PrimitiveWrapperArrays {
Byte[] byteOb = (Byte[]) ob;
byte[] bytes = new byte[byteOb.length];
for (int i = 0; i < byteOb.length; i++)
bytes[i] = byteOb[i] == null ? 0 : byteOb[i].byteValue();
bytes[i] = byteOb[i] == null ? 0 : byteOb[i];
return bytes;
}
return (byte[]) ob;

View File

@ -451,7 +451,7 @@ public class Column extends ReferenceCounter {
break;
case JavaTypes.CHAR:
case JavaTypes.CHAR_OBJ:
_default = Character.valueOf(_defaultStr.charAt(0));
_default = _defaultStr.charAt(0);
break;
case JavaTypes.DOUBLE:
case JavaTypes.DOUBLE_OBJ:

View File

@ -137,7 +137,7 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
// save exception details for later instead of throwing here
_dbcpEx = new RuntimeException(_eloc.get("driver-null", DBCPBASICDATASOURCENAME).getMessage(), e);
}
return _dbcpAvail.booleanValue();
return _dbcpAvail;
}
}

View File

@ -183,7 +183,7 @@ public class ForeignKey extends Constraint {
*/
public boolean isPrimaryKeyAutoAssigned() {
if (_autoAssign != null)
return _autoAssign.booleanValue();
return _autoAssign;
return isPrimaryKeyAutoAssigned(new ArrayList(3));
}
@ -199,7 +199,7 @@ public class ForeignKey extends Constraint {
*/
private boolean isPrimaryKeyAutoAssigned(List seen) {
if (_autoAssign != null)
return _autoAssign.booleanValue();
return _autoAssign;
Column[] cols = getPrimaryKeyColumns();
if (cols.length == 0) {

View File

@ -453,7 +453,7 @@ public abstract class AbstractResult
null, joins));
if (val == null)
return false;
return Boolean.valueOf(val.toString()).booleanValue();
return Boolean.valueOf(val.toString());
}
@Override
@ -612,7 +612,7 @@ public abstract class AbstractResult
if (val == null)
return 0;
if (val instanceof Character)
return ((Character) val).charValue();
return (Character) val;
String str = val.toString();
return (str.length() == 0) ? 0 : str.charAt(0);

View File

@ -670,10 +670,10 @@ public class DBDictionary
return getBigDecimal(rs, column);
} catch (Exception e1) {
try {
return Double.valueOf(getDouble(rs, column));
return getDouble(rs, column);
} catch (Exception e2) {
try {
return Float.valueOf(getFloat(rs, column));
return getFloat(rs, column);
} catch (Exception e3) {
try {
return getLong(rs, column);
@ -1381,9 +1381,9 @@ public class DBDictionary
// check for known floating point types to give driver a chance to
// handle special numbers like NaN and infinity; bug #1053
if (num instanceof Double)
setDouble(stmnt, idx, ((Double) num).doubleValue(), col);
setDouble(stmnt, idx, (Double) num, col);
else if (num instanceof Float)
setFloat(stmnt, idx, ((Float) num).floatValue(), col);
setFloat(stmnt, idx, (Float) num, col);
else
setBigDecimal(stmnt, idx, new BigDecimal(num.toString()), col);
}
@ -1472,7 +1472,7 @@ public class DBDictionary
switch (type) {
case JavaTypes.BOOLEAN:
case JavaTypes.BOOLEAN_OBJ:
setBoolean(stmnt, idx, ((Boolean) val).booleanValue(), col);
setBoolean(stmnt, idx, (Boolean) val, col);
break;
case JavaTypes.BYTE:
case JavaTypes.BYTE_OBJ:
@ -1480,7 +1480,7 @@ public class DBDictionary
break;
case JavaTypes.CHAR:
case JavaTypes.CHAR_OBJ:
setChar(stmnt, idx, ((Character) val).charValue(), col);
setChar(stmnt, idx, (Character) val, col);
break;
case JavaTypes.DOUBLE:
case JavaTypes.DOUBLE_OBJ:
@ -1642,21 +1642,21 @@ public class DBDictionary
else if (val instanceof String)
setString(stmnt, idx, val.toString(), col);
else if (val instanceof Integer)
setInt(stmnt, idx, ((Integer) val).intValue(), col);
setInt(stmnt, idx, (Integer) val, col);
else if (val instanceof Boolean)
setBoolean(stmnt, idx, ((Boolean) val).booleanValue(), col);
setBoolean(stmnt, idx, (Boolean) val, col);
else if (val instanceof Long)
setLong(stmnt, idx, ((Long) val).longValue(), col);
setLong(stmnt, idx, (Long) val, col);
else if (val instanceof Float)
setFloat(stmnt, idx, ((Float) val).floatValue(), col);
setFloat(stmnt, idx, (Float) val, col);
else if (val instanceof Double)
setDouble(stmnt, idx, ((Double) val).doubleValue(), col);
setDouble(stmnt, idx, (Double) val, col);
else if (val instanceof Byte)
setByte(stmnt, idx, ((Byte) val).byteValue(), col);
setByte(stmnt, idx, (Byte) val, col);
else if (val instanceof Character)
setChar(stmnt, idx, ((Character) val).charValue(), col);
setChar(stmnt, idx, (Character) val, col);
else if (val instanceof Short)
setShort(stmnt, idx, ((Short) val).shortValue(), col);
setShort(stmnt, idx, (Short) val, col);
else if (val instanceof Locale)
setLocale(stmnt, idx, (Locale) val, col);
else if (val instanceof BigDecimal)
@ -5163,7 +5163,7 @@ public class DBDictionary
timeout = 0;
} else if (timeout < 0) {
if (log.isWarnEnabled())
log.warn(_loc.get("invalid-timeout", Integer.valueOf(timeout)));
log.warn(_loc.get("invalid-timeout", timeout));
return;
} else if (timeout > 0 && timeout < 1000) {
// round up to 1 sec
@ -5755,7 +5755,7 @@ public class DBDictionary
* @param supportsDelimitedIds the supportsDelimitedIds to set
*/
public void setSupportsDelimitedIdentifiers(boolean supportsDelimitedIds) {
supportsDelimitedIdentifiers = Boolean.valueOf(supportsDelimitedIds);
supportsDelimitedIdentifiers = supportsDelimitedIds;
}
/**
@ -5763,12 +5763,11 @@ public class DBDictionary
*/
private void setSupportsDelimitedIdentifiers(DatabaseMetaData metaData) {
try {
supportsDelimitedIdentifiers = Boolean.valueOf(
metaData.supportsMixedCaseQuotedIdentifiers() ||
metaData.storesLowerCaseQuotedIdentifiers() ||
metaData.storesUpperCaseQuotedIdentifiers());
supportsDelimitedIdentifiers = metaData.supportsMixedCaseQuotedIdentifiers() ||
metaData.storesLowerCaseQuotedIdentifiers() ||
metaData.storesUpperCaseQuotedIdentifiers();
} catch (SQLException e) {
supportsDelimitedIdentifiers = Boolean.valueOf(false);
supportsDelimitedIdentifiers = Boolean.FALSE;
getLog().warn(_loc.get("unknown-delim-support", e));
}
}

View File

@ -151,12 +151,12 @@ public class EmpressDictionary
// which can prove to be difficult to handle
if (val == Float.POSITIVE_INFINITY) {
val = Float.MAX_VALUE;
storageWarning(new Float(Float.POSITIVE_INFINITY),
new Float(val));
storageWarning(Float.POSITIVE_INFINITY,
val);
} else if (val == Float.NEGATIVE_INFINITY) {
val = Float.MIN_VALUE + 1;
storageWarning(new Float(Float.NEGATIVE_INFINITY),
new Float(val));
storageWarning(Float.NEGATIVE_INFINITY,
val);
}
super.setFloat(stmnt, idx, val, col);
}
@ -169,12 +169,12 @@ public class EmpressDictionary
// which can prove to be difficult to handle
if (val == Double.POSITIVE_INFINITY) {
val = Double.MAX_VALUE;
storageWarning(new Double(Double.POSITIVE_INFINITY),
new Double(val));
storageWarning(Double.POSITIVE_INFINITY,
val);
} else if (val == Double.NEGATIVE_INFINITY) {
val = Double.MIN_VALUE + 1;
storageWarning(new Double(Double.NEGATIVE_INFINITY),
new Double(val));
storageWarning(Double.NEGATIVE_INFINITY,
val);
}
super.setDouble(stmnt, idx, val, col);
}

View File

@ -1123,7 +1123,7 @@ public class LogicalUnion
*/
private Object getOrderingValue(ResultSet rs, Object i) {
try {
return _dict.getObject(rs, ((Integer) i).intValue() + 1, null);
return _dict.getObject(rs, (Integer) i + 1, null);
} catch (SQLException se) {
throw SQLExceptions.getStore(se, _dict);
}

View File

@ -585,7 +585,7 @@ public class OracleDictionary
new Class[]{ int.class, short.class }).
invoke(inner,
new Object[]{
Integer.valueOf(idx),
idx,
oraclePreparedStatementFormNvarcharField.get(null)
});
} catch (Exception e) {
@ -613,7 +613,7 @@ public class OracleDictionary
setFixedCharMethod.setAccessible(true);
}
setFixedCharMethod.invoke(inner, new Object[]{ new Integer(idx), val });
setFixedCharMethod.invoke(inner, new Object[]{idx, val });
return;
} catch (Exception e) {
log.warn(e);
@ -711,7 +711,7 @@ public class OracleDictionary
return null;
if (oracleClob_isEmptyLob_Method != null && clob.getClass().getName().equals("oracle.sql.CLOB")) {
try {
if (((Boolean) oracleClob_isEmptyLob_Method.invoke(clob, new Object[0])).booleanValue()) {
if ((Boolean) oracleClob_isEmptyLob_Method.invoke(clob, new Object[0])) {
return null;
}
} catch (Exception e) {

View File

@ -438,19 +438,19 @@ public class ResultSetResult
break;
case JavaTypes.BYTE:
case JavaTypes.BYTE_OBJ:
val = new Byte(getByteInternal(obj, joins));
val = getByteInternal(obj, joins);
break;
case JavaTypes.CHAR:
case JavaTypes.CHAR_OBJ:
val = new Character(getCharInternal(obj, joins));
val = getCharInternal(obj, joins);
break;
case JavaTypes.DOUBLE:
case JavaTypes.DOUBLE_OBJ:
val = new Double(getDoubleInternal(obj, joins));
val = getDoubleInternal(obj, joins);
break;
case JavaTypes.FLOAT:
case JavaTypes.FLOAT_OBJ:
val = new Float(getFloatInternal(obj, joins));
val = getFloatInternal(obj, joins);
break;
case JavaTypes.INT:
case JavaTypes.INT_OBJ:
@ -462,7 +462,7 @@ public class ResultSetResult
break;
case JavaTypes.SHORT:
case JavaTypes.SHORT_OBJ:
val = new Short(getShortInternal(obj, joins));
val = getShortInternal(obj, joins);
break;
case JavaTypes.STRING:
return getStringInternal(obj, joins, isClob);

View File

@ -439,7 +439,7 @@ public class RowImpl
@Override
public void setByte(Column col, byte val)
throws SQLException {
setObject(col, new Byte(val), JavaTypes.BYTE, false);
setObject(col, val, JavaTypes.BYTE, false);
}
@Override
@ -457,7 +457,7 @@ public class RowImpl
@Override
public void setChar(Column col, char val)
throws SQLException {
setObject(col, new Character(val), JavaTypes.CHAR, false);
setObject(col, val, JavaTypes.CHAR, false);
}
@Override
@ -493,13 +493,13 @@ public class RowImpl
@Override
public void setDouble(Column col, double val)
throws SQLException {
setObject(col, new Double(val), JavaTypes.DOUBLE, false);
setObject(col, val, JavaTypes.DOUBLE, false);
}
@Override
public void setFloat(Column col, float val)
throws SQLException {
setObject(col, new Float(val), JavaTypes.FLOAT, false);
setObject(col, val, JavaTypes.FLOAT, false);
}
@Override
@ -547,7 +547,7 @@ public class RowImpl
@Override
public void setShort(Column col, short val)
throws SQLException {
setObject(col, new Short(val), JavaTypes.SHORT, false);
setObject(col, val, JavaTypes.SHORT, false);
}
@Override
@ -635,7 +635,7 @@ public class RowImpl
@Override
public void whereByte(Column col, byte val)
throws SQLException {
whereObject(col, new Byte(val), JavaTypes.BYTE);
whereObject(col, val, JavaTypes.BYTE);
}
@Override
@ -653,7 +653,7 @@ public class RowImpl
@Override
public void whereChar(Column col, char val)
throws SQLException {
whereObject(col, new Character(val), JavaTypes.CHAR);
whereObject(col, val, JavaTypes.CHAR);
}
@Override
@ -689,13 +689,13 @@ public class RowImpl
@Override
public void whereDouble(Column col, double val)
throws SQLException {
whereObject(col, new Double(val), JavaTypes.DOUBLE);
whereObject(col, val, JavaTypes.DOUBLE);
}
@Override
public void whereFloat(Column col, float val)
throws SQLException {
whereObject(col, new Float(val), JavaTypes.FLOAT);
whereObject(col, val, JavaTypes.FLOAT);
}
@Override
@ -737,7 +737,7 @@ public class RowImpl
@Override
public void whereShort(Column col, short val)
throws SQLException {
whereObject(col, new Short(val), JavaTypes.SHORT);
whereObject(col, val, JavaTypes.SHORT);
}
@Override

View File

@ -366,14 +366,14 @@ public final class SQLBuffer
} else if ( type == Character.class ) {
if (_dict.storeCharsAsNumbers) {
_sql.append(Integer.toString(((Character)o).charValue()));
_sql.append(Integer.toString((Character) o));
} else {
_sql.append("'" + o.toString().replace("'", "''") + "'");
}
} else if (type == Boolean.class) {
Boolean b = (Boolean) o;
// We store B(b)ooleans as ints. Convert
_sql.append(_dict.getBooleanRepresentation().getRepresentation(b.booleanValue()));
_sql.append(_dict.getBooleanRepresentation().getRepresentation(b));
} else {
_sql.append(o.toString());
}

View File

@ -1206,7 +1206,7 @@ public class SelectImpl
boolean seld = sel && select(col, pj, false);
if (asc != null) {
String alias = (as != null) ? as : getColumnAlias(col, pj);
appendOrdering(alias, asc.booleanValue());
appendOrdering(alias, asc);
}
return seld;
}
@ -2170,13 +2170,13 @@ public class SelectImpl
}
if (i != null)
return i.intValue();
return i;
// check out existing aliases
i = findAlias(table, key);
if (i != null)
return i.intValue();
return i;
if (!create)
return -1;
@ -2187,7 +2187,7 @@ public class SelectImpl
// " created alias: "+
// i.intValue()+ " "+ key);
recordTableAlias(table, key, i);
return i.intValue();
return i;
}
private Integer findAliasForQuery(Table table, PathJoins pj, Object key,
@ -2249,7 +2249,7 @@ public class SelectImpl
// "Query created alias: "+
// i.intValue()+ " "+ key);
recordTableAlias(table, key, i);
return i.intValue();
return i;
}
private Integer findAlias(Table table, Object key) {
@ -2278,7 +2278,7 @@ public class SelectImpl
_aliases.put(key, alias);
String tableString = _dict.getFullName(table, false) + " "
+ toAlias(alias.intValue());
+ toAlias(alias);
if (_tables == null)
_tables = new TreeMap();
_tables.put(alias, tableString);
@ -2644,7 +2644,7 @@ public class SelectImpl
if (pk == null)
pk = (obj instanceof Column && ((Column) obj).isPrimaryKey())
? Boolean.TRUE : Boolean.FALSE;
if (pk.booleanValue()) {
if (pk) {
for (int i = _pos - 1; i >= 0 && i >= _pos - 3; i--)
if (_sel._selects.get(i).equals(obj))
return i + 1;
@ -3262,7 +3262,7 @@ public class SelectImpl
boolean found2 = false;
for (int i = 0; i < aliases.length; i++) {
int alias = ((Integer)aliases[i]).intValue();
int alias = (Integer) aliases[i];
if (alias == j.getIndex1())
found1 = true;
if (alias == j.getIndex2())
@ -3306,7 +3306,7 @@ public class SelectImpl
boolean found2 = false;
for (int i = 0; i < aliases.length; i++) {
int alias = ((Integer)aliases[i]).intValue();
int alias = (Integer) aliases[i];
if (alias == join.getIndex1())
found1 = true;
if (alias == join.getIndex2())

View File

@ -70,7 +70,7 @@ public class DataLoader {
public void populate(EntityManager em) throws Exception {
Long count = em.createQuery("select count(m) from Movie m", Long.class).getSingleResult();
if (count != null && count.longValue() > 0) {
if (count != null && count > 0) {
System.err.println("Found " + count + " Movie records in the database");
return;
}

View File

@ -868,7 +868,7 @@ public class OpenJPAConfigurationImpl
@Override
public void setRefreshFromDataCache(Boolean flag) {
if (flag != null) {
refreshFromDataCache.set(flag.booleanValue());
refreshFromDataCache.set(flag);
}
}

View File

@ -114,7 +114,7 @@ public class RemoteCommitProviderValue
public void configureEventManager(RemoteCommitEventManager mgr) {
parseOptions();
if (_transmitPersIds != null)
mgr.setTransmitPersistedObjectIds(_transmitPersIds.booleanValue());
mgr.setTransmitPersistedObjectIds(_transmitPersIds);
}
/**

View File

@ -120,7 +120,7 @@ public abstract class AbstractQueryCache
// Pre-load all the entity types into the HashMap to handle
// synchronization on the map efficiently
for (Object o : perTypes)
entityTimestampMap.put((String)o, Long.valueOf(0));
entityTimestampMap.put((String)o, 0L);
}
}
@ -153,7 +153,7 @@ public abstract class AbstractQueryCache
Collection changedTypes = ev.getTypes();
HashMap<String,Long> changedClasses =
new HashMap<>();
Long tstamp = Long.valueOf(System.currentTimeMillis());
Long tstamp = System.currentTimeMillis();
for (Object o: changedTypes) {
String name = ((Class) o).getName();
if(!changedClasses.containsKey(name)) {

View File

@ -108,6 +108,6 @@ public class ClassRedefiner {
_canRedefine = Boolean.FALSE;
}
}
return _canRedefine.booleanValue();
return _canRedefine;
}
}

View File

@ -185,7 +185,7 @@ public class PCClassFileTransformer
if (_names != null) {
if (_names.contains(clsName.replace('/', '.')))
return Boolean.valueOf(!isEnhanced(bytes));
return !isEnhanced(bytes);
return null;
}

View File

@ -100,35 +100,35 @@ public class ReflectingPersistenceCapable
switch (meta.getField(i).getDeclaredTypeCode()) {
case JavaTypes.BOOLEAN:
sm.providedBooleanField(this, i, value == null ? false :
((Boolean) value).booleanValue());
(Boolean) value);
break;
case JavaTypes.BYTE:
sm.providedByteField(this, i, value == null ? 0 :
((Byte) value).byteValue());
(Byte) value);
break;
case JavaTypes.CHAR:
sm.providedCharField(this, i, value == null ? 0 :
((Character) value).charValue());
(Character) value);
break;
case JavaTypes.DOUBLE:
sm.providedDoubleField(this, i, value == null ? 0 :
((Double) value).doubleValue());
(Double) value);
break;
case JavaTypes.FLOAT:
sm.providedFloatField(this, i, value == null ? 0 :
((Float) value).floatValue());
(Float) value);
break;
case JavaTypes.INT:
sm.providedIntField(this, i, value == null ? 0 :
((Integer) value).intValue());
(Integer) value);
break;
case JavaTypes.LONG:
sm.providedLongField(this, i, value == null ? 0 :
((Long) value).longValue());
(Long) value);
break;
case JavaTypes.SHORT:
sm.providedShortField(this, i, value == null ? 0 :
((Short) value).shortValue());
(Short) value);
break;
case JavaTypes.STRING:
sm.providedStringField(this, i, (String) value);
@ -149,29 +149,28 @@ public class ReflectingPersistenceCapable
public void pcReplaceField(int i) {
switch(meta.getField(i).getDeclaredTypeCode()) {
case JavaTypes.BOOLEAN:
setValue(i, o, Boolean.valueOf(
sm.replaceBooleanField(this, i)));
setValue(i, o, sm.replaceBooleanField(this, i));
break;
case JavaTypes.BYTE:
setValue(i, o, Byte.valueOf(sm.replaceByteField(this, i)));
setValue(i, o, sm.replaceByteField(this, i));
break;
case JavaTypes.CHAR:
setValue(i, o, Character.valueOf(sm.replaceCharField(this, i)));
setValue(i, o, sm.replaceCharField(this, i));
break;
case JavaTypes.DOUBLE:
setValue(i, o, new Double(sm.replaceDoubleField(this, i)));
setValue(i, o, sm.replaceDoubleField(this, i));
break;
case JavaTypes.FLOAT:
setValue(i, o, new Float(sm.replaceFloatField(this, i)));
setValue(i, o, sm.replaceFloatField(this, i));
break;
case JavaTypes.INT:
setValue(i, o, Integer.valueOf(sm.replaceIntField(this, i)));
setValue(i, o, sm.replaceIntField(this, i));
break;
case JavaTypes.LONG:
setValue(i, o, Long.valueOf(sm.replaceLongField(this, i)));
setValue(i, o, sm.replaceLongField(this, i));
break;
case JavaTypes.SHORT:
setValue(i, o, Short.valueOf(sm.replaceShortField(this, i)));
setValue(i, o, sm.replaceShortField(this, i));
break;
case JavaTypes.STRING:
setValue(i, o, sm.replaceStringField(this, i));
@ -273,7 +272,7 @@ public class ReflectingPersistenceCapable
@Override
public Boolean pcIsDetached() {
if (sm != null)
return Boolean.valueOf(sm.isDetached());
return sm.isDetached();
// ##### we could do a lot more here if a detached state field
// ##### was specified.

View File

@ -481,7 +481,7 @@ public class Reflection {
*/
public static boolean getBoolean(Object target, Method getter) {
Object o = get(target, getter);
return (o == null) ? false : ((Boolean) o).booleanValue();
return (o == null) ? false : (Boolean) o;
}
/**
@ -497,7 +497,7 @@ public class Reflection {
*/
public static char getChar(Object target, Method getter) {
Object o = get(target, getter);
return (o == null) ? (char) 0 : ((Character) o).charValue();
return (o == null) ? (char) 0 : (Character) o;
}
/**

View File

@ -1757,8 +1757,7 @@ public class BrokerImpl implements Broker, FindCallbacks, Cloneable, Serializabl
&& (tranStatus != Status.STATUS_COMMITTED))
_runtime.setRollbackOnly(cause);
else if (_log.isTraceEnabled())
_log.trace(_loc.get("invalid-tran-status", Integer.valueOf(
tranStatus), "setRollbackOnly"));
_log.trace(_loc.get("invalid-tran-status", tranStatus, "setRollbackOnly"));
} catch (OpenJPAException ke) {
throw ke;
} catch (Exception e) {
@ -4784,7 +4783,7 @@ public class BrokerImpl implements Broker, FindCallbacks, Cloneable, Serializabl
return true;
Boolean detached = pc.pcIsDetached();
if (detached != null)
return detached.booleanValue();
return detached;
if(!find){
return false;

View File

@ -362,19 +362,19 @@ public class DetachedValueStateManager
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
: Boolean.FALSE;
case JavaTypes.BYTE:
return Byte.valueOf(fm.fetchByteField(field));
return fm.fetchByteField(field);
case JavaTypes.CHAR:
return Character.valueOf(fm.fetchCharField(field));
return fm.fetchCharField(field);
case JavaTypes.DOUBLE:
return Double.valueOf(fm.fetchDoubleField(field));
return fm.fetchDoubleField(field);
case JavaTypes.FLOAT:
return Float.valueOf(fm.fetchFloatField(field));
return fm.fetchFloatField(field);
case JavaTypes.INT:
return fm.fetchIntField(field);
case JavaTypes.LONG:
return fm.fetchLongField(field);
case JavaTypes.SHORT:
return Short.valueOf(fm.fetchShortField(field));
return fm.fetchShortField(field);
default:
return fm.fetchObjectField(field);
}

View File

@ -448,7 +448,7 @@ public class ExpressionStoreQuery
for(Entry<?, Class<?>> entry : paramTypes.entrySet()){
Object key = entry.getKey();
int idx = (key instanceof Integer)
? ((Integer)key).intValue() - base
? (Integer) key - base
: paramTypes.indexOf(key);
if (idx >= arr.length || idx < 0)
throw new UserException(_loc.get("gap-query-param",

View File

@ -331,7 +331,7 @@ public class FetchConfigurationImpl
&& flush != QueryFlushModes.FLUSH_FALSE
&& flush != QueryFlushModes.FLUSH_WITH_CONNECTION)
throw new IllegalArgumentException(_loc.get(
"bad-flush-before-queries", Integer.valueOf(flush)).getMessage());
"bad-flush-before-queries", flush).getMessage());
if (flush == DEFAULT && _state.ctx != null)
_state.flushQuery = _state.ctx.getConfiguration().
@ -681,7 +681,7 @@ public class FetchConfigurationImpl
&& scope != LockScopes.LOCKSCOPE_NORMAL
&& scope != LockScopes.LOCKSCOPE_EXTENDED)
throw new IllegalArgumentException(_loc.get(
"bad-lock-scope", Integer.valueOf(scope)).getMessage());
"bad-lock-scope", scope).getMessage());
if (scope == DEFAULT )
_state.lockScope = LOCKSCOPE_NORMAL;
else
@ -709,7 +709,7 @@ public class FetchConfigurationImpl
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
throw new IllegalArgumentException(_loc.get(
"bad-lock-level", Integer.valueOf(level)).getMessage());
"bad-lock-level", level).getMessage());
lock();
try {
@ -746,7 +746,7 @@ public class FetchConfigurationImpl
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
throw new IllegalArgumentException(_loc.get(
"bad-lock-level", Integer.valueOf(level)).getMessage());
"bad-lock-level", level).getMessage());
lock();
try {

View File

@ -309,7 +309,7 @@ public class Filters {
else if (type == Character.class) {
String str = o.toString();
if (str != null && str.length() == 1) {
return Character.valueOf(str.charAt(0));
return str.charAt(0);
}
}
else if (Calendar.class.isAssignableFrom(type) && o instanceof Date) {
@ -398,9 +398,9 @@ public class Filters {
if (type == Integer.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
return ((Number) o).intValue();
} else if (type == Float.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
return Float.valueOf(((Number) o).floatValue());
return ((Number) o).floatValue();
} else if (type == Double.class) {
return Double.valueOf(((Number) o).doubleValue());
return ((Number) o).doubleValue();
} else if (type == Long.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
return ((Number) o).longValue();
} else if (type == BigDecimal.class) {
@ -410,20 +410,20 @@ public class Filters {
// and Float versions, despite wanting to cast it to BigDecimal
double dval = ((Number) o).doubleValue();
if (Double.isNaN(dval) || Double.isInfinite(dval)) {
return Double.valueOf(dval);
return dval;
}
float fval = ((Number) o).floatValue();
if (Float.isNaN(fval) || Float.isInfinite(fval)) {
return Float.valueOf(fval);
return fval;
}
return new BigDecimal(o.toString());
} else if (type == BigInteger.class) {
return new BigInteger(o.toString());
} else if (type == Short.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
return Short.valueOf(((Number) o).shortValue());
return ((Number) o).shortValue();
} else if (type == Byte.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
return Byte.valueOf(((Number) o).byteValue());
return ((Number) o).byteValue();
} else if (type == Character.class) {
return (char) ((Number) o).intValue();
} else if (!strictNumericConversion) {
@ -576,7 +576,7 @@ public class Filters {
default:
throw new InternalException();
}
return Float.valueOf(tot);
return tot;
}
/**
@ -603,7 +603,7 @@ public class Filters {
default:
throw new InternalException();
}
return Double.valueOf(tot);
return tot;
}
/**
@ -1084,15 +1084,15 @@ public class Filters {
public static Object getDefaultForNull(Class<?> nType) {
if (nType == Long.class)
return Long.valueOf(0);
return 0L;
if (nType == Integer.class)
return Integer.valueOf(0);
return 0;
if (nType == Double.class)
return Double.valueOf(0.0);
return 0.0;
if (nType == Float.class)
return new Float(0.0);
return 0.0F;
if (nType == Short.class)
return Short.valueOf((short)0);
return (short) 0;
return null;
}

View File

@ -193,7 +193,7 @@ public class MethodStoreQuery
continue;
args[OBJ_INDEX] = obj;
if (((Boolean) invoke(q, args)).booleanValue())
if ((Boolean) invoke(q, args))
results.add(obj);
}
}
@ -284,7 +284,7 @@ public class MethodStoreQuery
int base = positionalParameterBase(userParams.keySet());
for (Object key : paramTypes.keySet()) {
int idx = (key instanceof Integer)
? ((Integer)key).intValue() - base
? (Integer) key - base
: paramTypes.indexOf(key);
if (idx >= arr.length || idx < 0)
throw new UserException(_loc.get("gap-query-param",

View File

@ -46,11 +46,11 @@ import org.apache.openjpa.util.ImplHelper;
public class ObjectIdStateManager
implements OpenJPAStateManager {
private static final Byte ZERO_BYTE = Byte.valueOf((byte)0);
private static final Character ZERO_CHAR = Character.valueOf((char)0);
private static final Double ZERO_DOUBLE = Double.valueOf(0);
private static final Float ZERO_FLOAT = Float.valueOf(0);
private static final Short ZERO_SHORT = Short.valueOf((short)0);
private static final Byte ZERO_BYTE = (byte) 0;
private static final Character ZERO_CHAR = (char) 0;
private static final Double ZERO_DOUBLE = (double) 0;
private static final Float ZERO_FLOAT = (float) 0;
private static final Short ZERO_SHORT = (short) 0;
private Object _oid;
private final OpenJPAStateManager _owner;
@ -429,7 +429,7 @@ public class ObjectIdStateManager
case JavaTypes.BOOLEAN:
return Boolean.FALSE.equals(val);
case JavaTypes.CHAR:
return ((Character) val).charValue() == 0;
return (Character) val == 0;
case JavaTypes.BYTE:
case JavaTypes.DOUBLE:
case JavaTypes.FLOAT:
@ -551,12 +551,12 @@ public class ObjectIdStateManager
@Override
public void storeByte(int field, byte extVal) {
setValue(field, Byte.valueOf(extVal), true);
setValue(field, extVal, true);
}
@Override
public void storeChar(int field, char extVal) {
setValue(field, Character.valueOf(extVal), true);
setValue(field, extVal, true);
}
@Override
@ -566,7 +566,7 @@ public class ObjectIdStateManager
@Override
public void storeShort(int field, short extVal) {
setValue(field, Short.valueOf(extVal), true);
setValue(field, extVal, true);
}
@Override
@ -576,12 +576,12 @@ public class ObjectIdStateManager
@Override
public void storeFloat(int field, float extVal) {
setValue(field, Float.valueOf(extVal), true);
setValue(field, extVal, true);
}
@Override
public void storeDouble(int field, double extVal) {
setValue(field, Double.valueOf(extVal), true);
setValue(field, extVal, true);
}
@Override
@ -661,7 +661,7 @@ public class ObjectIdStateManager
@Override
public boolean fetchBoolean(int field) {
return ((Boolean) getValue(field)).booleanValue();
return (Boolean) getValue(field);
}
@Override
@ -671,7 +671,7 @@ public class ObjectIdStateManager
@Override
public char fetchChar(int field) {
return ((Character) getValue(field)).charValue();
return (Character) getValue(field);
}
@Override

View File

@ -480,7 +480,7 @@ public class QueryImpl implements Query {
try {
assertOpen();
if (_unique != null)
return _unique.booleanValue();
return _unique;
if ((_query == null && _language.endsWith("JPQL")) || _compiling || _broker == null)
return false;
@ -488,7 +488,7 @@ public class QueryImpl implements Query {
if (_compiled == null) {
compileForCompilation();
if (_unique != null)
return _unique.booleanValue();
return _unique;
}
// no explicit setting; default
@ -1171,7 +1171,7 @@ public class QueryImpl implements Query {
switch (fmd.getDeclaredTypeCode()) {
case JavaTypes.BOOLEAN:
sm.settingBooleanField(into, i, sm.fetchBooleanField(i),
val == null ? false : ((Boolean) val).booleanValue(),
val == null ? false : (Boolean) val,
set);
break;
case JavaTypes.BYTE:

View File

@ -908,19 +908,19 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
return (fetchBooleanField(field)) ? Boolean.TRUE
: Boolean.FALSE;
case JavaTypes.BYTE:
return Byte.valueOf(fetchByteField(field));
return fetchByteField(field);
case JavaTypes.CHAR:
return Character.valueOf(fetchCharField(field));
return fetchCharField(field);
case JavaTypes.DOUBLE:
return Double.valueOf(fetchDoubleField(field));
return fetchDoubleField(field);
case JavaTypes.FLOAT:
return Float.valueOf(fetchFloatField(field));
return fetchFloatField(field);
case JavaTypes.INT:
return fetchIntField(field);
case JavaTypes.LONG:
return fetchLongField(field);
case JavaTypes.SHORT:
return Short.valueOf(fetchShortField(field));
return fetchShortField(field);
default:
return fetchObjectField(field);
}
@ -1042,19 +1042,19 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
: Boolean.FALSE;
case JavaTypes.BYTE:
return Byte.valueOf(fm.fetchByteField(field));
return fm.fetchByteField(field);
case JavaTypes.CHAR:
return Character.valueOf(fm.fetchCharField(field));
return fm.fetchCharField(field);
case JavaTypes.DOUBLE:
return Double.valueOf(fm.fetchDoubleField(field));
return fm.fetchDoubleField(field);
case JavaTypes.FLOAT:
return Float.valueOf(fm.fetchFloatField(field));
return fm.fetchFloatField(field);
case JavaTypes.INT:
return fm.fetchIntField(field);
case JavaTypes.LONG:
return fm.fetchLongField(field);
case JavaTypes.SHORT:
return Short.valueOf(fm.fetchShortField(field));
return fm.fetchShortField(field);
case JavaTypes.STRING:
return fm.fetchStringField(field);
default:
@ -1840,10 +1840,10 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (active) {
if (_broker.getOptimistic())
setPCState(_state.beforeOptimisticWrite(this, field,
mutate.booleanValue()));
mutate));
else
setPCState(_state.beforeWrite(this, field,
mutate.booleanValue()));
mutate));
} else if (fmd.getManagement() == FieldMetaData.MANAGE_PERSISTENT) {
if (isPersistent() && !_broker.getNontransactionalWrite())
throw new InvalidStateException(_loc.get
@ -1851,7 +1851,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
(getManagedInstance());
setPCState(_state.beforeNontransactionalWrite(this, field,
mutate.booleanValue()));
mutate));
}
if ((_flags & FLAG_FLUSHED) != 0) {
@ -2398,7 +2398,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
return fetchBooleanField(field);
Object val = fetchField(field, false);
return ((Boolean) fmd.getExternalValue(val, _broker)).booleanValue();
return (Boolean) fmd.getExternalValue(val, _broker);
}
@Override
@ -2446,7 +2446,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
return fetchCharField(field);
Object val = fetchField(field, false);
return ((Character) fmd.getExternalValue(val, _broker)).charValue();
return (Character) fmd.getExternalValue(val, _broker);
}
@Override
@ -2661,7 +2661,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (!fmd.isExternalized())
storeByteField(field, externalVal);
else
storeField(field, fmd.getFieldValue(Byte.valueOf(externalVal),
storeField(field, fmd.getFieldValue(externalVal,
_broker));
}
@ -2684,7 +2684,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (!fmd.isExternalized())
storeCharField(field, externalVal);
else
storeField(field, fmd.getFieldValue(Character.valueOf(externalVal),
storeField(field, fmd.getFieldValue(externalVal,
_broker));
}
@ -2707,7 +2707,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (!fmd.isExternalized())
storeDoubleField(field, externalVal);
else
storeField(field, fmd.getFieldValue(Double.valueOf(externalVal), _broker));
storeField(field, fmd.getFieldValue(externalVal, _broker));
}
@Override
@ -2729,7 +2729,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (!fmd.isExternalized())
storeFloatField(field, externalVal);
else
storeField(field, fmd.getFieldValue(Float.valueOf(externalVal), _broker));
storeField(field, fmd.getFieldValue(externalVal, _broker));
}
@Override
@ -2821,7 +2821,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
if (!fmd.isExternalized())
storeShortField(field, externalVal);
else
storeField(field, fmd.getFieldValue(Short.valueOf(externalVal),
storeField(field, fmd.getFieldValue(externalVal,
_broker));
}
@ -2872,7 +2872,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
switch (fmd.getDeclaredTypeCode()) {
case JavaTypes.BOOLEAN:
boolean bool = val != null && ((Boolean) val).booleanValue();
boolean bool = val != null && (Boolean) val;
fm.storeBooleanField(field, bool);
break;
case JavaTypes.BYTE:
@ -2880,7 +2880,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
fm.storeByteField(field, b);
break;
case JavaTypes.CHAR:
char c = (val == null) ? 0 : ((Character) val).charValue();
char c = (val == null) ? 0 : (Character) val;
fm.storeCharField(field, c);
break;
case JavaTypes.DOUBLE:

View File

@ -58,9 +58,9 @@ class Abs
if (c == Integer.class)
return Math.abs(((Number) o).intValue());
if (c == Float.class)
return Float.valueOf(Math.abs(((Number) o).floatValue()));
return Math.abs(((Number) o).floatValue());
if (c == Double.class)
return Double.valueOf(Math.abs(((Number) o).doubleValue()));
return Math.abs(((Number) o).doubleValue());
if (c == Long.class)
return Math.abs(((Number) o).longValue());
if (c == BigDecimal.class)

View File

@ -817,8 +817,8 @@ public class InMemoryExpressionFactory
return (_asc) ? -1 : 1;
if (o1 instanceof Boolean && o2 instanceof Boolean) {
int i1 = ((Boolean) o1).booleanValue() ? 1 : 0;
int i2 = ((Boolean) o2).booleanValue() ? 1 : 0;
int i1 = (Boolean) o1 ? 1 : 0;
int i2 = (Boolean) o2 ? 1 : 0;
return i1 - i2;
}

View File

@ -99,7 +99,7 @@ public class QueryExpressions implements Serializable {
if (_aggregate == null)
_aggregate = (AggregateExpressionVisitor.isAggregate(projections))
? Boolean.TRUE : Boolean.FALSE;
return _aggregate.booleanValue();
return _aggregate;
}
public boolean isDistinct() {

View File

@ -43,6 +43,6 @@ class Sqrt
@Override
protected Object operate(Object o, Class c) {
return Double.valueOf(Math.sqrt(((Number) o).doubleValue()));
return Math.sqrt(((Number) o).doubleValue());
}
}

View File

@ -45,7 +45,7 @@ class ValExpression
protected boolean eval(Object candidate, Object orig,
StoreContext ctx, Object[] params) {
Object o = _val.eval(candidate, orig, ctx, params);
return o != null && ((Boolean) o).booleanValue();
return o != null && (Boolean) o;
}
@Override
@ -53,7 +53,7 @@ class ValExpression
Object[] params) {
Collection c = _val.eval(candidates, null, ctx, params);
Object o = (c == null || c.isEmpty()) ? null : c.iterator().next();
return o != null && ((Boolean) o).booleanValue();
return o != null && (Boolean) o;
}
@Override

View File

@ -1035,7 +1035,7 @@ public class JPQLExpressionBuilder
? node.text.substring(0, node.text.length() - 1)
: node.text).
multiply(new BigDecimal(negative(node)));
return factory.newLiteral(Long.valueOf(intlit.longValue()),
return factory.newLiteral(intlit.longValue(),
Literal.TYPE_NUMBER);
case JJTDECIMALLITERAL:
@ -1322,7 +1322,7 @@ public class JPQLExpressionBuilder
case JJTCONCAT:
if (node.children.length < 2)
throw parseException(EX_USER, "less-child-count",
new Object[]{ Integer.valueOf(2), node,
new Object[]{2, node,
Arrays.asList(node.children) }, null);
val1 = getValue(firstChild(node));
@ -1485,7 +1485,7 @@ public class JPQLExpressionBuilder
? node.text.substring(0, node.text.length() - 1)
: node.text).
multiply(new BigDecimal(negative(node)));
return factory.newLiteral(Integer.valueOf(bigdec.intValue()),
return factory.newLiteral(bigdec.intValue(),
Literal.TYPE_NUMBER);
}
@ -2209,7 +2209,7 @@ public class JPQLExpressionBuilder
private JPQLNode child(JPQLNode node, int childNum, int assertCount) {
if (node.children.length != assertCount)
throw parseException(EX_USER, "wrong-child-count",
new Object[]{ Integer.valueOf(assertCount), node,
new Object[]{assertCount, node,
Arrays.asList(node.children) }, null);
return node.children[childNum];

View File

@ -108,8 +108,8 @@ public abstract class AbstractCFMetaDataFactory
File file;
for (int i = 0; i < strs.length; i++) {
file = new File(strs[i]);
if ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue())
if (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file)))
this.files.add(file);
}
}
@ -377,8 +377,8 @@ public abstract class AbstractCFMetaDataFactory
for (int i = 0; i < metas.length; i++) {
if (getSourceFile(metas[i]) == null)
setSourceFile(metas[i], defaultSourceFile(metas[i]));
if ((AccessController.doPrivileged(J2DoPrivHelper
.existsAction(getSourceFile(metas[i])))).booleanValue()) {
if (AccessController.doPrivileged(J2DoPrivHelper
.existsAction(getSourceFile(metas[i])))) {
if (files == null)
files = new HashSet();
files.add(getSourceFile(metas[i]));
@ -393,9 +393,8 @@ public abstract class AbstractCFMetaDataFactory
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
defaultFile == null ? "" : defaultFile.getPath());
}
if ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
.booleanValue()) {
if (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(queries[i].getSourceFile()))) {
if (files == null)
files = new HashSet();
files.add(queries[i].getSourceFile());
@ -406,9 +405,8 @@ public abstract class AbstractCFMetaDataFactory
if (getSourceFile(seqs[i]) == null)
setSourceFile(seqs[i], defaultSourceFile(seqs[i],
clsNames));
if ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(getSourceFile(seqs[i]))))
.booleanValue()) {
if (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(getSourceFile(seqs[i])))) {
if (files == null)
files = new HashSet();
files.add(getSourceFile(seqs[i]));
@ -436,9 +434,8 @@ public abstract class AbstractCFMetaDataFactory
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
defaultFile == null ? "" : defaultFile.getPath());
}
if ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
.booleanValue()) {
if (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(queries[i].getSourceFile()))) {
if (files == null)
files = new HashSet();
files.add(queries[i].getSourceFile());
@ -650,8 +647,8 @@ public abstract class AbstractCFMetaDataFactory
File file;
for (Iterator itr = files.iterator(); itr.hasNext();) {
file = (File) itr.next();
if ((AccessController.doPrivileged(J2DoPrivHelper
.isDirectoryAction(file))).booleanValue()) {
if (AccessController.doPrivileged(J2DoPrivHelper
.isDirectoryAction(file))) {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-directory", file));
scan(new FileMetaDataIterator(file, newMetaDataFilter()),
@ -699,9 +696,8 @@ public abstract class AbstractCFMetaDataFactory
.getAbsoluteFileAction(new File(url.getFile())));
if (files != null && files.contains(file)) {
continue;
} else if ((AccessController
.doPrivileged(J2DoPrivHelper.isDirectoryAction(file)))
.booleanValue()) {
} else if (AccessController
.doPrivileged(J2DoPrivHelper.isDirectoryAction(file))) {
if (log.isTraceEnabled())
log.trace(_loc.get("scanning-directory", file));
scan(

View File

@ -595,7 +595,7 @@ public class ClassMetaData
*/
public boolean isObjectIdTypeShared() {
if (_objectIdShared != null)
return _objectIdShared.booleanValue();
return _objectIdShared;
if (_super != null)
return getPCSuperclassMetaData().isObjectIdTypeShared();
return isOpenJPAIdentity();
@ -612,7 +612,7 @@ public class ClassMetaData
_openjpaId = (OpenJPAId.class.isAssignableFrom(cls)) ? Boolean.TRUE
: Boolean.FALSE;
}
return _openjpaId.booleanValue();
return _openjpaId;
}
/**
@ -769,7 +769,7 @@ public class ClassMetaData
else
_extent = Boolean.TRUE;
}
return _extent.booleanValue();
return _extent;
}
/**
@ -791,7 +791,7 @@ public class ClassMetaData
else
_embedded = Boolean.FALSE;
}
return _embedded.booleanValue();
return _embedded;
}
/**
@ -831,7 +831,7 @@ public class ClassMetaData
public boolean isManagedInterface() {
if (!_type.isInterface())
return false;
return _interface == null ? false : _interface.booleanValue();
return _interface == null ? false : _interface;
}
/**
@ -1584,7 +1584,7 @@ public class ClassMetaData
else
_detachable = Boolean.FALSE;
}
return _detachable.booleanValue();
return _detachable;
}
/**
@ -2143,7 +2143,7 @@ public class ClassMetaData
}
}
}
return _useIdClassFromParent.booleanValue();
return _useIdClassFromParent;
}
/**
@ -2705,7 +2705,7 @@ public class ClassMetaData
*/
public boolean hasAbstractPKField() {
if (_hasAbstractPKField != null) {
return _hasAbstractPKField.booleanValue();
return _hasAbstractPKField;
}
// Default to false, set to true only if this type is abstract and
@ -2725,7 +2725,7 @@ public class ClassMetaData
}
_hasAbstractPKField = temp;
return _hasAbstractPKField.booleanValue();
return _hasAbstractPKField;
}
/**
@ -2740,7 +2740,7 @@ public class ClassMetaData
*/
public boolean hasPKFieldsFromAbstractClass() {
if (_hasPKFieldsFromAbstractClass != null) {
return _hasPKFieldsFromAbstractClass.booleanValue();
return _hasPKFieldsFromAbstractClass;
}
// Default to FALSE, until proven true.
@ -2766,7 +2766,7 @@ public class ClassMetaData
}
_hasPKFieldsFromAbstractClass = temp;
return _hasPKFieldsFromAbstractClass.booleanValue();
return _hasPKFieldsFromAbstractClass;
}
/**
@ -2804,7 +2804,7 @@ public class ClassMetaData
int idsSize = ids.size();
int[] temp = new int[idsSize];
for (int i = 0; i < idsSize; i++) {
temp[i] = ids.get(i).intValue();
temp[i] = ids.get(i);
}
_pkAndNonPersistentManagedFmdIndexes = temp;
}
@ -2822,7 +2822,7 @@ public class ClassMetaData
}
inverseManagedFields = res;
}
return inverseManagedFields.booleanValue();
return inverseManagedFields;
}
public List<FieldMetaData> getMappyedByIdFields() {

View File

@ -220,7 +220,7 @@ public abstract class Extensions
*/
public boolean getBooleanExtension(String vendor, String key) {
String str = getStringExtension(vendor, key);
return (str == null) ? false : Boolean.valueOf(str).booleanValue();
return (str == null) ? false : Boolean.valueOf(str);
}
/**

View File

@ -317,7 +317,7 @@ public class FetchGroup
*/
public boolean isPostLoad () {
if (_postLoad != null)
return _postLoad.booleanValue();
return _postLoad;
if (_meta != null) {
ClassMetaData sup = _meta.getPCSuperclassMetaData();

View File

@ -659,7 +659,7 @@ public class FieldMetaData
_enumField = Enum.class.isAssignableFrom(decl)
? Boolean.TRUE : Boolean.FALSE;
}
return _enumField.booleanValue();
return _enumField;
}
private boolean isSerializable() {
@ -670,7 +670,7 @@ public class FieldMetaData
else
_serializableField = Boolean.FALSE;
}
return _serializableField.booleanValue();
return _serializableField;
}
private boolean isLobArray() {
@ -683,7 +683,7 @@ public class FieldMetaData
else
_lobField = Boolean.FALSE;
}
return _lobField.booleanValue();
return _lobField;
}
/**
@ -1537,7 +1537,7 @@ public class FieldMetaData
return Float.valueOf(val);
case JavaTypes.CHAR:
case JavaTypes.CHAR_OBJ:
return Character.valueOf(val.charAt(0));
return val.charAt(0);
case JavaTypes.STRING:
return val;
case JavaTypes.ENUM:
@ -2467,7 +2467,7 @@ public class FieldMetaData
public boolean isDelayCapable() {
if (_delayCapable != null) {
return _delayCapable.booleanValue();
return _delayCapable;
}
if (getTypeCode() != JavaTypes.COLLECTION || isLRS()) {
_delayCapable = Boolean.FALSE;

View File

@ -162,7 +162,7 @@ public class JavaTypes {
Integer code = _typeCodes.get(type);
if (code != null) {
return code.intValue();
return code;
}
// have to do this first to catch custom collection and map types;
@ -342,7 +342,7 @@ public class JavaTypes {
if (val instanceof Byte)
return val;
if (val instanceof Number)
return Byte.valueOf(((Number) val).byteValue());
return ((Number) val).byteValue();
// no break
case BYTE:
if (val instanceof String)
@ -353,9 +353,9 @@ public class JavaTypes {
if (val instanceof Character)
return val;
if (val instanceof String)
return Character.valueOf(val.toString().charAt(0));
return val.toString().charAt(0);
if (val instanceof Number)
return Character.valueOf((char) ((Number) val).intValue());
return (char) ((Number) val).intValue();
return val;
case DATE:
if (val instanceof String)
@ -365,7 +365,7 @@ public class JavaTypes {
if (val instanceof Double)
return val;
if (val instanceof Number)
return Double.valueOf(((Number) val).doubleValue());
return ((Number) val).doubleValue();
// no break
case DOUBLE:
if (val instanceof String)
@ -375,7 +375,7 @@ public class JavaTypes {
if (val instanceof Float)
return val;
if (val instanceof Number)
return Float.valueOf(((Number) val).floatValue());
return ((Number) val).floatValue();
// no break
case FLOAT:
if (val instanceof String)
@ -411,7 +411,7 @@ public class JavaTypes {
if (val instanceof Short)
return val;
if (val instanceof Number)
return Short.valueOf(((Number) val).shortValue());
return ((Number) val).shortValue();
// no break
case SHORT:
if (val instanceof String)

View File

@ -99,7 +99,7 @@ public class QueryMetaData
* Whether the query has been marked read-only.
*/
public boolean isReadOnly() {
return _readOnly != null && _readOnly.booleanValue();
return _readOnly != null && _readOnly;
}
/**
@ -217,7 +217,7 @@ public class QueryMetaData
if (_res != null)
query.setResultType(_res);
if (_readOnly != null)
query.setReadOnly(_readOnly.booleanValue());
query.setReadOnly(_readOnly);
if (_resultSetMappingName != null)
query.setResultMapping(null, _resultSetMappingName);
}

View File

@ -182,7 +182,7 @@ public class ValueMetaDataImpl
_embedded = Boolean.TRUE;
}
}
return _embedded.booleanValue();
return _embedded;
}
@Override

View File

@ -213,9 +213,9 @@ public abstract class AbstractChangeTracker
else
_identity = Boolean.FALSE;
add = switchStructure(add, _identity.booleanValue());
rem = switchStructure(rem, _identity.booleanValue());
change = switchStructure(change, _identity.booleanValue());
add = switchStructure(add, _identity);
rem = switchStructure(rem, _identity);
change = switchStructure(change, _identity);
}
/**

View File

@ -152,7 +152,7 @@ public class ApplicationIds {
case JavaTypes.CHAR:
case JavaTypes.CHAR_OBJ:
return new CharId(meta.getDescribedType(),
val == null ? 0 : ((Character) val).charValue());
val == null ? 0 : (Character) val);
case JavaTypes.DOUBLE:
case JavaTypes.DOUBLE_OBJ:
if (!convert && !(val instanceof Double))
@ -611,17 +611,17 @@ public class ApplicationIds {
@Override
public void storeByteField(int field, byte val) {
store(Byte.valueOf(val));
store(val);
}
@Override
public void storeCharField(int field, char val) {
store(Character.valueOf(val));
store(val);
}
@Override
public void storeShortField(int field, short val) {
store(Short.valueOf(val));
store(val);
}
@Override
@ -636,12 +636,12 @@ public class ApplicationIds {
@Override
public void storeFloatField(int field, float val) {
store(Float.valueOf(val));
store(val);
}
@Override
public void storeDoubleField(int field, double val) {
store(Double.valueOf(val));
store(val);
}
@Override
@ -661,7 +661,7 @@ public class ApplicationIds {
@Override
public char fetchCharField(int field) {
return ((Character) retrieve(field)).charValue();
return (Character) retrieve(field);
}
@Override

View File

@ -54,7 +54,7 @@ public class BooleanId extends OpenJPAId {
@Override
public Object getIdObject() {
return Boolean.valueOf(key);
return key;
}
@Override

View File

@ -30,7 +30,7 @@ public final class ByteId extends OpenJPAId {
private final byte key;
public ByteId(Class cls, Byte key) {
this(cls, (key == null) ? (byte) 0 : key.byteValue());
this(cls, (key == null) ? (byte) 0 : key);
}
public ByteId(Class cls, String key) {
@ -53,7 +53,7 @@ public final class ByteId extends OpenJPAId {
@Override
public Object getIdObject() {
return Byte.valueOf(key);
return key;
}
@Override

View File

@ -30,7 +30,7 @@ public final class CharId extends OpenJPAId {
private final char key;
public CharId(Class cls, Character key) {
this(cls, (key == null) ? (char) 0 : key.charValue());
this(cls, (key == null) ? (char) 0 : key);
}
public CharId(Class cls, String key) {
@ -53,7 +53,7 @@ public final class CharId extends OpenJPAId {
@Override
public Object getIdObject() {
return Character.valueOf(key);
return key;
}
@Override

View File

@ -31,7 +31,7 @@ public final class DoubleId
private final double key;
public DoubleId(Class cls, Double key) {
this(cls, (key == null) ? 0D : key.doubleValue());
this(cls, (key == null) ? 0D : key);
}
public DoubleId(Class cls, String key) {
@ -54,7 +54,7 @@ public final class DoubleId
@Override
public Object getIdObject() {
return Double.valueOf(key);
return key;
}
@Override

View File

@ -31,7 +31,7 @@ public final class FloatId
private final float key;
public FloatId(Class cls, Float key) {
this(cls, (key == null) ? 0F : key.floatValue());
this(cls, (key == null) ? 0F : key);
}
public FloatId(Class cls, String key) {
@ -54,7 +54,7 @@ public final class FloatId
@Override
public Object getIdObject() {
return Float.valueOf(key);
return key;
}
@Override

View File

@ -117,7 +117,7 @@ public final class Id
* Construct from key value.
*/
public Id(Class cls, Long key) {
this(cls, (key == null) ? 0L : key.longValue());
this(cls, (key == null) ? 0L : key);
}
/**

View File

@ -262,11 +262,11 @@ public class ImplHelper {
}
if (isAssignable == null) {// we don't have a record of this pair...
isAssignable = Boolean.valueOf(from.isAssignableFrom(to));
isAssignable = from.isAssignableFrom(to);
assignableTo.put(to, isAssignable);
}
return isAssignable.booleanValue();
return isAssignable;
}
/**

View File

@ -31,7 +31,7 @@ public final class IntId extends OpenJPAId {
private final int key;
public IntId(Class cls, Integer key) {
this(cls, (key == null) ? 0 : key.intValue());
this(cls, (key == null) ? 0 : key);
}
public IntId(Class cls, String key) {

View File

@ -31,7 +31,7 @@ public final class LongId extends OpenJPAId {
private final long key;
public LongId(Class cls, Long key) {
this(cls, (key == null) ? 0L : key.longValue());
this(cls, (key == null) ? 0L : key);
}
public LongId(Class cls, String key) {

View File

@ -119,9 +119,9 @@ public abstract class OpenJPAId
superclass = base.getSuperclass();
}
_typeHash = base.getName().hashCode();
_typeCache.put(type, Integer.valueOf(_typeHash));
_typeCache.put(type, _typeHash);
} else {
_typeHash = typeHashInt.intValue();
_typeHash = typeHashInt;
}
}
return _typeHash ^ idHash();

View File

@ -30,7 +30,7 @@ public final class ShortId extends OpenJPAId {
private final short key;
public ShortId(Class cls, Short key) {
this(cls, (key == null) ? (short) 0 : key.shortValue());
this(cls, (key == null) ? (short) 0 : key);
}
public ShortId(Class cls, String key) {
@ -53,7 +53,7 @@ public final class ShortId extends OpenJPAId {
@Override
public Object getIdObject() {
return Short.valueOf(key);
return key;
}
@Override

View File

@ -85,11 +85,11 @@ public class TestProxyManager {
* Populate the given list with arbitrary data.
*/
private static void populate(Collection coll) {
coll.add(new Integer(1));
coll.add(1);
coll.add("foo");
coll.add(new Long(99));
coll.add(99L);
coll.add("bar");
coll.add(new Short((short) 50));
coll.add((short) 50);
}
/**
@ -145,11 +145,11 @@ public class TestProxyManager {
* Populate the given sorted set with arbitrary data.
*/
private static void populate(SortedSet coll) {
coll.add(new Integer(1));
coll.add(new Integer(99));
coll.add(new Integer(50));
coll.add(new Integer(-5));
coll.add(new Integer(10));
coll.add(1);
coll.add(99);
coll.add(50);
coll.add(-5);
coll.add(10);
}
/**
@ -422,10 +422,10 @@ public class TestProxyManager {
* Populate the given map with arbitrary data.
*/
private static void populate(Map map) {
map.put(new Integer(1), "1");
map.put(new Integer(99), "99");
map.put(new Integer(-2), "-2");
map.put(new Integer(50), "50");
map.put(1, "1");
map.put(99, "99");
map.put(-2, "-2");
map.put(50, "50");
}
/**

View File

@ -209,8 +209,8 @@ public abstract class AbstractTask extends MatchingTask {
String[] dsFiles = ds.getIncludedFiles();
for (int j = 0; j < dsFiles.length; j++) {
File f = new File(dsFiles[j]);
if (!( AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(f))).booleanValue())
if (!AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(f)))
f = new File(ds.getBasedir(), dsFiles[j]);
files.add(AccessController.doPrivileged(
J2DoPrivHelper.getAbsolutePathAction(f)));

View File

@ -63,7 +63,7 @@ public class BooleanValue extends Value {
@Override
protected void setInternalString(String val) {
set(Boolean.valueOf(val).booleanValue());
set(Boolean.valueOf(val));
}
@Override
@ -71,6 +71,6 @@ public class BooleanValue extends Value {
if (obj == null)
set(false);
else
set(((Boolean) obj).booleanValue());
set((Boolean) obj);
}
}

View File

@ -341,13 +341,13 @@ public class Configurations {
String anchor = result.get(CONFIG_RESOURCE_ANCHOR);
File file = new File(path);
if ((AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(file))).booleanValue())
if (AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(file)))
provider = ProductDerivations.load(file, anchor, null);
else {
file = new File("META-INF" + File.separatorChar + path);
if ((AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(file))).booleanValue())
if (AccessController.doPrivileged(J2DoPrivHelper
.isFileAction(file)))
provider = ProductDerivations.load(file, anchor, null);
else
provider = ProductDerivations.load(path, anchor, null);

View File

@ -407,15 +407,13 @@ public class ProductDerivations {
}
File f = new File(propertiesLocation);
if (((Boolean) J2DoPrivHelper.isFileAction(f).run())
.booleanValue()) {
if ((Boolean) J2DoPrivHelper.isFileAction(f).run()) {
addAll(fqAnchors, propertiesLocation,
_derivations[i].getAnchorsInFile(f));
} else {
f = new File("META-INF" + File.separatorChar
+ propertiesLocation);
if (((Boolean) J2DoPrivHelper.isFileAction(f).run())
.booleanValue()) {
if ((Boolean) J2DoPrivHelper.isFileAction(f).run()) {
addAll(fqAnchors, propertiesLocation,
_derivations[i].getAnchorsInFile(f));
} else {

View File

@ -107,8 +107,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
super(conn);
if (_autoCommit != null) {
_curAutoCommit = ConfiguringConnection.this.getAutoCommit();
if (_curAutoCommit != _autoCommit.booleanValue())
setAutoCommit(_autoCommit.booleanValue());
if (_curAutoCommit != _autoCommit)
setAutoCommit(_autoCommit);
}
}
@ -125,8 +125,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
if (_isolation != TRANSACTION_NONE)
super.commit();
if (_autoCommit != null
&& _autoCommit.booleanValue() != _curAutoCommit)
setAutoCommit(_autoCommit.booleanValue());
&& _autoCommit != _curAutoCommit)
setAutoCommit(_autoCommit);
}
@Override
@ -134,8 +134,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
if (_isolation != TRANSACTION_NONE)
super.rollback();
if (_autoCommit != null
&& _autoCommit.booleanValue() != _curAutoCommit)
setAutoCommit(_autoCommit.booleanValue());
&& _autoCommit != _curAutoCommit)
setAutoCommit(_autoCommit);
}
@Override

View File

@ -114,7 +114,7 @@ public class LogFactoryImpl
l = newLogImpl();
l.setChannel(channel); // TODO add to interface?
Short lvl = _configuredLevels.get(shorten(channel));
l.setLevel(lvl == null ? _defaultLogLevel : lvl.shortValue());
l.setLevel(lvl == null ? _defaultLogLevel : lvl);
_logs.put(channel, l);
}
return l;
@ -282,7 +282,7 @@ public class LogFactoryImpl
for (Iterator<Map.Entry<Object, Object>> iter =
opts.entrySet().iterator(); iter.hasNext();) {
e = iter.next();
_configuredLevels.put(shorten((String) e.getKey()), Short.valueOf(getLevel((String) e.getValue())));
_configuredLevels.put(shorten((String) e.getKey()), getLevel((String) e.getValue()));
}
opts.clear();
}

View File

@ -216,8 +216,8 @@ public class ClassArgParser {
return new String[]{ getFromClassFile(file) };
if (arg.endsWith(".java"))
return new String[]{ getFromJavaFile(file) };
if ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue()) {
if (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))) {
Collection<String> col = getFromMetaDataFile(file);
return col.toArray(new String[col.size()]);
}

View File

@ -192,8 +192,8 @@ public class ClassMetaDataIterator implements MetaDataIterator {
if (_url == -1 || _url >= _urls.size())
throw new IllegalStateException();
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
return ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file:null;
return (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))) ? file:null;
}
@Override

View File

@ -60,11 +60,11 @@ public class ClasspathMetaDataIterator extends MetaDataIteratorChain {
continue;
File file = new File(tokens[i]);
if (!(AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue())
if (!AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file)))
continue;
if (AccessController.doPrivileged(J2DoPrivHelper
.isDirectoryAction(file)).booleanValue())
.isDirectoryAction(file)))
addIterator(new FileMetaDataIterator(file, filter));
else if (tokens[i].endsWith(".jar")) {
try {

View File

@ -164,8 +164,8 @@ public class FileMetaDataIterator implements MetaDataIterator {
@Override
public byte[] getContent() throws IOException {
long len = (AccessController.doPrivileged(
J2DoPrivHelper.lengthAction(_file))).longValue();
long len = AccessController.doPrivileged(
J2DoPrivHelper.lengthAction(_file));
FileInputStream fin = null;
try {
fin = AccessController.doPrivileged(

View File

@ -106,8 +106,8 @@ public class ResourceMetaDataIterator implements MetaDataIterator {
if (_url == -1 || _url >= _urls.size())
throw new IllegalStateException();
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
return ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file :null;
return (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))) ? file :null;
}
@Override

View File

@ -80,8 +80,8 @@ public class URLMetaDataIterator implements MetaDataIterator {
if (_url == null)
return null;
File file = new File(URLDecoder.decode(_url.getPath()));
return ((AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file:null;
return (AccessController.doPrivileged(
J2DoPrivHelper.existsAction(file))) ? file:null;
}
@Override

View File

@ -305,8 +305,8 @@ public abstract class XMLMetaDataParser extends DefaultHandler
public void parse(File file) throws IOException {
if (file == null)
return;
if (!(AccessController.doPrivileged(J2DoPrivHelper
.isDirectoryAction(file))).booleanValue())
if (!AccessController.doPrivileged(J2DoPrivHelper
.isDirectoryAction(file)))
parse(new FileMetaDataIterator(file));
else {
String suff = (_suffix == null) ? "" : _suffix;

Some files were not shown because too many files have changed in this diff Show More