mirror of https://github.com/apache/openjpa.git
remove unecessary boxing/unboxing - no functional change
This commit is contained in:
parent
b0ba9c3e60
commit
a7708636e3
|
@ -147,7 +147,7 @@ public class AccountDataBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AccountDataBean getRandomInstance() {
|
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), //loginCount
|
||||||
TradeConfig.rndInt(10000), //logoutCount
|
TradeConfig.rndInt(10000), //logoutCount
|
||||||
new java.util.Date(), //lastLogin
|
new java.util.Date(), //lastLogin
|
||||||
|
|
|
@ -119,7 +119,7 @@ public class HoldingDataBean implements Serializable {
|
||||||
|
|
||||||
public static HoldingDataBean getRandomInstance() {
|
public static HoldingDataBean getRandomInstance() {
|
||||||
return new HoldingDataBean(
|
return new HoldingDataBean(
|
||||||
new Integer(TradeConfig.rndInt(100000)), //holdingID
|
TradeConfig.rndInt(100000), //holdingID
|
||||||
TradeConfig.rndQuantity(), //quantity
|
TradeConfig.rndQuantity(), //quantity
|
||||||
TradeConfig.rndBigDecimal(1000.0f), //purchasePrice
|
TradeConfig.rndBigDecimal(1000.0f), //purchasePrice
|
||||||
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), //purchaseDate
|
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)), //purchaseDate
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class OrderDataBean implements Serializable
|
||||||
|
|
||||||
public static OrderDataBean getRandomInstance() {
|
public static OrderDataBean getRandomInstance() {
|
||||||
return new OrderDataBean(
|
return new OrderDataBean(
|
||||||
new Integer(TradeConfig.rndInt(100000)),
|
TradeConfig.rndInt(100000),
|
||||||
TradeConfig.rndBoolean() ? "buy" : "sell",
|
TradeConfig.rndBoolean() ? "buy" : "sell",
|
||||||
"open",
|
"open",
|
||||||
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)),
|
new java.util.Date(TradeConfig.rndInt(Integer.MAX_VALUE)),
|
||||||
|
|
|
@ -133,7 +133,7 @@ public class TradeAction extends TradeJPADirect {
|
||||||
setAttribute(sb, "Page", "Buy");
|
setAttribute(sb, "Page", "Buy");
|
||||||
try {
|
try {
|
||||||
OrderDataBean orderData = buy(userID, symbol, new Double(
|
OrderDataBean orderData = buy(userID, symbol, new Double(
|
||||||
quantity).doubleValue(), TradeConfig.orderProcessingMode);
|
quantity), TradeConfig.orderProcessingMode);
|
||||||
setAttribute(sb, "orderData", orderData);
|
setAttribute(sb, "orderData", orderData);
|
||||||
setAttribute(sb, "results", results);
|
setAttribute(sb, "results", results);
|
||||||
} catch (java.lang.IllegalArgumentException e) {
|
} catch (java.lang.IllegalArgumentException e) {
|
||||||
|
|
|
@ -388,7 +388,7 @@ public class TradeConfig {
|
||||||
return (new Float(random() * i)).intValue();
|
return (new Float(random() * i)).intValue();
|
||||||
}
|
}
|
||||||
public static float rndFloat(int i) {
|
public static float rndFloat(int i) {
|
||||||
return (new Float(random() * i)).floatValue();
|
return new Float(random() * i);
|
||||||
}
|
}
|
||||||
public static BigDecimal rndBigDecimal(float f) {
|
public static BigDecimal rndBigDecimal(float f) {
|
||||||
return (new BigDecimal(random() * f)).setScale(
|
return (new BigDecimal(random() * f)).setScale(
|
||||||
|
@ -465,7 +465,7 @@ public class TradeConfig {
|
||||||
if (deck == null) {
|
if (deck == null) {
|
||||||
deck = new ArrayList(numUsers);
|
deck = new ArrayList(numUsers);
|
||||||
for (int i = 0; i < numUsers; i++)
|
for (int i = 0; i < numUsers; i++)
|
||||||
deck.add(i, new Integer(i));
|
deck.add(i, i);
|
||||||
java.util.Collections.shuffle(deck, r0);
|
java.util.Collections.shuffle(deck, r0);
|
||||||
}
|
}
|
||||||
if (card >= numUsers)
|
if (card >= numUsers)
|
||||||
|
|
|
@ -522,7 +522,7 @@ public class TradeJPADirect {
|
||||||
Query updateStatus = entityManager.createNativeQuery(
|
Query updateStatus = entityManager.createNativeQuery(
|
||||||
"UPDATE orderejb o SET o.orderStatus = 'completed' WHERE "
|
"UPDATE orderejb o SET o.orderStatus = 'completed' WHERE "
|
||||||
+ "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID = ?");
|
+ "o.orderStatus = 'closed' AND o.ACCOUNT_ACCOUNTID = ?");
|
||||||
updateStatus.setParameter(1, accountid.intValue());
|
updateStatus.setParameter(1, accountid);
|
||||||
updateStatus.executeUpdate();
|
updateStatus.executeUpdate();
|
||||||
}
|
}
|
||||||
if (entityManager != null) {
|
if (entityManager != null) {
|
||||||
|
|
|
@ -272,8 +272,8 @@ public class ReverseMappingToolTask
|
||||||
// load customizer properties
|
// load customizer properties
|
||||||
Properties customProps = new Properties();
|
Properties customProps = new Properties();
|
||||||
File propsFile = Files.getFile(customizerProperties, loader);
|
File propsFile = Files.getFile(customizerProperties, loader);
|
||||||
if (propsFile != null && (AccessController.doPrivileged(
|
if (propsFile != null && AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(propsFile))).booleanValue()) {
|
J2DoPrivHelper.existsAction(propsFile))) {
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
try {
|
try {
|
||||||
fis = AccessController.doPrivileged(
|
fis = AccessController.doPrivileged(
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& mode != EagerFetchModes.EAGER_NONE
|
&& mode != EagerFetchModes.EAGER_NONE
|
||||||
&& mode != EagerFetchModes.EAGER_JOIN
|
&& mode != EagerFetchModes.EAGER_JOIN
|
||||||
&& mode != EagerFetchModes.EAGER_PARALLEL)
|
&& 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) {
|
if (mode == DEFAULT) {
|
||||||
JDBCConfiguration conf = getJDBCConfiguration();
|
JDBCConfiguration conf = getJDBCConfiguration();
|
||||||
|
@ -197,7 +197,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& mode != EagerFetchModes.EAGER_NONE
|
&& mode != EagerFetchModes.EAGER_NONE
|
||||||
&& mode != EagerFetchModes.EAGER_JOIN
|
&& mode != EagerFetchModes.EAGER_JOIN
|
||||||
&& mode != EagerFetchModes.EAGER_PARALLEL)
|
&& 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) {
|
if (mode == DEFAULT) {
|
||||||
JDBCConfiguration conf = getJDBCConfiguration();
|
JDBCConfiguration conf = getJDBCConfiguration();
|
||||||
|
@ -220,7 +220,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& type != ResultSet.TYPE_FORWARD_ONLY
|
&& type != ResultSet.TYPE_FORWARD_ONLY
|
||||||
&& type != ResultSet.TYPE_SCROLL_INSENSITIVE
|
&& type != ResultSet.TYPE_SCROLL_INSENSITIVE
|
||||||
&& type != ResultSet.TYPE_SCROLL_SENSITIVE)
|
&& 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) {
|
if (type == DEFAULT) {
|
||||||
JDBCConfiguration conf = getJDBCConfiguration();
|
JDBCConfiguration conf = getJDBCConfiguration();
|
||||||
|
@ -242,7 +242,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& direction != ResultSet.FETCH_FORWARD
|
&& direction != ResultSet.FETCH_FORWARD
|
||||||
&& direction != ResultSet.FETCH_REVERSE
|
&& direction != ResultSet.FETCH_REVERSE
|
||||||
&& direction != ResultSet.FETCH_UNKNOWN)
|
&& 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());
|
.getMessage());
|
||||||
|
|
||||||
if (direction == DEFAULT) {
|
if (direction == DEFAULT) {
|
||||||
|
@ -265,7 +265,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& size != LRSSizes.SIZE_QUERY
|
&& size != LRSSizes.SIZE_QUERY
|
||||||
&& size != LRSSizes.SIZE_LAST
|
&& size != LRSSizes.SIZE_LAST
|
||||||
&& size != LRSSizes.SIZE_UNKNOWN)
|
&& 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) {
|
if (size == DEFAULT) {
|
||||||
JDBCConfiguration conf = getJDBCConfiguration();
|
JDBCConfiguration conf = getJDBCConfiguration();
|
||||||
|
@ -287,7 +287,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& syntax != JoinSyntaxes.SYNTAX_SQL92
|
&& syntax != JoinSyntaxes.SYNTAX_SQL92
|
||||||
&& syntax != JoinSyntaxes.SYNTAX_TRADITIONAL
|
&& syntax != JoinSyntaxes.SYNTAX_TRADITIONAL
|
||||||
&& syntax != JoinSyntaxes.SYNTAX_DATABASE)
|
&& 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) {
|
if (syntax == DEFAULT) {
|
||||||
JDBCConfiguration conf = getJDBCConfiguration();
|
JDBCConfiguration conf = getJDBCConfiguration();
|
||||||
|
@ -417,7 +417,7 @@ public class JDBCFetchConfigurationImpl
|
||||||
&& level != Connection.TRANSACTION_READ_COMMITTED
|
&& level != Connection.TRANSACTION_READ_COMMITTED
|
||||||
&& level != Connection.TRANSACTION_REPEATABLE_READ
|
&& level != Connection.TRANSACTION_REPEATABLE_READ
|
||||||
&& level != Connection.TRANSACTION_SERIALIZABLE)
|
&& 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)
|
if (level == DEFAULT)
|
||||||
_state.isolationLevel = -1;
|
_state.isolationLevel = -1;
|
||||||
|
|
|
@ -353,7 +353,7 @@ public class JDBCStoreManager implements StoreManager, JDBCStore {
|
||||||
&& !((OpenJPAId) oid).hasSubclasses()) {
|
&& !((OpenJPAId) oid).hasSubclasses()) {
|
||||||
Boolean custom = customLoad(sm, mapping, state, fetch);
|
Boolean custom = customLoad(sm, mapping, state, fetch);
|
||||||
if (custom != null)
|
if (custom != null)
|
||||||
return custom.booleanValue();
|
return custom;
|
||||||
res = getInitializeStateResult(sm, mapping, fetch,
|
res = getInitializeStateResult(sm, mapping, fetch,
|
||||||
Select.SUBS_EXACT);
|
Select.SUBS_EXACT);
|
||||||
if (res == null && !selectPrimaryKey(sm, mapping, fetch))
|
if (res == null && !selectPrimaryKey(sm, mapping, fetch))
|
||||||
|
@ -367,7 +367,7 @@ public class JDBCStoreManager implements StoreManager, JDBCStore {
|
||||||
mapping = mappings[0];
|
mapping = mappings[0];
|
||||||
Boolean custom = customLoad(sm, mapping, state, fetch);
|
Boolean custom = customLoad(sm, mapping, state, fetch);
|
||||||
if (custom != null)
|
if (custom != null)
|
||||||
return custom.booleanValue();
|
return custom;
|
||||||
res = getInitializeStateResult(sm, mapping, fetch,
|
res = getInitializeStateResult(sm, mapping, fetch,
|
||||||
Select.SUBS_ANY_JOINABLE);
|
Select.SUBS_ANY_JOINABLE);
|
||||||
if (res == null && !selectPrimaryKey(sm, mapping, fetch))
|
if (res == null && !selectPrimaryKey(sm, mapping, fetch))
|
||||||
|
|
|
@ -915,7 +915,7 @@ public class JDBCStoreQuery
|
||||||
Boolean where = trimVal.getWhere();
|
Boolean where = trimVal.getWhere();
|
||||||
if (where == null) { //trim both
|
if (where == null) { //trim both
|
||||||
return trimLeading(trimTrailing(valStr, trimCharObj), trimCharObj);
|
return trimLeading(trimTrailing(valStr, trimCharObj), trimCharObj);
|
||||||
} else if (where.booleanValue()) { // trim leading
|
} else if (where) { // trim leading
|
||||||
return trimLeading(valStr, trimCharObj);
|
return trimLeading(valStr, trimCharObj);
|
||||||
} else { // trim trailing
|
} else { // trim trailing
|
||||||
return trimTrailing(valStr, trimCharObj);
|
return trimTrailing(valStr, trimCharObj);
|
||||||
|
@ -964,13 +964,13 @@ public class JDBCStoreQuery
|
||||||
Object val = getValue(absVal.getValue(), ob, params, sm);
|
Object val = getValue(absVal.getValue(), ob, params, sm);
|
||||||
Class c = val.getClass();
|
Class c = val.getClass();
|
||||||
if (c == Integer.class)
|
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)
|
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)
|
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)
|
else if (c == Long.class)
|
||||||
return Long.valueOf(java.lang.Math.abs(((Long) val).longValue()));
|
return Math.abs(((Long) val).longValue());
|
||||||
throw new UnsupportedException();
|
throw new UnsupportedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -981,13 +981,13 @@ public class JDBCStoreQuery
|
||||||
Object val = getValue(sqrtVal.getValue(), ob, params, sm);
|
Object val = getValue(sqrtVal.getValue(), ob, params, sm);
|
||||||
Class c = val.getClass();
|
Class c = val.getClass();
|
||||||
if (c == Integer.class)
|
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)
|
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)
|
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)
|
else if (c == Long.class)
|
||||||
return Double.valueOf(java.lang.Math.sqrt(((Long) val).doubleValue()));
|
return Math.sqrt(((Long) val).doubleValue());
|
||||||
throw new UnsupportedException();
|
throw new UnsupportedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class PreparedSQLStoreQuery extends SQLStoreQuery {
|
||||||
|
|
||||||
Set<Map.Entry<Object,Object>> userSet = userParams.entrySet();
|
Set<Map.Entry<Object,Object>> userSet = userParams.entrySet();
|
||||||
for (Map.Entry<Object,Object> userEntry : userSet) {
|
for (Map.Entry<Object,Object> userEntry : userSet) {
|
||||||
int idx = ((Integer)userEntry.getKey()).intValue();
|
int idx = (Integer) userEntry.getKey();
|
||||||
array[idx] = userEntry.getValue();
|
array[idx] = userEntry.getValue();
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
|
|
|
@ -86,7 +86,7 @@ public abstract class SelectResultObjectProvider
|
||||||
ra = _sel.supportsRandomAccess(_fetch.getReadLockLevel() > 0);
|
ra = _sel.supportsRandomAccess(_fetch.getReadLockLevel() > 0);
|
||||||
_ra = (ra) ? Boolean.TRUE : Boolean.FALSE;
|
_ra = (ra) ? Boolean.TRUE : Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _ra.booleanValue();
|
return _ra;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -52,7 +52,7 @@ class ContainsExpression
|
||||||
if (count == null)
|
if (count == null)
|
||||||
count = 0;
|
count = 0;
|
||||||
else
|
else
|
||||||
count = count.intValue() + 1;
|
count = count + 1;
|
||||||
contains.put(path, count);
|
contains.put(path, count);
|
||||||
|
|
||||||
sql.setContainsId(count.toString());
|
sql.setContainsId(count.toString());
|
||||||
|
|
|
@ -68,7 +68,7 @@ class OrExpression
|
||||||
entry = (Map.Entry) itr.next();
|
entry = (Map.Entry) itr.next();
|
||||||
val2 = (Integer) entry.getValue();
|
val2 = (Integer) entry.getValue();
|
||||||
val1 = (Integer) contains.get(entry.getKey());
|
val1 = (Integer) contains.get(entry.getKey());
|
||||||
if (val1 == null || val2.intValue() > val1.intValue())
|
if (val1 == null || val2 > val1)
|
||||||
contains.put(entry.getKey(), val2);
|
contains.put(entry.getKey(), val2);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -170,7 +170,7 @@ public class Trim
|
||||||
if (_where == null) {
|
if (_where == null) {
|
||||||
func = dict.trimBothFunction;
|
func = dict.trimBothFunction;
|
||||||
dict.assertSupport(func != null, "TrimBothFunction");
|
dict.assertSupport(func != null, "TrimBothFunction");
|
||||||
} else if (_where.booleanValue()) {
|
} else if (_where) {
|
||||||
func = dict.trimLeadingFunction;
|
func = dict.trimLeadingFunction;
|
||||||
dict.assertSupport(func != null, "TrimLeadingFunction");
|
dict.assertSupport(func != null, "TrimLeadingFunction");
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -418,7 +418,7 @@ public class ClassMapping
|
||||||
try {
|
try {
|
||||||
strategy.setClassMapping(this);
|
strategy.setClassMapping(this);
|
||||||
if (adapt != null)
|
if (adapt != null)
|
||||||
strategy.map(adapt.booleanValue());
|
strategy.map(adapt);
|
||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
// reset strategy
|
// reset strategy
|
||||||
_strategy = orig;
|
_strategy = orig;
|
||||||
|
|
|
@ -113,7 +113,7 @@ public class Discriminator
|
||||||
try {
|
try {
|
||||||
strategy.setDiscriminator(this);
|
strategy.setDiscriminator(this);
|
||||||
if (adapt != null)
|
if (adapt != null)
|
||||||
strategy.map(adapt.booleanValue());
|
strategy.map(adapt);
|
||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
// reset strategy
|
// reset strategy
|
||||||
_strategy = orig;
|
_strategy = orig;
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class DiscriminatorMappingInfo extends MappingInfo {
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
return Integer.valueOf(_value);
|
return Integer.valueOf(_value);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return Character.valueOf(_value.charAt(_value.indexOf('\'')+1));
|
return _value.charAt(_value.indexOf('\'') + 1);
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
default:
|
default:
|
||||||
return _value;
|
return _value;
|
||||||
|
|
|
@ -144,7 +144,7 @@ public class FieldMapping
|
||||||
try {
|
try {
|
||||||
strategy.setFieldMapping(this);
|
strategy.setFieldMapping(this);
|
||||||
if (adapt != null)
|
if (adapt != null)
|
||||||
strategy.map(adapt.booleanValue());
|
strategy.map(adapt);
|
||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
// reset strategy
|
// reset strategy
|
||||||
_strategy = orig;
|
_strategy = orig;
|
||||||
|
@ -1280,7 +1280,7 @@ public class FieldMapping
|
||||||
*/
|
*/
|
||||||
public boolean isBidirectionalJoinTableMappingOwner() {
|
public boolean isBidirectionalJoinTableMappingOwner() {
|
||||||
if (_bidirectionalJoinTableOwner != null)
|
if (_bidirectionalJoinTableOwner != null)
|
||||||
return _bidirectionalJoinTableOwner.booleanValue();
|
return _bidirectionalJoinTableOwner;
|
||||||
|
|
||||||
_bidirectionalJoinTableOwner = false;
|
_bidirectionalJoinTableOwner = false;
|
||||||
ForeignKey fk = getForeignKey();
|
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() {
|
public boolean isBidirectionalJoinTableMappingNonOwner() {
|
||||||
if (_bidirectionalJoinTableNonOwner != null)
|
if (_bidirectionalJoinTableNonOwner != null)
|
||||||
return _bidirectionalJoinTableNonOwner.booleanValue();
|
return _bidirectionalJoinTableNonOwner;
|
||||||
|
|
||||||
_bidirectionalJoinTableNonOwner = false;
|
_bidirectionalJoinTableNonOwner = false;
|
||||||
ForeignKey fk = getForeignKey();
|
ForeignKey fk = getForeignKey();
|
||||||
|
@ -1358,7 +1358,7 @@ public class FieldMapping
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _bidirectionalJoinTableNonOwner.booleanValue();
|
return _bidirectionalJoinTableNonOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isBiMTo1JT() {
|
public boolean isBiMTo1JT() {
|
||||||
|
|
|
@ -54,18 +54,18 @@ public class JavaSQLTypes
|
||||||
public static final int TIMESTAMP = 1011;
|
public static final int TIMESTAMP = 1011;
|
||||||
public static final int JDBC_DEFAULT = 1012;
|
public static final int JDBC_DEFAULT = 1012;
|
||||||
|
|
||||||
private static final Byte ZERO_BYTE = Byte.valueOf((byte) 0);
|
private static final Byte ZERO_BYTE = (byte) 0;
|
||||||
private static final Character ZERO_CHAR = Character.valueOf((char) 0);
|
private static final Character ZERO_CHAR = (char) 0;
|
||||||
private static final Double ZERO_DOUBLE = Double.valueOf(0d);
|
private static final Double ZERO_DOUBLE = 0d;
|
||||||
private static final Float ZERO_FLOAT = Float.valueOf(0f);
|
private static final Float ZERO_FLOAT = 0f;
|
||||||
private static final Short ZERO_SHORT = Short.valueOf((short) 0);
|
private static final Short ZERO_SHORT = (short) 0;
|
||||||
private static final BigDecimal ZERO_BIGDECIMAL = new BigDecimal(0d);
|
private static final BigDecimal ZERO_BIGDECIMAL = new BigDecimal(0d);
|
||||||
|
|
||||||
private static final Byte NONZERO_BYTE = new Byte((byte) 1);
|
private static final Byte NONZERO_BYTE = (byte) 1;
|
||||||
private static final Character NONZERO_CHAR = Character.valueOf((char) 'a');
|
private static final Character NONZERO_CHAR = (char) 'a';
|
||||||
private static final Double NONZERO_DOUBLE = Double.valueOf(1d);
|
private static final Double NONZERO_DOUBLE = 1d;
|
||||||
private static final Float NONZERO_FLOAT = Float.valueOf(1f);
|
private static final Float NONZERO_FLOAT = 1f;
|
||||||
private static final Short NONZERO_SHORT = Short.valueOf((short) 1);
|
private static final Short NONZERO_SHORT = (short) 1;
|
||||||
private static final BigInteger NONZERO_BIGINTEGER = new BigInteger("1");
|
private static final BigInteger NONZERO_BIGINTEGER = new BigInteger("1");
|
||||||
private static final BigDecimal NONZERO_BIGDECIMAL = new BigDecimal(1d);
|
private static final BigDecimal NONZERO_BIGDECIMAL = new BigDecimal(1d);
|
||||||
|
|
||||||
|
|
|
@ -590,9 +590,9 @@ public class MappingDefaultsImpl
|
||||||
|
|
||||||
switch (disc.getJavaType()) {
|
switch (disc.getJavaType()) {
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
return Integer.valueOf(alias.hashCode());
|
return alias.hashCode();
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return Character.valueOf(alias.charAt(0));
|
return alias.charAt(0);
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
default:
|
default:
|
||||||
return alias;
|
return alias;
|
||||||
|
|
|
@ -810,7 +810,7 @@ public abstract class MappingInfo implements Serializable {
|
||||||
if (defStr != null)
|
if (defStr != null)
|
||||||
col.setDefaultString(defStr);
|
col.setDefaultString(defStr);
|
||||||
if (notNull != null)
|
if (notNull != null)
|
||||||
col.setNotNull(notNull.booleanValue());
|
col.setNotNull(notNull);
|
||||||
|
|
||||||
// add other details if adapting
|
// add other details if adapting
|
||||||
if (adapt) {
|
if (adapt) {
|
||||||
|
|
|
@ -1951,8 +1951,8 @@ public class ReverseMappingTool
|
||||||
File customFile = Files.getFile
|
File customFile = Files.getFile
|
||||||
(opts.removeProperty("customizerProperties", "cp", null), null);
|
(opts.removeProperty("customizerProperties", "cp", null), null);
|
||||||
Properties customProps = new Properties();
|
Properties customProps = new Properties();
|
||||||
if (customFile != null && (AccessController.doPrivileged(
|
if (customFile != null && AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(customFile))).booleanValue()) {
|
J2DoPrivHelper.existsAction(customFile))) {
|
||||||
FileInputStream fis = null;
|
FileInputStream fis = null;
|
||||||
try {
|
try {
|
||||||
fis = AccessController.doPrivileged(
|
fis = AccessController.doPrivileged(
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class Version
|
||||||
try {
|
try {
|
||||||
strategy.setVersion(this);
|
strategy.setVersion(this);
|
||||||
if (adapt != null)
|
if (adapt != null)
|
||||||
strategy.map(adapt.booleanValue());
|
strategy.map(adapt);
|
||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
// reset strategy
|
// reset strategy
|
||||||
_strategy = orig;
|
_strategy = orig;
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class EnumValueHandler extends AbstractValueHandler {
|
||||||
if (val == null)
|
if (val == null)
|
||||||
return null;
|
return null;
|
||||||
if (_ordinal)
|
if (_ordinal)
|
||||||
return Integer.valueOf(((Enum) val).ordinal());
|
return ((Enum) val).ordinal();
|
||||||
return ((Enum) val).name();
|
return ((Enum) val).name();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -212,7 +212,7 @@ public class LRSProxyCollection
|
||||||
throw SQLExceptions.getStore(se, _store.getDBDictionary());
|
throw SQLExceptions.getStore(se, _store.getDBDictionary());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _next.booleanValue();
|
return _next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -361,13 +361,13 @@ class LRSProxyMap
|
||||||
if (_next == null) {
|
if (_next == null) {
|
||||||
try {
|
try {
|
||||||
_next = (_res[0].next()) ? Boolean.TRUE : Boolean.FALSE;
|
_next = (_res[0].next()) ? Boolean.TRUE : Boolean.FALSE;
|
||||||
if (_next.booleanValue() && _res[1] != _res[0])
|
if (_next && _res[1] != _res[0])
|
||||||
_res[1].next();
|
_res[1].next();
|
||||||
} catch (SQLException se) {
|
} catch (SQLException se) {
|
||||||
throw SQLExceptions.getStore(se, _store.getDBDictionary());
|
throw SQLExceptions.getStore(se, _store.getDBDictionary());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _next.booleanValue();
|
return _next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -62,7 +62,7 @@ public class NumberVersionStrategy
|
||||||
@Override
|
@Override
|
||||||
protected int getJavaType() {
|
protected int getJavaType() {
|
||||||
if (_javaType == null && vers.getClassMapping().getVersionFieldMapping() != null) {
|
if (_javaType == null && vers.getClassMapping().getVersionFieldMapping() != null) {
|
||||||
_javaType = Integer.valueOf(vers.getClassMapping().getVersionFieldMapping().getTypeCode());
|
_javaType = vers.getClassMapping().getVersionFieldMapping().getTypeCode();
|
||||||
} else {
|
} else {
|
||||||
return JavaTypes.INT;
|
return JavaTypes.INT;
|
||||||
}
|
}
|
||||||
|
|
|
@ -350,7 +350,7 @@ public class PrimitiveFieldStrategy
|
||||||
if (autoInc == null)
|
if (autoInc == null)
|
||||||
sm.storeBoolean(idx, false);
|
sm.storeBoolean(idx, false);
|
||||||
else if (autoInc instanceof Boolean)
|
else if (autoInc instanceof Boolean)
|
||||||
sm.storeBoolean(idx, ((Boolean) autoInc).booleanValue());
|
sm.storeBoolean(idx, (Boolean) autoInc);
|
||||||
else
|
else
|
||||||
sm.storeBoolean(idx, ((Number) autoInc).intValue() != 0);
|
sm.storeBoolean(idx, ((Number) autoInc).intValue() != 0);
|
||||||
break;
|
break;
|
||||||
|
@ -364,7 +364,7 @@ public class PrimitiveFieldStrategy
|
||||||
if (autoInc == null)
|
if (autoInc == null)
|
||||||
sm.storeChar(idx, (char) 0);
|
sm.storeChar(idx, (char) 0);
|
||||||
else if (autoInc instanceof Character)
|
else if (autoInc instanceof Character)
|
||||||
sm.storeChar(idx, ((Character) autoInc).charValue());
|
sm.storeChar(idx, (Character) autoInc);
|
||||||
else if (autoInc instanceof String)
|
else if (autoInc instanceof String)
|
||||||
sm.storeChar(idx, ((String) autoInc).charAt(0));
|
sm.storeChar(idx, ((String) autoInc).charAt(0));
|
||||||
else
|
else
|
||||||
|
|
|
@ -36,7 +36,7 @@ class PrimitiveWrapperArrays {
|
||||||
if (vm.getType().getComponentType() == Character.class) {
|
if (vm.getType().getComponentType() == Character.class) {
|
||||||
Character[] objectArray = new Character[array.length];
|
Character[] objectArray = new Character[array.length];
|
||||||
for (int i = 0; i < array.length; i++)
|
for (int i = 0; i < array.length; i++)
|
||||||
objectArray[i] = Character.valueOf(array[i]);
|
objectArray[i] = array[i];
|
||||||
return objectArray;
|
return objectArray;
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
|
@ -50,7 +50,7 @@ class PrimitiveWrapperArrays {
|
||||||
Character[] charOb = (Character[]) ob;
|
Character[] charOb = (Character[]) ob;
|
||||||
char[] chars = new char[charOb.length];
|
char[] chars = new char[charOb.length];
|
||||||
for (int i = 0; i < charOb.length; i++)
|
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 chars;
|
||||||
}
|
}
|
||||||
return (char[]) ob;
|
return (char[]) ob;
|
||||||
|
@ -65,7 +65,7 @@ class PrimitiveWrapperArrays {
|
||||||
if (vm.getType().getComponentType() == Byte.class) {
|
if (vm.getType().getComponentType() == Byte.class) {
|
||||||
Byte[] objectArray = new Byte[array.length];
|
Byte[] objectArray = new Byte[array.length];
|
||||||
for (int i = 0; i < array.length; i++)
|
for (int i = 0; i < array.length; i++)
|
||||||
objectArray[i] = Byte.valueOf(array[i]);
|
objectArray[i] = array[i];
|
||||||
return objectArray;
|
return objectArray;
|
||||||
}
|
}
|
||||||
return array;
|
return array;
|
||||||
|
@ -79,7 +79,7 @@ class PrimitiveWrapperArrays {
|
||||||
Byte[] byteOb = (Byte[]) ob;
|
Byte[] byteOb = (Byte[]) ob;
|
||||||
byte[] bytes = new byte[byteOb.length];
|
byte[] bytes = new byte[byteOb.length];
|
||||||
for (int i = 0; i < byteOb.length; i++)
|
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 bytes;
|
||||||
}
|
}
|
||||||
return (byte[]) ob;
|
return (byte[]) ob;
|
||||||
|
|
|
@ -451,7 +451,7 @@ public class Column extends ReferenceCounter {
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
case JavaTypes.CHAR_OBJ:
|
case JavaTypes.CHAR_OBJ:
|
||||||
_default = Character.valueOf(_defaultStr.charAt(0));
|
_default = _defaultStr.charAt(0);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
case JavaTypes.DOUBLE_OBJ:
|
case JavaTypes.DOUBLE_OBJ:
|
||||||
|
|
|
@ -137,7 +137,7 @@ extends SimpleDriverDataSource implements Configurable, Closeable {
|
||||||
// save exception details for later instead of throwing here
|
// save exception details for later instead of throwing here
|
||||||
_dbcpEx = new RuntimeException(_eloc.get("driver-null", DBCPBASICDATASOURCENAME).getMessage(), e);
|
_dbcpEx = new RuntimeException(_eloc.get("driver-null", DBCPBASICDATASOURCENAME).getMessage(), e);
|
||||||
}
|
}
|
||||||
return _dbcpAvail.booleanValue();
|
return _dbcpAvail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,7 +183,7 @@ public class ForeignKey extends Constraint {
|
||||||
*/
|
*/
|
||||||
public boolean isPrimaryKeyAutoAssigned() {
|
public boolean isPrimaryKeyAutoAssigned() {
|
||||||
if (_autoAssign != null)
|
if (_autoAssign != null)
|
||||||
return _autoAssign.booleanValue();
|
return _autoAssign;
|
||||||
return isPrimaryKeyAutoAssigned(new ArrayList(3));
|
return isPrimaryKeyAutoAssigned(new ArrayList(3));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ public class ForeignKey extends Constraint {
|
||||||
*/
|
*/
|
||||||
private boolean isPrimaryKeyAutoAssigned(List seen) {
|
private boolean isPrimaryKeyAutoAssigned(List seen) {
|
||||||
if (_autoAssign != null)
|
if (_autoAssign != null)
|
||||||
return _autoAssign.booleanValue();
|
return _autoAssign;
|
||||||
|
|
||||||
Column[] cols = getPrimaryKeyColumns();
|
Column[] cols = getPrimaryKeyColumns();
|
||||||
if (cols.length == 0) {
|
if (cols.length == 0) {
|
||||||
|
|
|
@ -453,7 +453,7 @@ public abstract class AbstractResult
|
||||||
null, joins));
|
null, joins));
|
||||||
if (val == null)
|
if (val == null)
|
||||||
return false;
|
return false;
|
||||||
return Boolean.valueOf(val.toString()).booleanValue();
|
return Boolean.valueOf(val.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -612,7 +612,7 @@ public abstract class AbstractResult
|
||||||
if (val == null)
|
if (val == null)
|
||||||
return 0;
|
return 0;
|
||||||
if (val instanceof Character)
|
if (val instanceof Character)
|
||||||
return ((Character) val).charValue();
|
return (Character) val;
|
||||||
|
|
||||||
String str = val.toString();
|
String str = val.toString();
|
||||||
return (str.length() == 0) ? 0 : str.charAt(0);
|
return (str.length() == 0) ? 0 : str.charAt(0);
|
||||||
|
|
|
@ -670,10 +670,10 @@ public class DBDictionary
|
||||||
return getBigDecimal(rs, column);
|
return getBigDecimal(rs, column);
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
try {
|
try {
|
||||||
return Double.valueOf(getDouble(rs, column));
|
return getDouble(rs, column);
|
||||||
} catch (Exception e2) {
|
} catch (Exception e2) {
|
||||||
try {
|
try {
|
||||||
return Float.valueOf(getFloat(rs, column));
|
return getFloat(rs, column);
|
||||||
} catch (Exception e3) {
|
} catch (Exception e3) {
|
||||||
try {
|
try {
|
||||||
return getLong(rs, column);
|
return getLong(rs, column);
|
||||||
|
@ -1381,9 +1381,9 @@ public class DBDictionary
|
||||||
// check for known floating point types to give driver a chance to
|
// check for known floating point types to give driver a chance to
|
||||||
// handle special numbers like NaN and infinity; bug #1053
|
// handle special numbers like NaN and infinity; bug #1053
|
||||||
if (num instanceof Double)
|
if (num instanceof Double)
|
||||||
setDouble(stmnt, idx, ((Double) num).doubleValue(), col);
|
setDouble(stmnt, idx, (Double) num, col);
|
||||||
else if (num instanceof Float)
|
else if (num instanceof Float)
|
||||||
setFloat(stmnt, idx, ((Float) num).floatValue(), col);
|
setFloat(stmnt, idx, (Float) num, col);
|
||||||
else
|
else
|
||||||
setBigDecimal(stmnt, idx, new BigDecimal(num.toString()), col);
|
setBigDecimal(stmnt, idx, new BigDecimal(num.toString()), col);
|
||||||
}
|
}
|
||||||
|
@ -1472,7 +1472,7 @@ public class DBDictionary
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
case JavaTypes.BOOLEAN_OBJ:
|
case JavaTypes.BOOLEAN_OBJ:
|
||||||
setBoolean(stmnt, idx, ((Boolean) val).booleanValue(), col);
|
setBoolean(stmnt, idx, (Boolean) val, col);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
case JavaTypes.BYTE_OBJ:
|
case JavaTypes.BYTE_OBJ:
|
||||||
|
@ -1480,7 +1480,7 @@ public class DBDictionary
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
case JavaTypes.CHAR_OBJ:
|
case JavaTypes.CHAR_OBJ:
|
||||||
setChar(stmnt, idx, ((Character) val).charValue(), col);
|
setChar(stmnt, idx, (Character) val, col);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
case JavaTypes.DOUBLE_OBJ:
|
case JavaTypes.DOUBLE_OBJ:
|
||||||
|
@ -1642,21 +1642,21 @@ public class DBDictionary
|
||||||
else if (val instanceof String)
|
else if (val instanceof String)
|
||||||
setString(stmnt, idx, val.toString(), col);
|
setString(stmnt, idx, val.toString(), col);
|
||||||
else if (val instanceof Integer)
|
else if (val instanceof Integer)
|
||||||
setInt(stmnt, idx, ((Integer) val).intValue(), col);
|
setInt(stmnt, idx, (Integer) val, col);
|
||||||
else if (val instanceof Boolean)
|
else if (val instanceof Boolean)
|
||||||
setBoolean(stmnt, idx, ((Boolean) val).booleanValue(), col);
|
setBoolean(stmnt, idx, (Boolean) val, col);
|
||||||
else if (val instanceof Long)
|
else if (val instanceof Long)
|
||||||
setLong(stmnt, idx, ((Long) val).longValue(), col);
|
setLong(stmnt, idx, (Long) val, col);
|
||||||
else if (val instanceof Float)
|
else if (val instanceof Float)
|
||||||
setFloat(stmnt, idx, ((Float) val).floatValue(), col);
|
setFloat(stmnt, idx, (Float) val, col);
|
||||||
else if (val instanceof Double)
|
else if (val instanceof Double)
|
||||||
setDouble(stmnt, idx, ((Double) val).doubleValue(), col);
|
setDouble(stmnt, idx, (Double) val, col);
|
||||||
else if (val instanceof Byte)
|
else if (val instanceof Byte)
|
||||||
setByte(stmnt, idx, ((Byte) val).byteValue(), col);
|
setByte(stmnt, idx, (Byte) val, col);
|
||||||
else if (val instanceof Character)
|
else if (val instanceof Character)
|
||||||
setChar(stmnt, idx, ((Character) val).charValue(), col);
|
setChar(stmnt, idx, (Character) val, col);
|
||||||
else if (val instanceof Short)
|
else if (val instanceof Short)
|
||||||
setShort(stmnt, idx, ((Short) val).shortValue(), col);
|
setShort(stmnt, idx, (Short) val, col);
|
||||||
else if (val instanceof Locale)
|
else if (val instanceof Locale)
|
||||||
setLocale(stmnt, idx, (Locale) val, col);
|
setLocale(stmnt, idx, (Locale) val, col);
|
||||||
else if (val instanceof BigDecimal)
|
else if (val instanceof BigDecimal)
|
||||||
|
@ -5163,7 +5163,7 @@ public class DBDictionary
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
} else if (timeout < 0) {
|
} else if (timeout < 0) {
|
||||||
if (log.isWarnEnabled())
|
if (log.isWarnEnabled())
|
||||||
log.warn(_loc.get("invalid-timeout", Integer.valueOf(timeout)));
|
log.warn(_loc.get("invalid-timeout", timeout));
|
||||||
return;
|
return;
|
||||||
} else if (timeout > 0 && timeout < 1000) {
|
} else if (timeout > 0 && timeout < 1000) {
|
||||||
// round up to 1 sec
|
// round up to 1 sec
|
||||||
|
@ -5755,7 +5755,7 @@ public class DBDictionary
|
||||||
* @param supportsDelimitedIds the supportsDelimitedIds to set
|
* @param supportsDelimitedIds the supportsDelimitedIds to set
|
||||||
*/
|
*/
|
||||||
public void setSupportsDelimitedIdentifiers(boolean supportsDelimitedIds) {
|
public void setSupportsDelimitedIdentifiers(boolean supportsDelimitedIds) {
|
||||||
supportsDelimitedIdentifiers = Boolean.valueOf(supportsDelimitedIds);
|
supportsDelimitedIdentifiers = supportsDelimitedIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -5763,12 +5763,11 @@ public class DBDictionary
|
||||||
*/
|
*/
|
||||||
private void setSupportsDelimitedIdentifiers(DatabaseMetaData metaData) {
|
private void setSupportsDelimitedIdentifiers(DatabaseMetaData metaData) {
|
||||||
try {
|
try {
|
||||||
supportsDelimitedIdentifiers = Boolean.valueOf(
|
supportsDelimitedIdentifiers = metaData.supportsMixedCaseQuotedIdentifiers() ||
|
||||||
metaData.supportsMixedCaseQuotedIdentifiers() ||
|
metaData.storesLowerCaseQuotedIdentifiers() ||
|
||||||
metaData.storesLowerCaseQuotedIdentifiers() ||
|
metaData.storesUpperCaseQuotedIdentifiers();
|
||||||
metaData.storesUpperCaseQuotedIdentifiers());
|
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
supportsDelimitedIdentifiers = Boolean.valueOf(false);
|
supportsDelimitedIdentifiers = Boolean.FALSE;
|
||||||
getLog().warn(_loc.get("unknown-delim-support", e));
|
getLog().warn(_loc.get("unknown-delim-support", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -151,12 +151,12 @@ public class EmpressDictionary
|
||||||
// which can prove to be difficult to handle
|
// which can prove to be difficult to handle
|
||||||
if (val == Float.POSITIVE_INFINITY) {
|
if (val == Float.POSITIVE_INFINITY) {
|
||||||
val = Float.MAX_VALUE;
|
val = Float.MAX_VALUE;
|
||||||
storageWarning(new Float(Float.POSITIVE_INFINITY),
|
storageWarning(Float.POSITIVE_INFINITY,
|
||||||
new Float(val));
|
val);
|
||||||
} else if (val == Float.NEGATIVE_INFINITY) {
|
} else if (val == Float.NEGATIVE_INFINITY) {
|
||||||
val = Float.MIN_VALUE + 1;
|
val = Float.MIN_VALUE + 1;
|
||||||
storageWarning(new Float(Float.NEGATIVE_INFINITY),
|
storageWarning(Float.NEGATIVE_INFINITY,
|
||||||
new Float(val));
|
val);
|
||||||
}
|
}
|
||||||
super.setFloat(stmnt, idx, val, col);
|
super.setFloat(stmnt, idx, val, col);
|
||||||
}
|
}
|
||||||
|
@ -169,12 +169,12 @@ public class EmpressDictionary
|
||||||
// which can prove to be difficult to handle
|
// which can prove to be difficult to handle
|
||||||
if (val == Double.POSITIVE_INFINITY) {
|
if (val == Double.POSITIVE_INFINITY) {
|
||||||
val = Double.MAX_VALUE;
|
val = Double.MAX_VALUE;
|
||||||
storageWarning(new Double(Double.POSITIVE_INFINITY),
|
storageWarning(Double.POSITIVE_INFINITY,
|
||||||
new Double(val));
|
val);
|
||||||
} else if (val == Double.NEGATIVE_INFINITY) {
|
} else if (val == Double.NEGATIVE_INFINITY) {
|
||||||
val = Double.MIN_VALUE + 1;
|
val = Double.MIN_VALUE + 1;
|
||||||
storageWarning(new Double(Double.NEGATIVE_INFINITY),
|
storageWarning(Double.NEGATIVE_INFINITY,
|
||||||
new Double(val));
|
val);
|
||||||
}
|
}
|
||||||
super.setDouble(stmnt, idx, val, col);
|
super.setDouble(stmnt, idx, val, col);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1123,7 +1123,7 @@ public class LogicalUnion
|
||||||
*/
|
*/
|
||||||
private Object getOrderingValue(ResultSet rs, Object i) {
|
private Object getOrderingValue(ResultSet rs, Object i) {
|
||||||
try {
|
try {
|
||||||
return _dict.getObject(rs, ((Integer) i).intValue() + 1, null);
|
return _dict.getObject(rs, (Integer) i + 1, null);
|
||||||
} catch (SQLException se) {
|
} catch (SQLException se) {
|
||||||
throw SQLExceptions.getStore(se, _dict);
|
throw SQLExceptions.getStore(se, _dict);
|
||||||
}
|
}
|
||||||
|
|
|
@ -585,7 +585,7 @@ public class OracleDictionary
|
||||||
new Class[]{ int.class, short.class }).
|
new Class[]{ int.class, short.class }).
|
||||||
invoke(inner,
|
invoke(inner,
|
||||||
new Object[]{
|
new Object[]{
|
||||||
Integer.valueOf(idx),
|
idx,
|
||||||
oraclePreparedStatementFormNvarcharField.get(null)
|
oraclePreparedStatementFormNvarcharField.get(null)
|
||||||
});
|
});
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -613,7 +613,7 @@ public class OracleDictionary
|
||||||
setFixedCharMethod.setAccessible(true);
|
setFixedCharMethod.setAccessible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setFixedCharMethod.invoke(inner, new Object[]{ new Integer(idx), val });
|
setFixedCharMethod.invoke(inner, new Object[]{idx, val });
|
||||||
return;
|
return;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn(e);
|
log.warn(e);
|
||||||
|
@ -711,7 +711,7 @@ public class OracleDictionary
|
||||||
return null;
|
return null;
|
||||||
if (oracleClob_isEmptyLob_Method != null && clob.getClass().getName().equals("oracle.sql.CLOB")) {
|
if (oracleClob_isEmptyLob_Method != null && clob.getClass().getName().equals("oracle.sql.CLOB")) {
|
||||||
try {
|
try {
|
||||||
if (((Boolean) oracleClob_isEmptyLob_Method.invoke(clob, new Object[0])).booleanValue()) {
|
if ((Boolean) oracleClob_isEmptyLob_Method.invoke(clob, new Object[0])) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -438,19 +438,19 @@ public class ResultSetResult
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
case JavaTypes.BYTE_OBJ:
|
case JavaTypes.BYTE_OBJ:
|
||||||
val = new Byte(getByteInternal(obj, joins));
|
val = getByteInternal(obj, joins);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
case JavaTypes.CHAR_OBJ:
|
case JavaTypes.CHAR_OBJ:
|
||||||
val = new Character(getCharInternal(obj, joins));
|
val = getCharInternal(obj, joins);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
case JavaTypes.DOUBLE_OBJ:
|
case JavaTypes.DOUBLE_OBJ:
|
||||||
val = new Double(getDoubleInternal(obj, joins));
|
val = getDoubleInternal(obj, joins);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
case JavaTypes.FLOAT_OBJ:
|
case JavaTypes.FLOAT_OBJ:
|
||||||
val = new Float(getFloatInternal(obj, joins));
|
val = getFloatInternal(obj, joins);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
case JavaTypes.INT_OBJ:
|
case JavaTypes.INT_OBJ:
|
||||||
|
@ -462,7 +462,7 @@ public class ResultSetResult
|
||||||
break;
|
break;
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
case JavaTypes.SHORT_OBJ:
|
case JavaTypes.SHORT_OBJ:
|
||||||
val = new Short(getShortInternal(obj, joins));
|
val = getShortInternal(obj, joins);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
return getStringInternal(obj, joins, isClob);
|
return getStringInternal(obj, joins, isClob);
|
||||||
|
|
|
@ -439,7 +439,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void setByte(Column col, byte val)
|
public void setByte(Column col, byte val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
setObject(col, new Byte(val), JavaTypes.BYTE, false);
|
setObject(col, val, JavaTypes.BYTE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -457,7 +457,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void setChar(Column col, char val)
|
public void setChar(Column col, char val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
setObject(col, new Character(val), JavaTypes.CHAR, false);
|
setObject(col, val, JavaTypes.CHAR, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -493,13 +493,13 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void setDouble(Column col, double val)
|
public void setDouble(Column col, double val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
setObject(col, new Double(val), JavaTypes.DOUBLE, false);
|
setObject(col, val, JavaTypes.DOUBLE, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setFloat(Column col, float val)
|
public void setFloat(Column col, float val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
setObject(col, new Float(val), JavaTypes.FLOAT, false);
|
setObject(col, val, JavaTypes.FLOAT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -547,7 +547,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void setShort(Column col, short val)
|
public void setShort(Column col, short val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
setObject(col, new Short(val), JavaTypes.SHORT, false);
|
setObject(col, val, JavaTypes.SHORT, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -635,7 +635,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void whereByte(Column col, byte val)
|
public void whereByte(Column col, byte val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
whereObject(col, new Byte(val), JavaTypes.BYTE);
|
whereObject(col, val, JavaTypes.BYTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -653,7 +653,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void whereChar(Column col, char val)
|
public void whereChar(Column col, char val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
whereObject(col, new Character(val), JavaTypes.CHAR);
|
whereObject(col, val, JavaTypes.CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -689,13 +689,13 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void whereDouble(Column col, double val)
|
public void whereDouble(Column col, double val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
whereObject(col, new Double(val), JavaTypes.DOUBLE);
|
whereObject(col, val, JavaTypes.DOUBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void whereFloat(Column col, float val)
|
public void whereFloat(Column col, float val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
whereObject(col, new Float(val), JavaTypes.FLOAT);
|
whereObject(col, val, JavaTypes.FLOAT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -737,7 +737,7 @@ public class RowImpl
|
||||||
@Override
|
@Override
|
||||||
public void whereShort(Column col, short val)
|
public void whereShort(Column col, short val)
|
||||||
throws SQLException {
|
throws SQLException {
|
||||||
whereObject(col, new Short(val), JavaTypes.SHORT);
|
whereObject(col, val, JavaTypes.SHORT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -366,14 +366,14 @@ public final class SQLBuffer
|
||||||
|
|
||||||
} else if ( type == Character.class ) {
|
} else if ( type == Character.class ) {
|
||||||
if (_dict.storeCharsAsNumbers) {
|
if (_dict.storeCharsAsNumbers) {
|
||||||
_sql.append(Integer.toString(((Character)o).charValue()));
|
_sql.append(Integer.toString((Character) o));
|
||||||
} else {
|
} else {
|
||||||
_sql.append("'" + o.toString().replace("'", "''") + "'");
|
_sql.append("'" + o.toString().replace("'", "''") + "'");
|
||||||
}
|
}
|
||||||
} else if (type == Boolean.class) {
|
} else if (type == Boolean.class) {
|
||||||
Boolean b = (Boolean) o;
|
Boolean b = (Boolean) o;
|
||||||
// We store B(b)ooleans as ints. Convert
|
// We store B(b)ooleans as ints. Convert
|
||||||
_sql.append(_dict.getBooleanRepresentation().getRepresentation(b.booleanValue()));
|
_sql.append(_dict.getBooleanRepresentation().getRepresentation(b));
|
||||||
} else {
|
} else {
|
||||||
_sql.append(o.toString());
|
_sql.append(o.toString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1206,7 +1206,7 @@ public class SelectImpl
|
||||||
boolean seld = sel && select(col, pj, false);
|
boolean seld = sel && select(col, pj, false);
|
||||||
if (asc != null) {
|
if (asc != null) {
|
||||||
String alias = (as != null) ? as : getColumnAlias(col, pj);
|
String alias = (as != null) ? as : getColumnAlias(col, pj);
|
||||||
appendOrdering(alias, asc.booleanValue());
|
appendOrdering(alias, asc);
|
||||||
}
|
}
|
||||||
return seld;
|
return seld;
|
||||||
}
|
}
|
||||||
|
@ -2170,13 +2170,13 @@ public class SelectImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i != null)
|
if (i != null)
|
||||||
return i.intValue();
|
return i;
|
||||||
|
|
||||||
// check out existing aliases
|
// check out existing aliases
|
||||||
i = findAlias(table, key);
|
i = findAlias(table, key);
|
||||||
|
|
||||||
if (i != null)
|
if (i != null)
|
||||||
return i.intValue();
|
return i;
|
||||||
if (!create)
|
if (!create)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -2187,7 +2187,7 @@ public class SelectImpl
|
||||||
// " created alias: "+
|
// " created alias: "+
|
||||||
// i.intValue()+ " "+ key);
|
// i.intValue()+ " "+ key);
|
||||||
recordTableAlias(table, key, i);
|
recordTableAlias(table, key, i);
|
||||||
return i.intValue();
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer findAliasForQuery(Table table, PathJoins pj, Object key,
|
private Integer findAliasForQuery(Table table, PathJoins pj, Object key,
|
||||||
|
@ -2249,7 +2249,7 @@ public class SelectImpl
|
||||||
// "Query created alias: "+
|
// "Query created alias: "+
|
||||||
// i.intValue()+ " "+ key);
|
// i.intValue()+ " "+ key);
|
||||||
recordTableAlias(table, key, i);
|
recordTableAlias(table, key, i);
|
||||||
return i.intValue();
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Integer findAlias(Table table, Object key) {
|
private Integer findAlias(Table table, Object key) {
|
||||||
|
@ -2278,7 +2278,7 @@ public class SelectImpl
|
||||||
_aliases.put(key, alias);
|
_aliases.put(key, alias);
|
||||||
|
|
||||||
String tableString = _dict.getFullName(table, false) + " "
|
String tableString = _dict.getFullName(table, false) + " "
|
||||||
+ toAlias(alias.intValue());
|
+ toAlias(alias);
|
||||||
if (_tables == null)
|
if (_tables == null)
|
||||||
_tables = new TreeMap();
|
_tables = new TreeMap();
|
||||||
_tables.put(alias, tableString);
|
_tables.put(alias, tableString);
|
||||||
|
@ -2644,7 +2644,7 @@ public class SelectImpl
|
||||||
if (pk == null)
|
if (pk == null)
|
||||||
pk = (obj instanceof Column && ((Column) obj).isPrimaryKey())
|
pk = (obj instanceof Column && ((Column) obj).isPrimaryKey())
|
||||||
? Boolean.TRUE : Boolean.FALSE;
|
? Boolean.TRUE : Boolean.FALSE;
|
||||||
if (pk.booleanValue()) {
|
if (pk) {
|
||||||
for (int i = _pos - 1; i >= 0 && i >= _pos - 3; i--)
|
for (int i = _pos - 1; i >= 0 && i >= _pos - 3; i--)
|
||||||
if (_sel._selects.get(i).equals(obj))
|
if (_sel._selects.get(i).equals(obj))
|
||||||
return i + 1;
|
return i + 1;
|
||||||
|
@ -3262,7 +3262,7 @@ public class SelectImpl
|
||||||
boolean found2 = false;
|
boolean found2 = false;
|
||||||
|
|
||||||
for (int i = 0; i < aliases.length; i++) {
|
for (int i = 0; i < aliases.length; i++) {
|
||||||
int alias = ((Integer)aliases[i]).intValue();
|
int alias = (Integer) aliases[i];
|
||||||
if (alias == j.getIndex1())
|
if (alias == j.getIndex1())
|
||||||
found1 = true;
|
found1 = true;
|
||||||
if (alias == j.getIndex2())
|
if (alias == j.getIndex2())
|
||||||
|
@ -3306,7 +3306,7 @@ public class SelectImpl
|
||||||
boolean found2 = false;
|
boolean found2 = false;
|
||||||
|
|
||||||
for (int i = 0; i < aliases.length; i++) {
|
for (int i = 0; i < aliases.length; i++) {
|
||||||
int alias = ((Integer)aliases[i]).intValue();
|
int alias = (Integer) aliases[i];
|
||||||
if (alias == join.getIndex1())
|
if (alias == join.getIndex1())
|
||||||
found1 = true;
|
found1 = true;
|
||||||
if (alias == join.getIndex2())
|
if (alias == join.getIndex2())
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class DataLoader {
|
||||||
|
|
||||||
public void populate(EntityManager em) throws Exception {
|
public void populate(EntityManager em) throws Exception {
|
||||||
Long count = em.createQuery("select count(m) from Movie m", Long.class).getSingleResult();
|
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");
|
System.err.println("Found " + count + " Movie records in the database");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -868,7 +868,7 @@ public class OpenJPAConfigurationImpl
|
||||||
@Override
|
@Override
|
||||||
public void setRefreshFromDataCache(Boolean flag) {
|
public void setRefreshFromDataCache(Boolean flag) {
|
||||||
if (flag != null) {
|
if (flag != null) {
|
||||||
refreshFromDataCache.set(flag.booleanValue());
|
refreshFromDataCache.set(flag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class RemoteCommitProviderValue
|
||||||
public void configureEventManager(RemoteCommitEventManager mgr) {
|
public void configureEventManager(RemoteCommitEventManager mgr) {
|
||||||
parseOptions();
|
parseOptions();
|
||||||
if (_transmitPersIds != null)
|
if (_transmitPersIds != null)
|
||||||
mgr.setTransmitPersistedObjectIds(_transmitPersIds.booleanValue());
|
mgr.setTransmitPersistedObjectIds(_transmitPersIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -120,7 +120,7 @@ public abstract class AbstractQueryCache
|
||||||
// Pre-load all the entity types into the HashMap to handle
|
// Pre-load all the entity types into the HashMap to handle
|
||||||
// synchronization on the map efficiently
|
// synchronization on the map efficiently
|
||||||
for (Object o : perTypes)
|
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();
|
Collection changedTypes = ev.getTypes();
|
||||||
HashMap<String,Long> changedClasses =
|
HashMap<String,Long> changedClasses =
|
||||||
new HashMap<>();
|
new HashMap<>();
|
||||||
Long tstamp = Long.valueOf(System.currentTimeMillis());
|
Long tstamp = System.currentTimeMillis();
|
||||||
for (Object o: changedTypes) {
|
for (Object o: changedTypes) {
|
||||||
String name = ((Class) o).getName();
|
String name = ((Class) o).getName();
|
||||||
if(!changedClasses.containsKey(name)) {
|
if(!changedClasses.containsKey(name)) {
|
||||||
|
|
|
@ -108,6 +108,6 @@ public class ClassRedefiner {
|
||||||
_canRedefine = Boolean.FALSE;
|
_canRedefine = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _canRedefine.booleanValue();
|
return _canRedefine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,7 +185,7 @@ public class PCClassFileTransformer
|
||||||
|
|
||||||
if (_names != null) {
|
if (_names != null) {
|
||||||
if (_names.contains(clsName.replace('/', '.')))
|
if (_names.contains(clsName.replace('/', '.')))
|
||||||
return Boolean.valueOf(!isEnhanced(bytes));
|
return !isEnhanced(bytes);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,35 +100,35 @@ public class ReflectingPersistenceCapable
|
||||||
switch (meta.getField(i).getDeclaredTypeCode()) {
|
switch (meta.getField(i).getDeclaredTypeCode()) {
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
sm.providedBooleanField(this, i, value == null ? false :
|
sm.providedBooleanField(this, i, value == null ? false :
|
||||||
((Boolean) value).booleanValue());
|
(Boolean) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
sm.providedByteField(this, i, value == null ? 0 :
|
sm.providedByteField(this, i, value == null ? 0 :
|
||||||
((Byte) value).byteValue());
|
(Byte) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
sm.providedCharField(this, i, value == null ? 0 :
|
sm.providedCharField(this, i, value == null ? 0 :
|
||||||
((Character) value).charValue());
|
(Character) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
sm.providedDoubleField(this, i, value == null ? 0 :
|
sm.providedDoubleField(this, i, value == null ? 0 :
|
||||||
((Double) value).doubleValue());
|
(Double) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
sm.providedFloatField(this, i, value == null ? 0 :
|
sm.providedFloatField(this, i, value == null ? 0 :
|
||||||
((Float) value).floatValue());
|
(Float) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
sm.providedIntField(this, i, value == null ? 0 :
|
sm.providedIntField(this, i, value == null ? 0 :
|
||||||
((Integer) value).intValue());
|
(Integer) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.LONG:
|
case JavaTypes.LONG:
|
||||||
sm.providedLongField(this, i, value == null ? 0 :
|
sm.providedLongField(this, i, value == null ? 0 :
|
||||||
((Long) value).longValue());
|
(Long) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
sm.providedShortField(this, i, value == null ? 0 :
|
sm.providedShortField(this, i, value == null ? 0 :
|
||||||
((Short) value).shortValue());
|
(Short) value);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
sm.providedStringField(this, i, (String) value);
|
sm.providedStringField(this, i, (String) value);
|
||||||
|
@ -149,29 +149,28 @@ public class ReflectingPersistenceCapable
|
||||||
public void pcReplaceField(int i) {
|
public void pcReplaceField(int i) {
|
||||||
switch(meta.getField(i).getDeclaredTypeCode()) {
|
switch(meta.getField(i).getDeclaredTypeCode()) {
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
setValue(i, o, Boolean.valueOf(
|
setValue(i, o, sm.replaceBooleanField(this, i));
|
||||||
sm.replaceBooleanField(this, i)));
|
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
setValue(i, o, Byte.valueOf(sm.replaceByteField(this, i)));
|
setValue(i, o, sm.replaceByteField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
setValue(i, o, Character.valueOf(sm.replaceCharField(this, i)));
|
setValue(i, o, sm.replaceCharField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
setValue(i, o, new Double(sm.replaceDoubleField(this, i)));
|
setValue(i, o, sm.replaceDoubleField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
setValue(i, o, new Float(sm.replaceFloatField(this, i)));
|
setValue(i, o, sm.replaceFloatField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
setValue(i, o, Integer.valueOf(sm.replaceIntField(this, i)));
|
setValue(i, o, sm.replaceIntField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.LONG:
|
case JavaTypes.LONG:
|
||||||
setValue(i, o, Long.valueOf(sm.replaceLongField(this, i)));
|
setValue(i, o, sm.replaceLongField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
setValue(i, o, Short.valueOf(sm.replaceShortField(this, i)));
|
setValue(i, o, sm.replaceShortField(this, i));
|
||||||
break;
|
break;
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
setValue(i, o, sm.replaceStringField(this, i));
|
setValue(i, o, sm.replaceStringField(this, i));
|
||||||
|
@ -273,7 +272,7 @@ public class ReflectingPersistenceCapable
|
||||||
@Override
|
@Override
|
||||||
public Boolean pcIsDetached() {
|
public Boolean pcIsDetached() {
|
||||||
if (sm != null)
|
if (sm != null)
|
||||||
return Boolean.valueOf(sm.isDetached());
|
return sm.isDetached();
|
||||||
|
|
||||||
// ##### we could do a lot more here if a detached state field
|
// ##### we could do a lot more here if a detached state field
|
||||||
// ##### was specified.
|
// ##### was specified.
|
||||||
|
|
|
@ -481,7 +481,7 @@ public class Reflection {
|
||||||
*/
|
*/
|
||||||
public static boolean getBoolean(Object target, Method getter) {
|
public static boolean getBoolean(Object target, Method getter) {
|
||||||
Object o = get(target, 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) {
|
public static char getChar(Object target, Method getter) {
|
||||||
Object o = get(target, getter);
|
Object o = get(target, getter);
|
||||||
return (o == null) ? (char) 0 : ((Character) o).charValue();
|
return (o == null) ? (char) 0 : (Character) o;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1757,8 +1757,7 @@ public class BrokerImpl implements Broker, FindCallbacks, Cloneable, Serializabl
|
||||||
&& (tranStatus != Status.STATUS_COMMITTED))
|
&& (tranStatus != Status.STATUS_COMMITTED))
|
||||||
_runtime.setRollbackOnly(cause);
|
_runtime.setRollbackOnly(cause);
|
||||||
else if (_log.isTraceEnabled())
|
else if (_log.isTraceEnabled())
|
||||||
_log.trace(_loc.get("invalid-tran-status", Integer.valueOf(
|
_log.trace(_loc.get("invalid-tran-status", tranStatus, "setRollbackOnly"));
|
||||||
tranStatus), "setRollbackOnly"));
|
|
||||||
} catch (OpenJPAException ke) {
|
} catch (OpenJPAException ke) {
|
||||||
throw ke;
|
throw ke;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -4784,7 +4783,7 @@ public class BrokerImpl implements Broker, FindCallbacks, Cloneable, Serializabl
|
||||||
return true;
|
return true;
|
||||||
Boolean detached = pc.pcIsDetached();
|
Boolean detached = pc.pcIsDetached();
|
||||||
if (detached != null)
|
if (detached != null)
|
||||||
return detached.booleanValue();
|
return detached;
|
||||||
|
|
||||||
if(!find){
|
if(!find){
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -362,19 +362,19 @@ public class DetachedValueStateManager
|
||||||
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
|
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
|
||||||
: Boolean.FALSE;
|
: Boolean.FALSE;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
return Byte.valueOf(fm.fetchByteField(field));
|
return fm.fetchByteField(field);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return Character.valueOf(fm.fetchCharField(field));
|
return fm.fetchCharField(field);
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
return Double.valueOf(fm.fetchDoubleField(field));
|
return fm.fetchDoubleField(field);
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
return Float.valueOf(fm.fetchFloatField(field));
|
return fm.fetchFloatField(field);
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
return fm.fetchIntField(field);
|
return fm.fetchIntField(field);
|
||||||
case JavaTypes.LONG:
|
case JavaTypes.LONG:
|
||||||
return fm.fetchLongField(field);
|
return fm.fetchLongField(field);
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
return Short.valueOf(fm.fetchShortField(field));
|
return fm.fetchShortField(field);
|
||||||
default:
|
default:
|
||||||
return fm.fetchObjectField(field);
|
return fm.fetchObjectField(field);
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,7 +448,7 @@ public class ExpressionStoreQuery
|
||||||
for(Entry<?, Class<?>> entry : paramTypes.entrySet()){
|
for(Entry<?, Class<?>> entry : paramTypes.entrySet()){
|
||||||
Object key = entry.getKey();
|
Object key = entry.getKey();
|
||||||
int idx = (key instanceof Integer)
|
int idx = (key instanceof Integer)
|
||||||
? ((Integer)key).intValue() - base
|
? (Integer) key - base
|
||||||
: paramTypes.indexOf(key);
|
: paramTypes.indexOf(key);
|
||||||
if (idx >= arr.length || idx < 0)
|
if (idx >= arr.length || idx < 0)
|
||||||
throw new UserException(_loc.get("gap-query-param",
|
throw new UserException(_loc.get("gap-query-param",
|
||||||
|
|
|
@ -331,7 +331,7 @@ public class FetchConfigurationImpl
|
||||||
&& flush != QueryFlushModes.FLUSH_FALSE
|
&& flush != QueryFlushModes.FLUSH_FALSE
|
||||||
&& flush != QueryFlushModes.FLUSH_WITH_CONNECTION)
|
&& flush != QueryFlushModes.FLUSH_WITH_CONNECTION)
|
||||||
throw new IllegalArgumentException(_loc.get(
|
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)
|
if (flush == DEFAULT && _state.ctx != null)
|
||||||
_state.flushQuery = _state.ctx.getConfiguration().
|
_state.flushQuery = _state.ctx.getConfiguration().
|
||||||
|
@ -681,7 +681,7 @@ public class FetchConfigurationImpl
|
||||||
&& scope != LockScopes.LOCKSCOPE_NORMAL
|
&& scope != LockScopes.LOCKSCOPE_NORMAL
|
||||||
&& scope != LockScopes.LOCKSCOPE_EXTENDED)
|
&& scope != LockScopes.LOCKSCOPE_EXTENDED)
|
||||||
throw new IllegalArgumentException(_loc.get(
|
throw new IllegalArgumentException(_loc.get(
|
||||||
"bad-lock-scope", Integer.valueOf(scope)).getMessage());
|
"bad-lock-scope", scope).getMessage());
|
||||||
if (scope == DEFAULT )
|
if (scope == DEFAULT )
|
||||||
_state.lockScope = LOCKSCOPE_NORMAL;
|
_state.lockScope = LOCKSCOPE_NORMAL;
|
||||||
else
|
else
|
||||||
|
@ -709,7 +709,7 @@ public class FetchConfigurationImpl
|
||||||
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
|
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
|
||||||
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
|
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
|
||||||
throw new IllegalArgumentException(_loc.get(
|
throw new IllegalArgumentException(_loc.get(
|
||||||
"bad-lock-level", Integer.valueOf(level)).getMessage());
|
"bad-lock-level", level).getMessage());
|
||||||
|
|
||||||
lock();
|
lock();
|
||||||
try {
|
try {
|
||||||
|
@ -746,7 +746,7 @@ public class FetchConfigurationImpl
|
||||||
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
|
&& level != MixedLockLevels.LOCK_PESSIMISTIC_WRITE
|
||||||
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
|
&& level != MixedLockLevels.LOCK_PESSIMISTIC_FORCE_INCREMENT)
|
||||||
throw new IllegalArgumentException(_loc.get(
|
throw new IllegalArgumentException(_loc.get(
|
||||||
"bad-lock-level", Integer.valueOf(level)).getMessage());
|
"bad-lock-level", level).getMessage());
|
||||||
|
|
||||||
lock();
|
lock();
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -309,7 +309,7 @@ public class Filters {
|
||||||
else if (type == Character.class) {
|
else if (type == Character.class) {
|
||||||
String str = o.toString();
|
String str = o.toString();
|
||||||
if (str != null && str.length() == 1) {
|
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) {
|
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)) {
|
if (type == Integer.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
|
||||||
return ((Number) o).intValue();
|
return ((Number) o).intValue();
|
||||||
} else if (type == Float.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
|
} 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) {
|
} 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)) {
|
} else if (type == Long.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
|
||||||
return ((Number) o).longValue();
|
return ((Number) o).longValue();
|
||||||
} else if (type == BigDecimal.class) {
|
} else if (type == BigDecimal.class) {
|
||||||
|
@ -410,20 +410,20 @@ public class Filters {
|
||||||
// and Float versions, despite wanting to cast it to BigDecimal
|
// and Float versions, despite wanting to cast it to BigDecimal
|
||||||
double dval = ((Number) o).doubleValue();
|
double dval = ((Number) o).doubleValue();
|
||||||
if (Double.isNaN(dval) || Double.isInfinite(dval)) {
|
if (Double.isNaN(dval) || Double.isInfinite(dval)) {
|
||||||
return Double.valueOf(dval);
|
return dval;
|
||||||
}
|
}
|
||||||
float fval = ((Number) o).floatValue();
|
float fval = ((Number) o).floatValue();
|
||||||
if (Float.isNaN(fval) || Float.isInfinite(fval)) {
|
if (Float.isNaN(fval) || Float.isInfinite(fval)) {
|
||||||
return Float.valueOf(fval);
|
return fval;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new BigDecimal(o.toString());
|
return new BigDecimal(o.toString());
|
||||||
} else if (type == BigInteger.class) {
|
} else if (type == BigInteger.class) {
|
||||||
return new BigInteger(o.toString());
|
return new BigInteger(o.toString());
|
||||||
} else if (type == Short.class && allowNumericConversion(o.getClass(), type, strictNumericConversion)) {
|
} 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)) {
|
} 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) {
|
} else if (type == Character.class) {
|
||||||
return (char) ((Number) o).intValue();
|
return (char) ((Number) o).intValue();
|
||||||
} else if (!strictNumericConversion) {
|
} else if (!strictNumericConversion) {
|
||||||
|
@ -576,7 +576,7 @@ public class Filters {
|
||||||
default:
|
default:
|
||||||
throw new InternalException();
|
throw new InternalException();
|
||||||
}
|
}
|
||||||
return Float.valueOf(tot);
|
return tot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -603,7 +603,7 @@ public class Filters {
|
||||||
default:
|
default:
|
||||||
throw new InternalException();
|
throw new InternalException();
|
||||||
}
|
}
|
||||||
return Double.valueOf(tot);
|
return tot;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1084,15 +1084,15 @@ public class Filters {
|
||||||
|
|
||||||
public static Object getDefaultForNull(Class<?> nType) {
|
public static Object getDefaultForNull(Class<?> nType) {
|
||||||
if (nType == Long.class)
|
if (nType == Long.class)
|
||||||
return Long.valueOf(0);
|
return 0L;
|
||||||
if (nType == Integer.class)
|
if (nType == Integer.class)
|
||||||
return Integer.valueOf(0);
|
return 0;
|
||||||
if (nType == Double.class)
|
if (nType == Double.class)
|
||||||
return Double.valueOf(0.0);
|
return 0.0;
|
||||||
if (nType == Float.class)
|
if (nType == Float.class)
|
||||||
return new Float(0.0);
|
return 0.0F;
|
||||||
if (nType == Short.class)
|
if (nType == Short.class)
|
||||||
return Short.valueOf((short)0);
|
return (short) 0;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -193,7 +193,7 @@ public class MethodStoreQuery
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
args[OBJ_INDEX] = obj;
|
args[OBJ_INDEX] = obj;
|
||||||
if (((Boolean) invoke(q, args)).booleanValue())
|
if ((Boolean) invoke(q, args))
|
||||||
results.add(obj);
|
results.add(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -284,7 +284,7 @@ public class MethodStoreQuery
|
||||||
int base = positionalParameterBase(userParams.keySet());
|
int base = positionalParameterBase(userParams.keySet());
|
||||||
for (Object key : paramTypes.keySet()) {
|
for (Object key : paramTypes.keySet()) {
|
||||||
int idx = (key instanceof Integer)
|
int idx = (key instanceof Integer)
|
||||||
? ((Integer)key).intValue() - base
|
? (Integer) key - base
|
||||||
: paramTypes.indexOf(key);
|
: paramTypes.indexOf(key);
|
||||||
if (idx >= arr.length || idx < 0)
|
if (idx >= arr.length || idx < 0)
|
||||||
throw new UserException(_loc.get("gap-query-param",
|
throw new UserException(_loc.get("gap-query-param",
|
||||||
|
|
|
@ -46,11 +46,11 @@ import org.apache.openjpa.util.ImplHelper;
|
||||||
public class ObjectIdStateManager
|
public class ObjectIdStateManager
|
||||||
implements OpenJPAStateManager {
|
implements OpenJPAStateManager {
|
||||||
|
|
||||||
private static final Byte ZERO_BYTE = Byte.valueOf((byte)0);
|
private static final Byte ZERO_BYTE = (byte) 0;
|
||||||
private static final Character ZERO_CHAR = Character.valueOf((char)0);
|
private static final Character ZERO_CHAR = (char) 0;
|
||||||
private static final Double ZERO_DOUBLE = Double.valueOf(0);
|
private static final Double ZERO_DOUBLE = (double) 0;
|
||||||
private static final Float ZERO_FLOAT = Float.valueOf(0);
|
private static final Float ZERO_FLOAT = (float) 0;
|
||||||
private static final Short ZERO_SHORT = Short.valueOf((short)0);
|
private static final Short ZERO_SHORT = (short) 0;
|
||||||
|
|
||||||
private Object _oid;
|
private Object _oid;
|
||||||
private final OpenJPAStateManager _owner;
|
private final OpenJPAStateManager _owner;
|
||||||
|
@ -429,7 +429,7 @@ public class ObjectIdStateManager
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
return Boolean.FALSE.equals(val);
|
return Boolean.FALSE.equals(val);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return ((Character) val).charValue() == 0;
|
return (Character) val == 0;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
|
@ -551,12 +551,12 @@ public class ObjectIdStateManager
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeByte(int field, byte extVal) {
|
public void storeByte(int field, byte extVal) {
|
||||||
setValue(field, Byte.valueOf(extVal), true);
|
setValue(field, extVal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeChar(int field, char extVal) {
|
public void storeChar(int field, char extVal) {
|
||||||
setValue(field, Character.valueOf(extVal), true);
|
setValue(field, extVal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -566,7 +566,7 @@ public class ObjectIdStateManager
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeShort(int field, short extVal) {
|
public void storeShort(int field, short extVal) {
|
||||||
setValue(field, Short.valueOf(extVal), true);
|
setValue(field, extVal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -576,12 +576,12 @@ public class ObjectIdStateManager
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeFloat(int field, float extVal) {
|
public void storeFloat(int field, float extVal) {
|
||||||
setValue(field, Float.valueOf(extVal), true);
|
setValue(field, extVal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeDouble(int field, double extVal) {
|
public void storeDouble(int field, double extVal) {
|
||||||
setValue(field, Double.valueOf(extVal), true);
|
setValue(field, extVal, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -661,7 +661,7 @@ public class ObjectIdStateManager
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean fetchBoolean(int field) {
|
public boolean fetchBoolean(int field) {
|
||||||
return ((Boolean) getValue(field)).booleanValue();
|
return (Boolean) getValue(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -671,7 +671,7 @@ public class ObjectIdStateManager
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char fetchChar(int field) {
|
public char fetchChar(int field) {
|
||||||
return ((Character) getValue(field)).charValue();
|
return (Character) getValue(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -480,7 +480,7 @@ public class QueryImpl implements Query {
|
||||||
try {
|
try {
|
||||||
assertOpen();
|
assertOpen();
|
||||||
if (_unique != null)
|
if (_unique != null)
|
||||||
return _unique.booleanValue();
|
return _unique;
|
||||||
if ((_query == null && _language.endsWith("JPQL")) || _compiling || _broker == null)
|
if ((_query == null && _language.endsWith("JPQL")) || _compiling || _broker == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -488,7 +488,7 @@ public class QueryImpl implements Query {
|
||||||
if (_compiled == null) {
|
if (_compiled == null) {
|
||||||
compileForCompilation();
|
compileForCompilation();
|
||||||
if (_unique != null)
|
if (_unique != null)
|
||||||
return _unique.booleanValue();
|
return _unique;
|
||||||
}
|
}
|
||||||
|
|
||||||
// no explicit setting; default
|
// no explicit setting; default
|
||||||
|
@ -1171,7 +1171,7 @@ public class QueryImpl implements Query {
|
||||||
switch (fmd.getDeclaredTypeCode()) {
|
switch (fmd.getDeclaredTypeCode()) {
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
sm.settingBooleanField(into, i, sm.fetchBooleanField(i),
|
sm.settingBooleanField(into, i, sm.fetchBooleanField(i),
|
||||||
val == null ? false : ((Boolean) val).booleanValue(),
|
val == null ? false : (Boolean) val,
|
||||||
set);
|
set);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
|
|
|
@ -908,19 +908,19 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
return (fetchBooleanField(field)) ? Boolean.TRUE
|
return (fetchBooleanField(field)) ? Boolean.TRUE
|
||||||
: Boolean.FALSE;
|
: Boolean.FALSE;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
return Byte.valueOf(fetchByteField(field));
|
return fetchByteField(field);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return Character.valueOf(fetchCharField(field));
|
return fetchCharField(field);
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
return Double.valueOf(fetchDoubleField(field));
|
return fetchDoubleField(field);
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
return Float.valueOf(fetchFloatField(field));
|
return fetchFloatField(field);
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
return fetchIntField(field);
|
return fetchIntField(field);
|
||||||
case JavaTypes.LONG:
|
case JavaTypes.LONG:
|
||||||
return fetchLongField(field);
|
return fetchLongField(field);
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
return Short.valueOf(fetchShortField(field));
|
return fetchShortField(field);
|
||||||
default:
|
default:
|
||||||
return fetchObjectField(field);
|
return fetchObjectField(field);
|
||||||
}
|
}
|
||||||
|
@ -1042,19 +1042,19 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
|
return (fm.fetchBooleanField(field)) ? Boolean.TRUE
|
||||||
: Boolean.FALSE;
|
: Boolean.FALSE;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
return Byte.valueOf(fm.fetchByteField(field));
|
return fm.fetchByteField(field);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
return Character.valueOf(fm.fetchCharField(field));
|
return fm.fetchCharField(field);
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
return Double.valueOf(fm.fetchDoubleField(field));
|
return fm.fetchDoubleField(field);
|
||||||
case JavaTypes.FLOAT:
|
case JavaTypes.FLOAT:
|
||||||
return Float.valueOf(fm.fetchFloatField(field));
|
return fm.fetchFloatField(field);
|
||||||
case JavaTypes.INT:
|
case JavaTypes.INT:
|
||||||
return fm.fetchIntField(field);
|
return fm.fetchIntField(field);
|
||||||
case JavaTypes.LONG:
|
case JavaTypes.LONG:
|
||||||
return fm.fetchLongField(field);
|
return fm.fetchLongField(field);
|
||||||
case JavaTypes.SHORT:
|
case JavaTypes.SHORT:
|
||||||
return Short.valueOf(fm.fetchShortField(field));
|
return fm.fetchShortField(field);
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
return fm.fetchStringField(field);
|
return fm.fetchStringField(field);
|
||||||
default:
|
default:
|
||||||
|
@ -1840,10 +1840,10 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (active) {
|
if (active) {
|
||||||
if (_broker.getOptimistic())
|
if (_broker.getOptimistic())
|
||||||
setPCState(_state.beforeOptimisticWrite(this, field,
|
setPCState(_state.beforeOptimisticWrite(this, field,
|
||||||
mutate.booleanValue()));
|
mutate));
|
||||||
else
|
else
|
||||||
setPCState(_state.beforeWrite(this, field,
|
setPCState(_state.beforeWrite(this, field,
|
||||||
mutate.booleanValue()));
|
mutate));
|
||||||
} else if (fmd.getManagement() == FieldMetaData.MANAGE_PERSISTENT) {
|
} else if (fmd.getManagement() == FieldMetaData.MANAGE_PERSISTENT) {
|
||||||
if (isPersistent() && !_broker.getNontransactionalWrite())
|
if (isPersistent() && !_broker.getNontransactionalWrite())
|
||||||
throw new InvalidStateException(_loc.get
|
throw new InvalidStateException(_loc.get
|
||||||
|
@ -1851,7 +1851,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
(getManagedInstance());
|
(getManagedInstance());
|
||||||
|
|
||||||
setPCState(_state.beforeNontransactionalWrite(this, field,
|
setPCState(_state.beforeNontransactionalWrite(this, field,
|
||||||
mutate.booleanValue()));
|
mutate));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((_flags & FLAG_FLUSHED) != 0) {
|
if ((_flags & FLAG_FLUSHED) != 0) {
|
||||||
|
@ -2398,7 +2398,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
return fetchBooleanField(field);
|
return fetchBooleanField(field);
|
||||||
|
|
||||||
Object val = fetchField(field, false);
|
Object val = fetchField(field, false);
|
||||||
return ((Boolean) fmd.getExternalValue(val, _broker)).booleanValue();
|
return (Boolean) fmd.getExternalValue(val, _broker);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2446,7 +2446,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
return fetchCharField(field);
|
return fetchCharField(field);
|
||||||
|
|
||||||
Object val = fetchField(field, false);
|
Object val = fetchField(field, false);
|
||||||
return ((Character) fmd.getExternalValue(val, _broker)).charValue();
|
return (Character) fmd.getExternalValue(val, _broker);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2661,7 +2661,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (!fmd.isExternalized())
|
if (!fmd.isExternalized())
|
||||||
storeByteField(field, externalVal);
|
storeByteField(field, externalVal);
|
||||||
else
|
else
|
||||||
storeField(field, fmd.getFieldValue(Byte.valueOf(externalVal),
|
storeField(field, fmd.getFieldValue(externalVal,
|
||||||
_broker));
|
_broker));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2684,7 +2684,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (!fmd.isExternalized())
|
if (!fmd.isExternalized())
|
||||||
storeCharField(field, externalVal);
|
storeCharField(field, externalVal);
|
||||||
else
|
else
|
||||||
storeField(field, fmd.getFieldValue(Character.valueOf(externalVal),
|
storeField(field, fmd.getFieldValue(externalVal,
|
||||||
_broker));
|
_broker));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2707,7 +2707,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (!fmd.isExternalized())
|
if (!fmd.isExternalized())
|
||||||
storeDoubleField(field, externalVal);
|
storeDoubleField(field, externalVal);
|
||||||
else
|
else
|
||||||
storeField(field, fmd.getFieldValue(Double.valueOf(externalVal), _broker));
|
storeField(field, fmd.getFieldValue(externalVal, _broker));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2729,7 +2729,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (!fmd.isExternalized())
|
if (!fmd.isExternalized())
|
||||||
storeFloatField(field, externalVal);
|
storeFloatField(field, externalVal);
|
||||||
else
|
else
|
||||||
storeField(field, fmd.getFieldValue(Float.valueOf(externalVal), _broker));
|
storeField(field, fmd.getFieldValue(externalVal, _broker));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -2821,7 +2821,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
if (!fmd.isExternalized())
|
if (!fmd.isExternalized())
|
||||||
storeShortField(field, externalVal);
|
storeShortField(field, externalVal);
|
||||||
else
|
else
|
||||||
storeField(field, fmd.getFieldValue(Short.valueOf(externalVal),
|
storeField(field, fmd.getFieldValue(externalVal,
|
||||||
_broker));
|
_broker));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2872,7 +2872,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
|
|
||||||
switch (fmd.getDeclaredTypeCode()) {
|
switch (fmd.getDeclaredTypeCode()) {
|
||||||
case JavaTypes.BOOLEAN:
|
case JavaTypes.BOOLEAN:
|
||||||
boolean bool = val != null && ((Boolean) val).booleanValue();
|
boolean bool = val != null && (Boolean) val;
|
||||||
fm.storeBooleanField(field, bool);
|
fm.storeBooleanField(field, bool);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.BYTE:
|
case JavaTypes.BYTE:
|
||||||
|
@ -2880,7 +2880,7 @@ public class StateManagerImpl implements OpenJPAStateManager, Serializable {
|
||||||
fm.storeByteField(field, b);
|
fm.storeByteField(field, b);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
char c = (val == null) ? 0 : ((Character) val).charValue();
|
char c = (val == null) ? 0 : (Character) val;
|
||||||
fm.storeCharField(field, c);
|
fm.storeCharField(field, c);
|
||||||
break;
|
break;
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
|
|
|
@ -58,9 +58,9 @@ class Abs
|
||||||
if (c == Integer.class)
|
if (c == Integer.class)
|
||||||
return Math.abs(((Number) o).intValue());
|
return Math.abs(((Number) o).intValue());
|
||||||
if (c == Float.class)
|
if (c == Float.class)
|
||||||
return Float.valueOf(Math.abs(((Number) o).floatValue()));
|
return Math.abs(((Number) o).floatValue());
|
||||||
if (c == Double.class)
|
if (c == Double.class)
|
||||||
return Double.valueOf(Math.abs(((Number) o).doubleValue()));
|
return Math.abs(((Number) o).doubleValue());
|
||||||
if (c == Long.class)
|
if (c == Long.class)
|
||||||
return Math.abs(((Number) o).longValue());
|
return Math.abs(((Number) o).longValue());
|
||||||
if (c == BigDecimal.class)
|
if (c == BigDecimal.class)
|
||||||
|
|
|
@ -817,8 +817,8 @@ public class InMemoryExpressionFactory
|
||||||
return (_asc) ? -1 : 1;
|
return (_asc) ? -1 : 1;
|
||||||
|
|
||||||
if (o1 instanceof Boolean && o2 instanceof Boolean) {
|
if (o1 instanceof Boolean && o2 instanceof Boolean) {
|
||||||
int i1 = ((Boolean) o1).booleanValue() ? 1 : 0;
|
int i1 = (Boolean) o1 ? 1 : 0;
|
||||||
int i2 = ((Boolean) o2).booleanValue() ? 1 : 0;
|
int i2 = (Boolean) o2 ? 1 : 0;
|
||||||
return i1 - i2;
|
return i1 - i2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class QueryExpressions implements Serializable {
|
||||||
if (_aggregate == null)
|
if (_aggregate == null)
|
||||||
_aggregate = (AggregateExpressionVisitor.isAggregate(projections))
|
_aggregate = (AggregateExpressionVisitor.isAggregate(projections))
|
||||||
? Boolean.TRUE : Boolean.FALSE;
|
? Boolean.TRUE : Boolean.FALSE;
|
||||||
return _aggregate.booleanValue();
|
return _aggregate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDistinct() {
|
public boolean isDistinct() {
|
||||||
|
|
|
@ -43,6 +43,6 @@ class Sqrt
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Object operate(Object o, Class c) {
|
protected Object operate(Object o, Class c) {
|
||||||
return Double.valueOf(Math.sqrt(((Number) o).doubleValue()));
|
return Math.sqrt(((Number) o).doubleValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ class ValExpression
|
||||||
protected boolean eval(Object candidate, Object orig,
|
protected boolean eval(Object candidate, Object orig,
|
||||||
StoreContext ctx, Object[] params) {
|
StoreContext ctx, Object[] params) {
|
||||||
Object o = _val.eval(candidate, orig, ctx, params);
|
Object o = _val.eval(candidate, orig, ctx, params);
|
||||||
return o != null && ((Boolean) o).booleanValue();
|
return o != null && (Boolean) o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -53,7 +53,7 @@ class ValExpression
|
||||||
Object[] params) {
|
Object[] params) {
|
||||||
Collection c = _val.eval(candidates, null, ctx, params);
|
Collection c = _val.eval(candidates, null, ctx, params);
|
||||||
Object o = (c == null || c.isEmpty()) ? null : c.iterator().next();
|
Object o = (c == null || c.isEmpty()) ? null : c.iterator().next();
|
||||||
return o != null && ((Boolean) o).booleanValue();
|
return o != null && (Boolean) o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1035,7 +1035,7 @@ public class JPQLExpressionBuilder
|
||||||
? node.text.substring(0, node.text.length() - 1)
|
? node.text.substring(0, node.text.length() - 1)
|
||||||
: node.text).
|
: node.text).
|
||||||
multiply(new BigDecimal(negative(node)));
|
multiply(new BigDecimal(negative(node)));
|
||||||
return factory.newLiteral(Long.valueOf(intlit.longValue()),
|
return factory.newLiteral(intlit.longValue(),
|
||||||
Literal.TYPE_NUMBER);
|
Literal.TYPE_NUMBER);
|
||||||
|
|
||||||
case JJTDECIMALLITERAL:
|
case JJTDECIMALLITERAL:
|
||||||
|
@ -1322,7 +1322,7 @@ public class JPQLExpressionBuilder
|
||||||
case JJTCONCAT:
|
case JJTCONCAT:
|
||||||
if (node.children.length < 2)
|
if (node.children.length < 2)
|
||||||
throw parseException(EX_USER, "less-child-count",
|
throw parseException(EX_USER, "less-child-count",
|
||||||
new Object[]{ Integer.valueOf(2), node,
|
new Object[]{2, node,
|
||||||
Arrays.asList(node.children) }, null);
|
Arrays.asList(node.children) }, null);
|
||||||
|
|
||||||
val1 = getValue(firstChild(node));
|
val1 = getValue(firstChild(node));
|
||||||
|
@ -1485,7 +1485,7 @@ public class JPQLExpressionBuilder
|
||||||
? node.text.substring(0, node.text.length() - 1)
|
? node.text.substring(0, node.text.length() - 1)
|
||||||
: node.text).
|
: node.text).
|
||||||
multiply(new BigDecimal(negative(node)));
|
multiply(new BigDecimal(negative(node)));
|
||||||
return factory.newLiteral(Integer.valueOf(bigdec.intValue()),
|
return factory.newLiteral(bigdec.intValue(),
|
||||||
Literal.TYPE_NUMBER);
|
Literal.TYPE_NUMBER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2209,7 +2209,7 @@ public class JPQLExpressionBuilder
|
||||||
private JPQLNode child(JPQLNode node, int childNum, int assertCount) {
|
private JPQLNode child(JPQLNode node, int childNum, int assertCount) {
|
||||||
if (node.children.length != assertCount)
|
if (node.children.length != assertCount)
|
||||||
throw parseException(EX_USER, "wrong-child-count",
|
throw parseException(EX_USER, "wrong-child-count",
|
||||||
new Object[]{ Integer.valueOf(assertCount), node,
|
new Object[]{assertCount, node,
|
||||||
Arrays.asList(node.children) }, null);
|
Arrays.asList(node.children) }, null);
|
||||||
|
|
||||||
return node.children[childNum];
|
return node.children[childNum];
|
||||||
|
|
|
@ -108,8 +108,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
File file;
|
File file;
|
||||||
for (int i = 0; i < strs.length; i++) {
|
for (int i = 0; i < strs.length; i++) {
|
||||||
file = new File(strs[i]);
|
file = new File(strs[i]);
|
||||||
if ((AccessController.doPrivileged(
|
if (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue())
|
J2DoPrivHelper.existsAction(file)))
|
||||||
this.files.add(file);
|
this.files.add(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -377,8 +377,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
for (int i = 0; i < metas.length; i++) {
|
for (int i = 0; i < metas.length; i++) {
|
||||||
if (getSourceFile(metas[i]) == null)
|
if (getSourceFile(metas[i]) == null)
|
||||||
setSourceFile(metas[i], defaultSourceFile(metas[i]));
|
setSourceFile(metas[i], defaultSourceFile(metas[i]));
|
||||||
if ((AccessController.doPrivileged(J2DoPrivHelper
|
if (AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.existsAction(getSourceFile(metas[i])))).booleanValue()) {
|
.existsAction(getSourceFile(metas[i])))) {
|
||||||
if (files == null)
|
if (files == null)
|
||||||
files = new HashSet();
|
files = new HashSet();
|
||||||
files.add(getSourceFile(metas[i]));
|
files.add(getSourceFile(metas[i]));
|
||||||
|
@ -393,9 +393,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
|
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
|
||||||
defaultFile == null ? "" : defaultFile.getPath());
|
defaultFile == null ? "" : defaultFile.getPath());
|
||||||
}
|
}
|
||||||
if ((AccessController.doPrivileged(
|
if (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
|
J2DoPrivHelper.existsAction(queries[i].getSourceFile()))) {
|
||||||
.booleanValue()) {
|
|
||||||
if (files == null)
|
if (files == null)
|
||||||
files = new HashSet();
|
files = new HashSet();
|
||||||
files.add(queries[i].getSourceFile());
|
files.add(queries[i].getSourceFile());
|
||||||
|
@ -406,9 +405,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
if (getSourceFile(seqs[i]) == null)
|
if (getSourceFile(seqs[i]) == null)
|
||||||
setSourceFile(seqs[i], defaultSourceFile(seqs[i],
|
setSourceFile(seqs[i], defaultSourceFile(seqs[i],
|
||||||
clsNames));
|
clsNames));
|
||||||
if ((AccessController.doPrivileged(
|
if (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(getSourceFile(seqs[i]))))
|
J2DoPrivHelper.existsAction(getSourceFile(seqs[i])))) {
|
||||||
.booleanValue()) {
|
|
||||||
if (files == null)
|
if (files == null)
|
||||||
files = new HashSet();
|
files = new HashSet();
|
||||||
files.add(getSourceFile(seqs[i]));
|
files.add(getSourceFile(seqs[i]));
|
||||||
|
@ -436,9 +434,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
|
queries[i].setSource(defaultFile, queries[i].getSourceScope(), queries[i].getSourceType(),
|
||||||
defaultFile == null ? "" : defaultFile.getPath());
|
defaultFile == null ? "" : defaultFile.getPath());
|
||||||
}
|
}
|
||||||
if ((AccessController.doPrivileged(
|
if (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(queries[i].getSourceFile())))
|
J2DoPrivHelper.existsAction(queries[i].getSourceFile()))) {
|
||||||
.booleanValue()) {
|
|
||||||
if (files == null)
|
if (files == null)
|
||||||
files = new HashSet();
|
files = new HashSet();
|
||||||
files.add(queries[i].getSourceFile());
|
files.add(queries[i].getSourceFile());
|
||||||
|
@ -650,8 +647,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
File file;
|
File file;
|
||||||
for (Iterator itr = files.iterator(); itr.hasNext();) {
|
for (Iterator itr = files.iterator(); itr.hasNext();) {
|
||||||
file = (File) itr.next();
|
file = (File) itr.next();
|
||||||
if ((AccessController.doPrivileged(J2DoPrivHelper
|
if (AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isDirectoryAction(file))).booleanValue()) {
|
.isDirectoryAction(file))) {
|
||||||
if (log.isTraceEnabled())
|
if (log.isTraceEnabled())
|
||||||
log.trace(_loc.get("scanning-directory", file));
|
log.trace(_loc.get("scanning-directory", file));
|
||||||
scan(new FileMetaDataIterator(file, newMetaDataFilter()),
|
scan(new FileMetaDataIterator(file, newMetaDataFilter()),
|
||||||
|
@ -699,9 +696,8 @@ public abstract class AbstractCFMetaDataFactory
|
||||||
.getAbsoluteFileAction(new File(url.getFile())));
|
.getAbsoluteFileAction(new File(url.getFile())));
|
||||||
if (files != null && files.contains(file)) {
|
if (files != null && files.contains(file)) {
|
||||||
continue;
|
continue;
|
||||||
} else if ((AccessController
|
} else if (AccessController
|
||||||
.doPrivileged(J2DoPrivHelper.isDirectoryAction(file)))
|
.doPrivileged(J2DoPrivHelper.isDirectoryAction(file))) {
|
||||||
.booleanValue()) {
|
|
||||||
if (log.isTraceEnabled())
|
if (log.isTraceEnabled())
|
||||||
log.trace(_loc.get("scanning-directory", file));
|
log.trace(_loc.get("scanning-directory", file));
|
||||||
scan(
|
scan(
|
||||||
|
|
|
@ -595,7 +595,7 @@ public class ClassMetaData
|
||||||
*/
|
*/
|
||||||
public boolean isObjectIdTypeShared() {
|
public boolean isObjectIdTypeShared() {
|
||||||
if (_objectIdShared != null)
|
if (_objectIdShared != null)
|
||||||
return _objectIdShared.booleanValue();
|
return _objectIdShared;
|
||||||
if (_super != null)
|
if (_super != null)
|
||||||
return getPCSuperclassMetaData().isObjectIdTypeShared();
|
return getPCSuperclassMetaData().isObjectIdTypeShared();
|
||||||
return isOpenJPAIdentity();
|
return isOpenJPAIdentity();
|
||||||
|
@ -612,7 +612,7 @@ public class ClassMetaData
|
||||||
_openjpaId = (OpenJPAId.class.isAssignableFrom(cls)) ? Boolean.TRUE
|
_openjpaId = (OpenJPAId.class.isAssignableFrom(cls)) ? Boolean.TRUE
|
||||||
: Boolean.FALSE;
|
: Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _openjpaId.booleanValue();
|
return _openjpaId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -769,7 +769,7 @@ public class ClassMetaData
|
||||||
else
|
else
|
||||||
_extent = Boolean.TRUE;
|
_extent = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
return _extent.booleanValue();
|
return _extent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -791,7 +791,7 @@ public class ClassMetaData
|
||||||
else
|
else
|
||||||
_embedded = Boolean.FALSE;
|
_embedded = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _embedded.booleanValue();
|
return _embedded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -831,7 +831,7 @@ public class ClassMetaData
|
||||||
public boolean isManagedInterface() {
|
public boolean isManagedInterface() {
|
||||||
if (!_type.isInterface())
|
if (!_type.isInterface())
|
||||||
return false;
|
return false;
|
||||||
return _interface == null ? false : _interface.booleanValue();
|
return _interface == null ? false : _interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1584,7 +1584,7 @@ public class ClassMetaData
|
||||||
else
|
else
|
||||||
_detachable = Boolean.FALSE;
|
_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() {
|
public boolean hasAbstractPKField() {
|
||||||
if (_hasAbstractPKField != null) {
|
if (_hasAbstractPKField != null) {
|
||||||
return _hasAbstractPKField.booleanValue();
|
return _hasAbstractPKField;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to false, set to true only if this type is abstract and
|
// Default to false, set to true only if this type is abstract and
|
||||||
|
@ -2725,7 +2725,7 @@ public class ClassMetaData
|
||||||
}
|
}
|
||||||
_hasAbstractPKField = temp;
|
_hasAbstractPKField = temp;
|
||||||
|
|
||||||
return _hasAbstractPKField.booleanValue();
|
return _hasAbstractPKField;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2740,7 +2740,7 @@ public class ClassMetaData
|
||||||
*/
|
*/
|
||||||
public boolean hasPKFieldsFromAbstractClass() {
|
public boolean hasPKFieldsFromAbstractClass() {
|
||||||
if (_hasPKFieldsFromAbstractClass != null) {
|
if (_hasPKFieldsFromAbstractClass != null) {
|
||||||
return _hasPKFieldsFromAbstractClass.booleanValue();
|
return _hasPKFieldsFromAbstractClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default to FALSE, until proven true.
|
// Default to FALSE, until proven true.
|
||||||
|
@ -2766,7 +2766,7 @@ public class ClassMetaData
|
||||||
}
|
}
|
||||||
_hasPKFieldsFromAbstractClass = temp;
|
_hasPKFieldsFromAbstractClass = temp;
|
||||||
|
|
||||||
return _hasPKFieldsFromAbstractClass.booleanValue();
|
return _hasPKFieldsFromAbstractClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2804,7 +2804,7 @@ public class ClassMetaData
|
||||||
int idsSize = ids.size();
|
int idsSize = ids.size();
|
||||||
int[] temp = new int[idsSize];
|
int[] temp = new int[idsSize];
|
||||||
for (int i = 0; i < idsSize; i++) {
|
for (int i = 0; i < idsSize; i++) {
|
||||||
temp[i] = ids.get(i).intValue();
|
temp[i] = ids.get(i);
|
||||||
}
|
}
|
||||||
_pkAndNonPersistentManagedFmdIndexes = temp;
|
_pkAndNonPersistentManagedFmdIndexes = temp;
|
||||||
}
|
}
|
||||||
|
@ -2822,7 +2822,7 @@ public class ClassMetaData
|
||||||
}
|
}
|
||||||
inverseManagedFields = res;
|
inverseManagedFields = res;
|
||||||
}
|
}
|
||||||
return inverseManagedFields.booleanValue();
|
return inverseManagedFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<FieldMetaData> getMappyedByIdFields() {
|
public List<FieldMetaData> getMappyedByIdFields() {
|
||||||
|
|
|
@ -220,7 +220,7 @@ public abstract class Extensions
|
||||||
*/
|
*/
|
||||||
public boolean getBooleanExtension(String vendor, String key) {
|
public boolean getBooleanExtension(String vendor, String key) {
|
||||||
String str = getStringExtension(vendor, key);
|
String str = getStringExtension(vendor, key);
|
||||||
return (str == null) ? false : Boolean.valueOf(str).booleanValue();
|
return (str == null) ? false : Boolean.valueOf(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -317,7 +317,7 @@ public class FetchGroup
|
||||||
*/
|
*/
|
||||||
public boolean isPostLoad () {
|
public boolean isPostLoad () {
|
||||||
if (_postLoad != null)
|
if (_postLoad != null)
|
||||||
return _postLoad.booleanValue();
|
return _postLoad;
|
||||||
|
|
||||||
if (_meta != null) {
|
if (_meta != null) {
|
||||||
ClassMetaData sup = _meta.getPCSuperclassMetaData();
|
ClassMetaData sup = _meta.getPCSuperclassMetaData();
|
||||||
|
|
|
@ -659,7 +659,7 @@ public class FieldMetaData
|
||||||
_enumField = Enum.class.isAssignableFrom(decl)
|
_enumField = Enum.class.isAssignableFrom(decl)
|
||||||
? Boolean.TRUE : Boolean.FALSE;
|
? Boolean.TRUE : Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _enumField.booleanValue();
|
return _enumField;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSerializable() {
|
private boolean isSerializable() {
|
||||||
|
@ -670,7 +670,7 @@ public class FieldMetaData
|
||||||
else
|
else
|
||||||
_serializableField = Boolean.FALSE;
|
_serializableField = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _serializableField.booleanValue();
|
return _serializableField;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isLobArray() {
|
private boolean isLobArray() {
|
||||||
|
@ -683,7 +683,7 @@ public class FieldMetaData
|
||||||
else
|
else
|
||||||
_lobField = Boolean.FALSE;
|
_lobField = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
return _lobField.booleanValue();
|
return _lobField;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1537,7 +1537,7 @@ public class FieldMetaData
|
||||||
return Float.valueOf(val);
|
return Float.valueOf(val);
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
case JavaTypes.CHAR_OBJ:
|
case JavaTypes.CHAR_OBJ:
|
||||||
return Character.valueOf(val.charAt(0));
|
return val.charAt(0);
|
||||||
case JavaTypes.STRING:
|
case JavaTypes.STRING:
|
||||||
return val;
|
return val;
|
||||||
case JavaTypes.ENUM:
|
case JavaTypes.ENUM:
|
||||||
|
@ -2467,7 +2467,7 @@ public class FieldMetaData
|
||||||
|
|
||||||
public boolean isDelayCapable() {
|
public boolean isDelayCapable() {
|
||||||
if (_delayCapable != null) {
|
if (_delayCapable != null) {
|
||||||
return _delayCapable.booleanValue();
|
return _delayCapable;
|
||||||
}
|
}
|
||||||
if (getTypeCode() != JavaTypes.COLLECTION || isLRS()) {
|
if (getTypeCode() != JavaTypes.COLLECTION || isLRS()) {
|
||||||
_delayCapable = Boolean.FALSE;
|
_delayCapable = Boolean.FALSE;
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class JavaTypes {
|
||||||
|
|
||||||
Integer code = _typeCodes.get(type);
|
Integer code = _typeCodes.get(type);
|
||||||
if (code != null) {
|
if (code != null) {
|
||||||
return code.intValue();
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
// have to do this first to catch custom collection and map types;
|
// have to do this first to catch custom collection and map types;
|
||||||
|
@ -342,7 +342,7 @@ public class JavaTypes {
|
||||||
if (val instanceof Byte)
|
if (val instanceof Byte)
|
||||||
return val;
|
return val;
|
||||||
if (val instanceof Number)
|
if (val instanceof Number)
|
||||||
return Byte.valueOf(((Number) val).byteValue());
|
return ((Number) val).byteValue();
|
||||||
// no break
|
// no break
|
||||||
case BYTE:
|
case BYTE:
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
|
@ -353,9 +353,9 @@ public class JavaTypes {
|
||||||
if (val instanceof Character)
|
if (val instanceof Character)
|
||||||
return val;
|
return val;
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
return Character.valueOf(val.toString().charAt(0));
|
return val.toString().charAt(0);
|
||||||
if (val instanceof Number)
|
if (val instanceof Number)
|
||||||
return Character.valueOf((char) ((Number) val).intValue());
|
return (char) ((Number) val).intValue();
|
||||||
return val;
|
return val;
|
||||||
case DATE:
|
case DATE:
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
|
@ -365,7 +365,7 @@ public class JavaTypes {
|
||||||
if (val instanceof Double)
|
if (val instanceof Double)
|
||||||
return val;
|
return val;
|
||||||
if (val instanceof Number)
|
if (val instanceof Number)
|
||||||
return Double.valueOf(((Number) val).doubleValue());
|
return ((Number) val).doubleValue();
|
||||||
// no break
|
// no break
|
||||||
case DOUBLE:
|
case DOUBLE:
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
|
@ -375,7 +375,7 @@ public class JavaTypes {
|
||||||
if (val instanceof Float)
|
if (val instanceof Float)
|
||||||
return val;
|
return val;
|
||||||
if (val instanceof Number)
|
if (val instanceof Number)
|
||||||
return Float.valueOf(((Number) val).floatValue());
|
return ((Number) val).floatValue();
|
||||||
// no break
|
// no break
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
|
@ -411,7 +411,7 @@ public class JavaTypes {
|
||||||
if (val instanceof Short)
|
if (val instanceof Short)
|
||||||
return val;
|
return val;
|
||||||
if (val instanceof Number)
|
if (val instanceof Number)
|
||||||
return Short.valueOf(((Number) val).shortValue());
|
return ((Number) val).shortValue();
|
||||||
// no break
|
// no break
|
||||||
case SHORT:
|
case SHORT:
|
||||||
if (val instanceof String)
|
if (val instanceof String)
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class QueryMetaData
|
||||||
* Whether the query has been marked read-only.
|
* Whether the query has been marked read-only.
|
||||||
*/
|
*/
|
||||||
public boolean isReadOnly() {
|
public boolean isReadOnly() {
|
||||||
return _readOnly != null && _readOnly.booleanValue();
|
return _readOnly != null && _readOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -217,7 +217,7 @@ public class QueryMetaData
|
||||||
if (_res != null)
|
if (_res != null)
|
||||||
query.setResultType(_res);
|
query.setResultType(_res);
|
||||||
if (_readOnly != null)
|
if (_readOnly != null)
|
||||||
query.setReadOnly(_readOnly.booleanValue());
|
query.setReadOnly(_readOnly);
|
||||||
if (_resultSetMappingName != null)
|
if (_resultSetMappingName != null)
|
||||||
query.setResultMapping(null, _resultSetMappingName);
|
query.setResultMapping(null, _resultSetMappingName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ public class ValueMetaDataImpl
|
||||||
_embedded = Boolean.TRUE;
|
_embedded = Boolean.TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _embedded.booleanValue();
|
return _embedded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -213,9 +213,9 @@ public abstract class AbstractChangeTracker
|
||||||
else
|
else
|
||||||
_identity = Boolean.FALSE;
|
_identity = Boolean.FALSE;
|
||||||
|
|
||||||
add = switchStructure(add, _identity.booleanValue());
|
add = switchStructure(add, _identity);
|
||||||
rem = switchStructure(rem, _identity.booleanValue());
|
rem = switchStructure(rem, _identity);
|
||||||
change = switchStructure(change, _identity.booleanValue());
|
change = switchStructure(change, _identity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -152,7 +152,7 @@ public class ApplicationIds {
|
||||||
case JavaTypes.CHAR:
|
case JavaTypes.CHAR:
|
||||||
case JavaTypes.CHAR_OBJ:
|
case JavaTypes.CHAR_OBJ:
|
||||||
return new CharId(meta.getDescribedType(),
|
return new CharId(meta.getDescribedType(),
|
||||||
val == null ? 0 : ((Character) val).charValue());
|
val == null ? 0 : (Character) val);
|
||||||
case JavaTypes.DOUBLE:
|
case JavaTypes.DOUBLE:
|
||||||
case JavaTypes.DOUBLE_OBJ:
|
case JavaTypes.DOUBLE_OBJ:
|
||||||
if (!convert && !(val instanceof Double))
|
if (!convert && !(val instanceof Double))
|
||||||
|
@ -611,17 +611,17 @@ public class ApplicationIds {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeByteField(int field, byte val) {
|
public void storeByteField(int field, byte val) {
|
||||||
store(Byte.valueOf(val));
|
store(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeCharField(int field, char val) {
|
public void storeCharField(int field, char val) {
|
||||||
store(Character.valueOf(val));
|
store(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeShortField(int field, short val) {
|
public void storeShortField(int field, short val) {
|
||||||
store(Short.valueOf(val));
|
store(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -636,12 +636,12 @@ public class ApplicationIds {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeFloatField(int field, float val) {
|
public void storeFloatField(int field, float val) {
|
||||||
store(Float.valueOf(val));
|
store(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void storeDoubleField(int field, double val) {
|
public void storeDoubleField(int field, double val) {
|
||||||
store(Double.valueOf(val));
|
store(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -661,7 +661,7 @@ public class ApplicationIds {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public char fetchCharField(int field) {
|
public char fetchCharField(int field) {
|
||||||
return ((Character) retrieve(field)).charValue();
|
return (Character) retrieve(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class BooleanId extends OpenJPAId {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Boolean.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,7 +30,7 @@ public final class ByteId extends OpenJPAId {
|
||||||
private final byte key;
|
private final byte key;
|
||||||
|
|
||||||
public ByteId(Class cls, 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) {
|
public ByteId(Class cls, String key) {
|
||||||
|
@ -53,7 +53,7 @@ public final class ByteId extends OpenJPAId {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Byte.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -30,7 +30,7 @@ public final class CharId extends OpenJPAId {
|
||||||
private final char key;
|
private final char key;
|
||||||
|
|
||||||
public CharId(Class cls, Character 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) {
|
public CharId(Class cls, String key) {
|
||||||
|
@ -53,7 +53,7 @@ public final class CharId extends OpenJPAId {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Character.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,7 +31,7 @@ public final class DoubleId
|
||||||
private final double key;
|
private final double key;
|
||||||
|
|
||||||
public DoubleId(Class cls, 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) {
|
public DoubleId(Class cls, String key) {
|
||||||
|
@ -54,7 +54,7 @@ public final class DoubleId
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Double.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -31,7 +31,7 @@ public final class FloatId
|
||||||
private final float key;
|
private final float key;
|
||||||
|
|
||||||
public FloatId(Class cls, 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) {
|
public FloatId(Class cls, String key) {
|
||||||
|
@ -54,7 +54,7 @@ public final class FloatId
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Float.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ public final class Id
|
||||||
* Construct from key value.
|
* Construct from key value.
|
||||||
*/
|
*/
|
||||||
public Id(Class cls, Long key) {
|
public Id(Class cls, Long key) {
|
||||||
this(cls, (key == null) ? 0L : key.longValue());
|
this(cls, (key == null) ? 0L : key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -262,11 +262,11 @@ public class ImplHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAssignable == null) {// we don't have a record of this pair...
|
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);
|
assignableTo.put(to, isAssignable);
|
||||||
}
|
}
|
||||||
|
|
||||||
return isAssignable.booleanValue();
|
return isAssignable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,7 +31,7 @@ public final class IntId extends OpenJPAId {
|
||||||
private final int key;
|
private final int key;
|
||||||
|
|
||||||
public IntId(Class cls, Integer 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) {
|
public IntId(Class cls, String key) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ public final class LongId extends OpenJPAId {
|
||||||
private final long key;
|
private final long key;
|
||||||
|
|
||||||
public LongId(Class cls, 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) {
|
public LongId(Class cls, String key) {
|
||||||
|
|
|
@ -119,9 +119,9 @@ public abstract class OpenJPAId
|
||||||
superclass = base.getSuperclass();
|
superclass = base.getSuperclass();
|
||||||
}
|
}
|
||||||
_typeHash = base.getName().hashCode();
|
_typeHash = base.getName().hashCode();
|
||||||
_typeCache.put(type, Integer.valueOf(_typeHash));
|
_typeCache.put(type, _typeHash);
|
||||||
} else {
|
} else {
|
||||||
_typeHash = typeHashInt.intValue();
|
_typeHash = typeHashInt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return _typeHash ^ idHash();
|
return _typeHash ^ idHash();
|
||||||
|
|
|
@ -30,7 +30,7 @@ public final class ShortId extends OpenJPAId {
|
||||||
private final short key;
|
private final short key;
|
||||||
|
|
||||||
public ShortId(Class cls, 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) {
|
public ShortId(Class cls, String key) {
|
||||||
|
@ -53,7 +53,7 @@ public final class ShortId extends OpenJPAId {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getIdObject() {
|
public Object getIdObject() {
|
||||||
return Short.valueOf(key);
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -85,11 +85,11 @@ public class TestProxyManager {
|
||||||
* Populate the given list with arbitrary data.
|
* Populate the given list with arbitrary data.
|
||||||
*/
|
*/
|
||||||
private static void populate(Collection coll) {
|
private static void populate(Collection coll) {
|
||||||
coll.add(new Integer(1));
|
coll.add(1);
|
||||||
coll.add("foo");
|
coll.add("foo");
|
||||||
coll.add(new Long(99));
|
coll.add(99L);
|
||||||
coll.add("bar");
|
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.
|
* Populate the given sorted set with arbitrary data.
|
||||||
*/
|
*/
|
||||||
private static void populate(SortedSet coll) {
|
private static void populate(SortedSet coll) {
|
||||||
coll.add(new Integer(1));
|
coll.add(1);
|
||||||
coll.add(new Integer(99));
|
coll.add(99);
|
||||||
coll.add(new Integer(50));
|
coll.add(50);
|
||||||
coll.add(new Integer(-5));
|
coll.add(-5);
|
||||||
coll.add(new Integer(10));
|
coll.add(10);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -422,10 +422,10 @@ public class TestProxyManager {
|
||||||
* Populate the given map with arbitrary data.
|
* Populate the given map with arbitrary data.
|
||||||
*/
|
*/
|
||||||
private static void populate(Map map) {
|
private static void populate(Map map) {
|
||||||
map.put(new Integer(1), "1");
|
map.put(1, "1");
|
||||||
map.put(new Integer(99), "99");
|
map.put(99, "99");
|
||||||
map.put(new Integer(-2), "-2");
|
map.put(-2, "-2");
|
||||||
map.put(new Integer(50), "50");
|
map.put(50, "50");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -209,8 +209,8 @@ public abstract class AbstractTask extends MatchingTask {
|
||||||
String[] dsFiles = ds.getIncludedFiles();
|
String[] dsFiles = ds.getIncludedFiles();
|
||||||
for (int j = 0; j < dsFiles.length; j++) {
|
for (int j = 0; j < dsFiles.length; j++) {
|
||||||
File f = new File(dsFiles[j]);
|
File f = new File(dsFiles[j]);
|
||||||
if (!( AccessController.doPrivileged(J2DoPrivHelper
|
if (!AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isFileAction(f))).booleanValue())
|
.isFileAction(f)))
|
||||||
f = new File(ds.getBasedir(), dsFiles[j]);
|
f = new File(ds.getBasedir(), dsFiles[j]);
|
||||||
files.add(AccessController.doPrivileged(
|
files.add(AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.getAbsolutePathAction(f)));
|
J2DoPrivHelper.getAbsolutePathAction(f)));
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class BooleanValue extends Value {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setInternalString(String val) {
|
protected void setInternalString(String val) {
|
||||||
set(Boolean.valueOf(val).booleanValue());
|
set(Boolean.valueOf(val));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -71,6 +71,6 @@ public class BooleanValue extends Value {
|
||||||
if (obj == null)
|
if (obj == null)
|
||||||
set(false);
|
set(false);
|
||||||
else
|
else
|
||||||
set(((Boolean) obj).booleanValue());
|
set((Boolean) obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,13 +341,13 @@ public class Configurations {
|
||||||
String anchor = result.get(CONFIG_RESOURCE_ANCHOR);
|
String anchor = result.get(CONFIG_RESOURCE_ANCHOR);
|
||||||
|
|
||||||
File file = new File(path);
|
File file = new File(path);
|
||||||
if ((AccessController.doPrivileged(J2DoPrivHelper
|
if (AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isFileAction(file))).booleanValue())
|
.isFileAction(file)))
|
||||||
provider = ProductDerivations.load(file, anchor, null);
|
provider = ProductDerivations.load(file, anchor, null);
|
||||||
else {
|
else {
|
||||||
file = new File("META-INF" + File.separatorChar + path);
|
file = new File("META-INF" + File.separatorChar + path);
|
||||||
if ((AccessController.doPrivileged(J2DoPrivHelper
|
if (AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isFileAction(file))).booleanValue())
|
.isFileAction(file)))
|
||||||
provider = ProductDerivations.load(file, anchor, null);
|
provider = ProductDerivations.load(file, anchor, null);
|
||||||
else
|
else
|
||||||
provider = ProductDerivations.load(path, anchor, null);
|
provider = ProductDerivations.load(path, anchor, null);
|
||||||
|
|
|
@ -407,15 +407,13 @@ public class ProductDerivations {
|
||||||
}
|
}
|
||||||
|
|
||||||
File f = new File(propertiesLocation);
|
File f = new File(propertiesLocation);
|
||||||
if (((Boolean) J2DoPrivHelper.isFileAction(f).run())
|
if ((Boolean) J2DoPrivHelper.isFileAction(f).run()) {
|
||||||
.booleanValue()) {
|
|
||||||
addAll(fqAnchors, propertiesLocation,
|
addAll(fqAnchors, propertiesLocation,
|
||||||
_derivations[i].getAnchorsInFile(f));
|
_derivations[i].getAnchorsInFile(f));
|
||||||
} else {
|
} else {
|
||||||
f = new File("META-INF" + File.separatorChar
|
f = new File("META-INF" + File.separatorChar
|
||||||
+ propertiesLocation);
|
+ propertiesLocation);
|
||||||
if (((Boolean) J2DoPrivHelper.isFileAction(f).run())
|
if ((Boolean) J2DoPrivHelper.isFileAction(f).run()) {
|
||||||
.booleanValue()) {
|
|
||||||
addAll(fqAnchors, propertiesLocation,
|
addAll(fqAnchors, propertiesLocation,
|
||||||
_derivations[i].getAnchorsInFile(f));
|
_derivations[i].getAnchorsInFile(f));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -107,8 +107,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
|
||||||
super(conn);
|
super(conn);
|
||||||
if (_autoCommit != null) {
|
if (_autoCommit != null) {
|
||||||
_curAutoCommit = ConfiguringConnection.this.getAutoCommit();
|
_curAutoCommit = ConfiguringConnection.this.getAutoCommit();
|
||||||
if (_curAutoCommit != _autoCommit.booleanValue())
|
if (_curAutoCommit != _autoCommit)
|
||||||
setAutoCommit(_autoCommit.booleanValue());
|
setAutoCommit(_autoCommit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +125,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
|
||||||
if (_isolation != TRANSACTION_NONE)
|
if (_isolation != TRANSACTION_NONE)
|
||||||
super.commit();
|
super.commit();
|
||||||
if (_autoCommit != null
|
if (_autoCommit != null
|
||||||
&& _autoCommit.booleanValue() != _curAutoCommit)
|
&& _autoCommit != _curAutoCommit)
|
||||||
setAutoCommit(_autoCommit.booleanValue());
|
setAutoCommit(_autoCommit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -134,8 +134,8 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
|
||||||
if (_isolation != TRANSACTION_NONE)
|
if (_isolation != TRANSACTION_NONE)
|
||||||
super.rollback();
|
super.rollback();
|
||||||
if (_autoCommit != null
|
if (_autoCommit != null
|
||||||
&& _autoCommit.booleanValue() != _curAutoCommit)
|
&& _autoCommit != _curAutoCommit)
|
||||||
setAutoCommit(_autoCommit.booleanValue());
|
setAutoCommit(_autoCommit);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -114,7 +114,7 @@ public class LogFactoryImpl
|
||||||
l = newLogImpl();
|
l = newLogImpl();
|
||||||
l.setChannel(channel); // TODO add to interface?
|
l.setChannel(channel); // TODO add to interface?
|
||||||
Short lvl = _configuredLevels.get(shorten(channel));
|
Short lvl = _configuredLevels.get(shorten(channel));
|
||||||
l.setLevel(lvl == null ? _defaultLogLevel : lvl.shortValue());
|
l.setLevel(lvl == null ? _defaultLogLevel : lvl);
|
||||||
_logs.put(channel, l);
|
_logs.put(channel, l);
|
||||||
}
|
}
|
||||||
return l;
|
return l;
|
||||||
|
@ -282,7 +282,7 @@ public class LogFactoryImpl
|
||||||
for (Iterator<Map.Entry<Object, Object>> iter =
|
for (Iterator<Map.Entry<Object, Object>> iter =
|
||||||
opts.entrySet().iterator(); iter.hasNext();) {
|
opts.entrySet().iterator(); iter.hasNext();) {
|
||||||
e = iter.next();
|
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();
|
opts.clear();
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,8 +216,8 @@ public class ClassArgParser {
|
||||||
return new String[]{ getFromClassFile(file) };
|
return new String[]{ getFromClassFile(file) };
|
||||||
if (arg.endsWith(".java"))
|
if (arg.endsWith(".java"))
|
||||||
return new String[]{ getFromJavaFile(file) };
|
return new String[]{ getFromJavaFile(file) };
|
||||||
if ((AccessController.doPrivileged(
|
if (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue()) {
|
J2DoPrivHelper.existsAction(file))) {
|
||||||
Collection<String> col = getFromMetaDataFile(file);
|
Collection<String> col = getFromMetaDataFile(file);
|
||||||
return col.toArray(new String[col.size()]);
|
return col.toArray(new String[col.size()]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,8 +192,8 @@ public class ClassMetaDataIterator implements MetaDataIterator {
|
||||||
if (_url == -1 || _url >= _urls.size())
|
if (_url == -1 || _url >= _urls.size())
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
|
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
|
||||||
return ((AccessController.doPrivileged(
|
return (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file:null;
|
J2DoPrivHelper.existsAction(file))) ? file:null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -60,11 +60,11 @@ public class ClasspathMetaDataIterator extends MetaDataIteratorChain {
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
File file = new File(tokens[i]);
|
File file = new File(tokens[i]);
|
||||||
if (!(AccessController.doPrivileged(
|
if (!AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue())
|
J2DoPrivHelper.existsAction(file)))
|
||||||
continue;
|
continue;
|
||||||
if (AccessController.doPrivileged(J2DoPrivHelper
|
if (AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isDirectoryAction(file)).booleanValue())
|
.isDirectoryAction(file)))
|
||||||
addIterator(new FileMetaDataIterator(file, filter));
|
addIterator(new FileMetaDataIterator(file, filter));
|
||||||
else if (tokens[i].endsWith(".jar")) {
|
else if (tokens[i].endsWith(".jar")) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -164,8 +164,8 @@ public class FileMetaDataIterator implements MetaDataIterator {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public byte[] getContent() throws IOException {
|
public byte[] getContent() throws IOException {
|
||||||
long len = (AccessController.doPrivileged(
|
long len = AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.lengthAction(_file))).longValue();
|
J2DoPrivHelper.lengthAction(_file));
|
||||||
FileInputStream fin = null;
|
FileInputStream fin = null;
|
||||||
try {
|
try {
|
||||||
fin = AccessController.doPrivileged(
|
fin = AccessController.doPrivileged(
|
||||||
|
|
|
@ -106,8 +106,8 @@ public class ResourceMetaDataIterator implements MetaDataIterator {
|
||||||
if (_url == -1 || _url >= _urls.size())
|
if (_url == -1 || _url >= _urls.size())
|
||||||
throw new IllegalStateException();
|
throw new IllegalStateException();
|
||||||
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
|
File file = new File(URLDecoder.decode((_urls.get(_url)).getFile()));
|
||||||
return ((AccessController.doPrivileged(
|
return (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file :null;
|
J2DoPrivHelper.existsAction(file))) ? file :null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -80,8 +80,8 @@ public class URLMetaDataIterator implements MetaDataIterator {
|
||||||
if (_url == null)
|
if (_url == null)
|
||||||
return null;
|
return null;
|
||||||
File file = new File(URLDecoder.decode(_url.getPath()));
|
File file = new File(URLDecoder.decode(_url.getPath()));
|
||||||
return ((AccessController.doPrivileged(
|
return (AccessController.doPrivileged(
|
||||||
J2DoPrivHelper.existsAction(file))).booleanValue()) ? file:null;
|
J2DoPrivHelper.existsAction(file))) ? file:null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -305,8 +305,8 @@ public abstract class XMLMetaDataParser extends DefaultHandler
|
||||||
public void parse(File file) throws IOException {
|
public void parse(File file) throws IOException {
|
||||||
if (file == null)
|
if (file == null)
|
||||||
return;
|
return;
|
||||||
if (!(AccessController.doPrivileged(J2DoPrivHelper
|
if (!AccessController.doPrivileged(J2DoPrivHelper
|
||||||
.isDirectoryAction(file))).booleanValue())
|
.isDirectoryAction(file)))
|
||||||
parse(new FileMetaDataIterator(file));
|
parse(new FileMetaDataIterator(file));
|
||||||
else {
|
else {
|
||||||
String suff = (_suffix == null) ? "" : _suffix;
|
String suff = (_suffix == null) ? "" : _suffix;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue