Replace new Long() with Long.valueOf()
Signed-off-by: Tobi Schäfer <interface@p3k.org>
This commit is contained in:
parent
052bfc0db1
commit
2ff75f7879
10 changed files with 25 additions and 25 deletions
|
@ -192,7 +192,7 @@ public final class TypeManager {
|
|||
long lastScan = lastRepoScan.containsKey(repository) ?
|
||||
((Long) lastRepoScan.get(repository)).longValue() : 0;
|
||||
if (repository.lastModified() != lastScan) {
|
||||
lastRepoScan.put(repository, new Long(repository.lastModified()));
|
||||
lastRepoScan.put(repository, Long.valueOf(repository.lastModified()));
|
||||
checkRepository(repository, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public final class TransientProperty implements IProperty, Serializable {
|
|||
return new Boolean(bvalue);
|
||||
|
||||
case INTEGER:
|
||||
return new Long(lvalue);
|
||||
return Long.valueOf(lvalue);
|
||||
|
||||
case FLOAT:
|
||||
return new Double(dvalue);
|
||||
|
|
|
@ -93,7 +93,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
break;
|
||||
|
||||
case INTEGER:
|
||||
value = new Long(in.readLong());
|
||||
value = Long.valueOf(in.readLong());
|
||||
|
||||
break;
|
||||
|
||||
|
@ -231,7 +231,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
|||
*/
|
||||
public void setIntegerValue(long l) {
|
||||
type = INTEGER;
|
||||
value = new Long(l);
|
||||
value = Long.valueOf(l);
|
||||
dirty = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ public class Transactor {
|
|||
public void registerConnection(DbSource src, Connection con) {
|
||||
sqlConnections.put(src, con);
|
||||
// we assume a freshly created connection is ok.
|
||||
testedConnections.put(src, new Long(System.currentTimeMillis()));
|
||||
testedConnections.put(src, Long.valueOf(System.currentTimeMillis()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -262,7 +262,7 @@ public class Transactor {
|
|||
stmt.execute("SELECT 1");
|
||||
}
|
||||
stmt.close();
|
||||
testedConnections.put(src, new Long(now));
|
||||
testedConnections.put(src, Long.valueOf(now));
|
||||
} catch (SQLException sx) {
|
||||
try {
|
||||
con.close();
|
||||
|
|
|
@ -227,7 +227,7 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
|||
} else if ("float".equals(elementType)) {
|
||||
prop.setFloatValue((new Double(charValue)).doubleValue());
|
||||
} else if ("integer".equals(elementType)) {
|
||||
prop.setIntegerValue((new Long(charValue)).longValue());
|
||||
prop.setIntegerValue((Long.valueOf(charValue)).longValue());
|
||||
} else {
|
||||
prop.setStringValue(charValue);
|
||||
}
|
||||
|
|
|
@ -301,7 +301,7 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
|||
} else if ("float".equals(elementType)) {
|
||||
currentNode.setFloat(elementName, (new Double(charValue)).doubleValue());
|
||||
} else if ("integer".equals(elementType)) {
|
||||
currentNode.setInteger(elementName, (new Long(charValue)).longValue());
|
||||
currentNode.setInteger(elementName, (Long.valueOf(charValue)).longValue());
|
||||
} else {
|
||||
currentNode.setString(elementName, charValue);
|
||||
}
|
||||
|
|
|
@ -879,7 +879,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
|||
if (d == null) {
|
||||
return null;
|
||||
} else {
|
||||
Object[] args = { new Long(d.getTime()) };
|
||||
Object[] args = { Long.valueOf(d.getTime()) };
|
||||
try {
|
||||
return cx.newObject(core.global, "Date", args);
|
||||
} catch (JavaScriptException nafx) {
|
||||
|
|
|
@ -569,7 +569,7 @@ public final class RhinoCore implements ScopeProvider {
|
|||
return arg;
|
||||
if (arg instanceof Date) {
|
||||
Date d = (Date) arg;
|
||||
Object[] args = { new Long(d.getTime()) };
|
||||
Object[] args = { Long.valueOf(d.getTime()) };
|
||||
return Context.getCurrentContext().newObject(global, "Date", args);
|
||||
}
|
||||
return Context.toObject(arg, global);
|
||||
|
@ -1146,7 +1146,7 @@ public final class RhinoCore implements ScopeProvider {
|
|||
|
||||
// Convert java.util.Date objects to JavaScript Dates
|
||||
if (obj instanceof Date) {
|
||||
Object[] args = { new Long(((Date) obj).getTime()) };
|
||||
Object[] args = { Long.valueOf(((Date) obj).getTime()) };
|
||||
try {
|
||||
return cx.newObject(global, "Date", args);
|
||||
} catch (JavaScriptException nafx) {
|
||||
|
|
|
@ -106,7 +106,7 @@ public class Profiler implements Debugger {
|
|||
Scriptable thisObj, Object[] args) {
|
||||
|
||||
long time = System.nanoTime();
|
||||
timer.push(new Long(time));
|
||||
timer.push(Long.valueOf(time));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -515,7 +515,7 @@ public class DatabaseObject {
|
|||
case Types.BIGINT:
|
||||
case Types.SMALLINT:
|
||||
case Types.INTEGER:
|
||||
return new Long(resultSet.getLong(index));
|
||||
return Long.valueOf(resultSet.getLong(index));
|
||||
|
||||
case Types.REAL:
|
||||
case Types.FLOAT:
|
||||
|
@ -532,7 +532,7 @@ public class DatabaseObject {
|
|||
if (num.scale() > 0) {
|
||||
return new Double(num.doubleValue());
|
||||
} else {
|
||||
return new Long(num.longValue());
|
||||
return Long.valueOf(num.longValue());
|
||||
}
|
||||
|
||||
case Types.VARBINARY:
|
||||
|
|
Loading…
Add table
Reference in a new issue