[libpostgresql-jdbc-java] 55/93: Use StringBuffer to construct a string.

Emmanuel Bourg ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

ebourg-guest pushed a commit to annotated tag REL9_3_1102
in repository libpostgresql-jdbc-java.

commit a146e24ea333799763ea6daebb158e80331428c4
Author: Heikki Linnakangas <heikki.linnakangas at iki.fi>
Date:   Wed Nov 13 22:41:37 2013 +0200

    Use StringBuffer to construct a string.
    
    This piece of code isn't performance-critical at all, but silences a
    Coverity complaint.
---
 org/postgresql/core/v3/ConnectionFactoryImpl.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/org/postgresql/core/v3/ConnectionFactoryImpl.java b/org/postgresql/core/v3/ConnectionFactoryImpl.java
index 10a2e3d..3c7d332 100644
--- a/org/postgresql/core/v3/ConnectionFactoryImpl.java
+++ b/org/postgresql/core/v3/ConnectionFactoryImpl.java
@@ -324,12 +324,14 @@ public class ConnectionFactoryImpl extends ConnectionFactory {
     private void sendStartupPacket(PGStream pgStream, String[][] params, Logger logger) throws IOException {
         if (logger.logDebug())
         {
-            String details = "";
+            StringBuffer details = new StringBuffer();
             for (int i = 0; i < params.length; ++i)
             {
                 if (i != 0)
-                    details += ", ";
-                details += params[i][0] + "=" + params[i][1];
+		    details.append(", ");
+		details.append(params[i][0]);
+		details.append("=");
+		details.append(params[i][1]);
             }
             logger.debug(" FE=> StartupPacket(" + details + ")");
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git



More information about the pkg-java-commits mailing list