You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2008/06/30 06:57:45 UTC
svn commit: r672706 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity:
./ connection/ jdbc/ model/ transaction/
Author: doogie
Date: Sun Jun 29 21:57:44 2008
New Revision: 672706
URL: http://svn.apache.org/viewvc?rev=672706&view=rev
Log:
More Number.valueOf work.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/CursorStatement.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/GenericXaResource.java
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Sun Jun 29 21:57:44 2008
@@ -619,7 +619,7 @@
// this "hack" is needed for now until the Double/BigDecimal issues are all resolved
Object value = get(name);
if (value instanceof BigDecimal) {
- return new Double(((BigDecimal) value).doubleValue());
+ return Double.valueOf(((BigDecimal) value).doubleValue());
} else {
return (Double) value;
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/connection/XaPoolConnectionFactory.java Sun Jun 29 21:57:44 2008
@@ -110,12 +110,12 @@
// configure the pool settings
try {
- pds.setMaxSize(new Integer(jotmJdbcElement.getAttribute("pool-maxsize")).intValue());
- pds.setMinSize(new Integer(jotmJdbcElement.getAttribute("pool-minsize")).intValue());
- pds.setSleepTime(new Long(jotmJdbcElement.getAttribute("pool-sleeptime")).longValue());
- pds.setLifeTime(new Long(jotmJdbcElement.getAttribute("pool-lifetime")).longValue());
- pds.setDeadLockMaxWait(new Long(jotmJdbcElement.getAttribute("pool-deadlock-maxwait")).longValue());
- pds.setDeadLockRetryWait(new Long(jotmJdbcElement.getAttribute("pool-deadlock-retrywait")).longValue());
+ pds.setMaxSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-maxsize")));
+ pds.setMinSize(Integer.parseInt(jotmJdbcElement.getAttribute("pool-minsize")));
+ pds.setSleepTime(Long.parseLong(jotmJdbcElement.getAttribute("pool-sleeptime")));
+ pds.setLifeTime(Long.parseLong(jotmJdbcElement.getAttribute("pool-lifetime")));
+ pds.setDeadLockMaxWait(Long.parseLong(jotmJdbcElement.getAttribute("pool-deadlock-maxwait")));
+ pds.setDeadLockRetryWait(Long.parseLong(jotmJdbcElement.getAttribute("pool-deadlock-retrywait")));
// set the test statement to test connections
String testStmt = jotmJdbcElement.getAttribute("pool-jdbc-test-stmt");
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/CursorStatement.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/CursorStatement.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/CursorStatement.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/CursorStatement.java Sun Jun 29 21:57:44 2008
@@ -79,7 +79,7 @@
} else if ("setCursorName".equals(method.getName())) {
setCursorName((String) args[0]);
} else if ("getFetchSize".equals(method.getName())) {
- return new Integer(getFetchSize());
+ return Integer.valueOf(getFetchSize());
} else if ("setFetchSize".equals(method.getName())) {
setFetchSize(((Integer) args[0]).intValue());
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java Sun Jun 29 21:57:44 2008
@@ -547,7 +547,7 @@
//if (field.length() > 4000) {
//Clob clb = new Cl
// doesn't work with Oracle drivers, need the funky work-around: _ps.setCharacterStream(_ind, new StringReader(field), field.length());
- //_needClobWorkAroundWrite.put(new Integer(_ind), field);
+ //_needClobWorkAroundWrite.put(Integer.valueOf(_ind), field);
//_ps.setString(_ind, " ");
//} else {
_ps.setString(_ind, field);
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/jdbc/SqlJdbcUtil.java Sun Jun 29 21:57:44 2008
@@ -602,7 +602,7 @@
if (rs.wasNull()) {
entity.dangerousSetNoCheckButFast(curField, null);
} else {
- entity.dangerousSetNoCheckButFast(curField, new Integer(intValue));
+ entity.dangerousSetNoCheckButFast(curField, Integer.valueOf(intValue));
}
break;
@@ -611,7 +611,7 @@
if (rs.wasNull()) {
entity.dangerousSetNoCheckButFast(curField, null);
} else {
- entity.dangerousSetNoCheckButFast(curField, new Long(longValue));
+ entity.dangerousSetNoCheckButFast(curField, Long.valueOf(longValue));
}
break;
@@ -620,7 +620,7 @@
if (rs.wasNull()) {
entity.dangerousSetNoCheckButFast(curField, null);
} else {
- entity.dangerousSetNoCheckButFast(curField, new Float(floatValue));
+ entity.dangerousSetNoCheckButFast(curField, Float.valueOf(floatValue));
}
break;
@@ -629,7 +629,7 @@
if (rs.wasNull()) {
entity.dangerousSetNoCheckButFast(curField, null);
} else {
- entity.dangerousSetNoCheckButFast(curField, new Double(doubleValue));
+ entity.dangerousSetNoCheckButFast(curField, Double.valueOf(doubleValue));
}
break;
@@ -647,7 +647,7 @@
if (rs.wasNull()) {
entity.dangerousSetNoCheckButFast(curField, null);
} else {
- entity.dangerousSetNoCheckButFast(curField, new Boolean(booleanValue));
+ entity.dangerousSetNoCheckButFast(curField, Boolean.valueOf(booleanValue));
}
break;
}
@@ -823,46 +823,46 @@
protected static Map<String, Integer> fieldTypeMap = FastMap.newInstance();
static {
- fieldTypeMap.put("java.lang.String", new Integer(1));
- fieldTypeMap.put("String", new Integer(1));
- fieldTypeMap.put("java.sql.Timestamp", new Integer(2));
- fieldTypeMap.put("Timestamp", new Integer(2));
- fieldTypeMap.put("java.sql.Time", new Integer(3));
- fieldTypeMap.put("Time", new Integer(3));
- fieldTypeMap.put("java.sql.Date", new Integer(4));
- fieldTypeMap.put("Date", new Integer(4));
- fieldTypeMap.put("java.lang.Integer", new Integer(5));
- fieldTypeMap.put("Integer", new Integer(5));
- fieldTypeMap.put("java.lang.Long", new Integer(6));
- fieldTypeMap.put("Long", new Integer(6));
- fieldTypeMap.put("java.lang.Float", new Integer(7));
- fieldTypeMap.put("Float", new Integer(7));
- fieldTypeMap.put("java.lang.Double", new Integer(8));
- fieldTypeMap.put("Double", new Integer(8));
- fieldTypeMap.put("java.math.BigDecimal", new Integer(9));
- fieldTypeMap.put("BigDecimal", new Integer(9));
- fieldTypeMap.put("java.lang.Boolean", new Integer(10));
- fieldTypeMap.put("Boolean", new Integer(10));
+ fieldTypeMap.put("java.lang.String", 1);
+ fieldTypeMap.put("String", 1);
+ fieldTypeMap.put("java.sql.Timestamp", 2);
+ fieldTypeMap.put("Timestamp", 2);
+ fieldTypeMap.put("java.sql.Time", 3);
+ fieldTypeMap.put("Time", 3);
+ fieldTypeMap.put("java.sql.Date", 4);
+ fieldTypeMap.put("Date", 4);
+ fieldTypeMap.put("java.lang.Integer", 5);
+ fieldTypeMap.put("Integer", 5);
+ fieldTypeMap.put("java.lang.Long", 6);
+ fieldTypeMap.put("Long", 6);
+ fieldTypeMap.put("java.lang.Float", 7);
+ fieldTypeMap.put("Float", 7);
+ fieldTypeMap.put("java.lang.Double", 8);
+ fieldTypeMap.put("Double", 8);
+ fieldTypeMap.put("java.math.BigDecimal", 9);
+ fieldTypeMap.put("BigDecimal", 9);
+ fieldTypeMap.put("java.lang.Boolean", 10);
+ fieldTypeMap.put("Boolean", 10);
- fieldTypeMap.put("java.lang.Object", new Integer(11));
- fieldTypeMap.put("Object", new Integer(11));
+ fieldTypeMap.put("java.lang.Object", 11);
+ fieldTypeMap.put("Object", 11);
- fieldTypeMap.put("java.sql.Blob", new Integer(12));
- fieldTypeMap.put("Blob", new Integer(12));
- fieldTypeMap.put("byte[]", new Integer(12));
- fieldTypeMap.put("java.nio.ByteBuffer", new Integer(12));
- fieldTypeMap.put("java.nio.HeapByteBuffer", new Integer(12));
+ fieldTypeMap.put("java.sql.Blob", 12);
+ fieldTypeMap.put("Blob", 12);
+ fieldTypeMap.put("byte[]", 12);
+ fieldTypeMap.put("java.nio.ByteBuffer", 12);
+ fieldTypeMap.put("java.nio.HeapByteBuffer", 12);
- fieldTypeMap.put("java.sql.Clob", new Integer(13));
- fieldTypeMap.put("Clob", new Integer(13));
+ fieldTypeMap.put("java.sql.Clob", 13);
+ fieldTypeMap.put("Clob", 13);
- fieldTypeMap.put("java.util.Date", new Integer(14));
+ fieldTypeMap.put("java.util.Date", 14);
// all of these treated as Collection
- fieldTypeMap.put("java.util.ArrayList", new Integer(15));
- fieldTypeMap.put("java.util.HashSet", new Integer(15));
- fieldTypeMap.put("java.util.LinkedHashSet", new Integer(15));
- fieldTypeMap.put("java.util.LinkedList", new Integer(15));
+ fieldTypeMap.put("java.util.ArrayList", 15);
+ fieldTypeMap.put("java.util.HashSet", 15);
+ fieldTypeMap.put("java.util.LinkedHashSet", 15);
+ fieldTypeMap.put("java.util.LinkedList", 15);
}
public static int getType(String fieldType) throws GenericNotImplementedException {
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelViewEntity.java Sun Jun 29 21:57:44 2008
@@ -748,7 +748,7 @@
String primKeyValue = UtilXml.checkEmpty(aliasElement.getAttribute("prim-key"));
if (UtilValidate.isNotEmpty(primKeyValue)) {
- this.isPk = new Boolean("true".equals(primKeyValue));
+ this.isPk = Boolean.valueOf("true".equals(primKeyValue));
} else {
this.isPk = null;
}
Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/GenericXaResource.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/GenericXaResource.java?rev=672706&r1=672705&r2=672706&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/GenericXaResource.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/GenericXaResource.java Sun Jun 29 21:57:44 2008
@@ -165,7 +165,7 @@
* Note: the valus is saved but in the current implementation this is not used.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
- this.timeout = (seconds == 0 ? null : new Integer(seconds));
+ this.timeout = (seconds == 0 ? null : Integer.valueOf(seconds));
return true;
}