This is an automated email from the git hooks/post-receive script. ebourg-guest pushed a commit to tag REL9_3_1103 in repository libpostgresql-jdbc-java.
commit ed3741cd1c7412f3c033635b971babc6fb51ef60 Author: Dave Cramer <[email protected]> Date: Sun Sep 14 13:54:01 2014 +0000 minor cleanups which supposed not to change logic, but make code cleaner. pull #184 --- org/postgresql/core/v2/ConnectionFactoryImpl.java | 2 +- org/postgresql/core/v2/SimpleParameterList.java | 2 +- org/postgresql/core/v3/ConnectionFactoryImpl.java | 4 ++-- org/postgresql/core/v3/QueryExecutorImpl.java | 8 ++++---- org/postgresql/ds/common/BaseDataSource.java | 2 +- org/postgresql/geometric/PGcircle.java | 2 +- org/postgresql/geometric/PGpoint.java | 4 ++-- org/postgresql/jdbc2/AbstractJdbc2Connection.java | 4 ++-- org/postgresql/jdbc2/AbstractJdbc2ResultSet.java | 10 +++++----- org/postgresql/util/PGmoney.java | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/org/postgresql/core/v2/ConnectionFactoryImpl.java b/org/postgresql/core/v2/ConnectionFactoryImpl.java index 08ea0c3..ed7a264 100644 --- a/org/postgresql/core/v2/ConnectionFactoryImpl.java +++ b/org/postgresql/core/v2/ConnectionFactoryImpl.java @@ -68,7 +68,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { } // - the TCP keep alive setting - boolean requireTCPKeepAlive = (Boolean.valueOf(info.getProperty("tcpKeepAlive")).booleanValue()); + boolean requireTCPKeepAlive = Boolean.parseBoolean(info.getProperty("tcpKeepAlive")); for (int whichHost = 0; whichHost < hostSpecs.length; ++whichHost) { HostSpec hostSpec = hostSpecs[whichHost]; diff --git a/org/postgresql/core/v2/SimpleParameterList.java b/org/postgresql/core/v2/SimpleParameterList.java index da83c05..4b30c2e 100644 --- a/org/postgresql/core/v2/SimpleParameterList.java +++ b/org/postgresql/core/v2/SimpleParameterList.java @@ -178,6 +178,6 @@ class SimpleParameterList implements ParameterList { * nb: we explicitly say "new String" to avoid interning giving us an object that * might be the same (by identity) as a String elsewhere. */ - private final static String NULL_OBJECT = new String("NULL"); + private final static String NULL_OBJECT = "NULL"; } diff --git a/org/postgresql/core/v3/ConnectionFactoryImpl.java b/org/postgresql/core/v3/ConnectionFactoryImpl.java index 84a5380..dfae87a 100644 --- a/org/postgresql/core/v3/ConnectionFactoryImpl.java +++ b/org/postgresql/core/v3/ConnectionFactoryImpl.java @@ -76,7 +76,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { } // - the TCP keep alive setting - boolean requireTCPKeepAlive = (Boolean.valueOf(info.getProperty("tcpKeepAlive")).booleanValue()); + boolean requireTCPKeepAlive = Boolean.parseBoolean(info.getProperty("tcpKeepAlive")); // NOTE: To simplify this code, it is assumed that if we are // using the V3 protocol, then the database is at least 7.4. That @@ -498,7 +498,7 @@ public class ConnectionFactoryImpl extends ConnectionFactory { info.getProperty("jaasApplicationName"), info.getProperty("kerberosServerName"), logger, - Boolean.valueOf(info.getProperty("useSpnego")).booleanValue()); + Boolean.parseBoolean(info.getProperty("useSpnego"))); break; case AUTH_REQ_OK: diff --git a/org/postgresql/core/v3/QueryExecutorImpl.java b/org/postgresql/core/v3/QueryExecutorImpl.java index 1b78707..34f2e65 100644 --- a/org/postgresql/core/v3/QueryExecutorImpl.java +++ b/org/postgresql/core/v3/QueryExecutorImpl.java @@ -36,7 +36,7 @@ public class QueryExecutorImpl implements QueryExecutor { this.logger = logger; if (info.getProperty("allowEncodingChanges") != null) { - this.allowEncodingChanges = Boolean.valueOf(info.getProperty("allowEncodingChanges")).booleanValue(); + this.allowEncodingChanges = Boolean.parseBoolean(info.getProperty("allowEncodingChanges")); } else { this.allowEncodingChanges = false; } @@ -1218,7 +1218,7 @@ public class QueryExecutorImpl implements QueryExecutor { for (int i = 0; i < fragments.length; ++i) { if (i > 0) - sbuf.append("$" + i); + sbuf.append("$").append(i); sbuf.append(fragments[i]); } sbuf.append("\",oids={"); @@ -1226,7 +1226,7 @@ public class QueryExecutorImpl implements QueryExecutor { { if (i != 1) sbuf.append(","); - sbuf.append("" + params.getTypeOID(i)); + sbuf.append(params.getTypeOID(i)); } sbuf.append("})"); logger.debug(sbuf.toString()); @@ -1298,7 +1298,7 @@ public class QueryExecutorImpl implements QueryExecutor { StringBuffer sbuf = new StringBuffer(" FE=> Bind(stmt=" + statementName + ",portal=" + portal); for (int i = 1; i <= params.getParameterCount(); ++i) { - sbuf.append(",$" + i + "=<" + params.toString(i) + ">"); + sbuf.append(",$").append(i).append("=<").append(params.toString(i)).append(">"); } sbuf.append(")"); logger.debug(sbuf.toString()); diff --git a/org/postgresql/ds/common/BaseDataSource.java b/org/postgresql/ds/common/BaseDataSource.java index 3ab97dc..8aa317a 100644 --- a/org/postgresql/ds/common/BaseDataSource.java +++ b/org/postgresql/ds/common/BaseDataSource.java @@ -553,7 +553,7 @@ public abstract class BaseDataSource implements Referenceable } sb.append("&tcpKeepAlive=").append(tcpKeepAlive); if (compatible != null) { - sb.append("&compatible="+compatible); + sb.append("&compatible=").append(compatible); } if (applicationName != null) { sb.append("&ApplicationName="); diff --git a/org/postgresql/geometric/PGcircle.java b/org/postgresql/geometric/PGcircle.java index ca88ed4..c19d936 100644 --- a/org/postgresql/geometric/PGcircle.java +++ b/org/postgresql/geometric/PGcircle.java @@ -84,7 +84,7 @@ public class PGcircle extends PGobject implements Serializable, Cloneable try { center = new PGpoint(t.getToken(0)); - radius = Double.valueOf(t.getToken(1)).doubleValue(); + radius = Double.parseDouble(t.getToken(1)); } catch (NumberFormatException e) { diff --git a/org/postgresql/geometric/PGpoint.java b/org/postgresql/geometric/PGpoint.java index 96f07ba..8ccc72a 100644 --- a/org/postgresql/geometric/PGpoint.java +++ b/org/postgresql/geometric/PGpoint.java @@ -77,8 +77,8 @@ public class PGpoint extends PGobject implements PGBinaryObject, Serializable, C PGtokenizer t = new PGtokenizer(PGtokenizer.removePara(s), ','); try { - x = Double.valueOf(t.getToken(0)).doubleValue(); - y = Double.valueOf(t.getToken(1)).doubleValue(); + x = Double.parseDouble(t.getToken(0)); + y = Double.parseDouble(t.getToken(1)); } catch (NumberFormatException e) { diff --git a/org/postgresql/jdbc2/AbstractJdbc2Connection.java b/org/postgresql/jdbc2/AbstractJdbc2Connection.java index 50bf03a..c0c15fb 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2Connection.java +++ b/org/postgresql/jdbc2/AbstractJdbc2Connection.java @@ -130,7 +130,7 @@ public abstract class AbstractJdbc2Connection implements BaseConnection boolean binaryTransfer = true; try { - binaryTransfer = Boolean.valueOf(info.getProperty("binaryTransfer", "true")).booleanValue(); + binaryTransfer = Boolean.parseBoolean(info.getProperty("binaryTransfer", "true")); } catch (Exception e) { @@ -264,7 +264,7 @@ public abstract class AbstractJdbc2Connection implements BaseConnection _typeCache = createTypeInfo(this, unknownLength); initObjectTypes(info); - if (Boolean.valueOf(info.getProperty("logUnclosedConnections")).booleanValue()) { + if (Boolean.parseBoolean(info.getProperty("logUnclosedConnections"))) { openStackTrace = new Throwable("Connection was created at this point:"); enableDriverManagerLogging(); } diff --git a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java index 503345a..fc7587e 100644 --- a/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java +++ b/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java @@ -1674,17 +1674,17 @@ public abstract class AbstractJdbc2ResultSet implements BaseResultSet, org.postg * element 1 the schema name which may be a zero length string. */ public static String[] quotelessTableName(String fullname) { - StringBuffer buf = new StringBuffer(fullname); + String[] parts = new String[] {null, ""}; StringBuffer acc = new StringBuffer(); boolean betweenQuotes = false; - for (int i = 0; i < buf.length(); i++) + for (int i = 0; i < fullname.length(); i++) { - char c = buf.charAt(i); + char c = fullname.charAt(i); switch (c) { case '"': - if ((i < buf.length() - 1) && (buf.charAt(i + 1) == '"')) + if ((i < fullname.length() - 1) && (fullname.charAt(i + 1) == '"')) { // two consecutive quotes - keep one i++; @@ -2910,7 +2910,7 @@ public abstract class AbstractJdbc2ResultSet implements BaseResultSet, org.postg try { - if (Double.valueOf(s).doubleValue() == 1) + if (Double.parseDouble(s) == 1) return true; } catch (NumberFormatException e) diff --git a/org/postgresql/util/PGmoney.java b/org/postgresql/util/PGmoney.java index 4ef7ed5..574642f 100644 --- a/org/postgresql/util/PGmoney.java +++ b/org/postgresql/util/PGmoney.java @@ -64,7 +64,7 @@ public class PGmoney extends PGobject implements Serializable, Cloneable pos = s1.indexOf(','); } - val = Double.valueOf(s1).doubleValue(); + val = Double.parseDouble(s1); val = negative ? -val : val; } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

