[libpostgresql-jdbc-java] 14/128: undo format changes

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


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

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

commit 6e1fa1e7781b28f32776cb6c7061119cd1e697aa
Author: Dave Cramer <davecramer at gmail.com>
Date:   Thu Nov 1 11:47:28 2012 -0400

    undo format changes
---
 org/postgresql/core/v3/SimpleParameterList.java | 35 +++++--------------------
 1 file changed, 6 insertions(+), 29 deletions(-)

diff --git a/org/postgresql/core/v3/SimpleParameterList.java b/org/postgresql/core/v3/SimpleParameterList.java
index b4157f2..05d8b5e 100644
--- a/org/postgresql/core/v3/SimpleParameterList.java
+++ b/org/postgresql/core/v3/SimpleParameterList.java
@@ -14,7 +14,12 @@ import java.sql.SQLException;
 import java.util.Arrays;
 
 import org.postgresql.core.*;
-import org.postgresql.util.*;
+import org.postgresql.util.PSQLException;
+import org.postgresql.util.PSQLState;
+import org.postgresql.util.StreamWrapper;
+import org.postgresql.util.GT;
+import org.postgresql.util.ByteConverter;
+
 
 /**
  * Parameter list for a single-statement V3 query.
@@ -41,18 +46,14 @@ class SimpleParameterList implements V3ParameterList {
     public void registerOutParameter( int index, int sqlType ) throws SQLException
     {
         if (index < 1 || index > paramValues.length)
-        {
             throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE);
-        }
 
         flags[index-1] |= OUT;
     }
 
     private void bind(int index, Object value, int oid, int binary) throws SQLException {
         if (index < 1 || index > paramValues.length)
-        {
             throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(index), new Integer(paramValues.length)}), PSQLState.INVALID_PARAMETER_VALUE);
-        }
 
         --index;
 
@@ -65,9 +66,7 @@ class SimpleParameterList implements V3ParameterList {
         // send this value, and we don't want to overwrite and require a
         // reparse.
         if (oid == Oid.UNSPECIFIED && paramTypes[index] != Oid.UNSPECIFIED && value == NULL_OBJECT)
-        {
             return;
-        }
 
         paramTypes[index] = oid;
     }
@@ -88,9 +87,7 @@ class SimpleParameterList implements V3ParameterList {
         }
         // Every function has at least one output.
         if (count == 0)
-        {
             count = 1;
-        }
         return count;
         
     }
@@ -140,13 +137,9 @@ class SimpleParameterList implements V3ParameterList {
     public String toString(int index) {
         --index;
         if (paramValues[index] == null)
-        {
             return "?";
-        }
         else if (paramValues[index] == NULL_OBJECT)
-        {
             return "NULL";
-        }
 
         else if ( (flags[index]& BINARY) == BINARY )
         {
@@ -193,9 +186,7 @@ class SimpleParameterList implements V3ParameterList {
             }
 
             if (hasBackslash && !standardConformingStrings && supportsEStringSyntax)
-            {
                 p.append('E');
-            }
 
             p.append('\'');
             try
@@ -222,11 +213,9 @@ class SimpleParameterList implements V3ParameterList {
         for (int i = 0; i < paramTypes.length; ++i)
         {
             if (direction(i) != OUT && paramValues[i] == null)
-            {
                 throw new PSQLException(GT.tr("No value specified for parameter {0}.", new Integer(i + 1)), PSQLState.INVALID_PARAMETER_VALUE);
             }
         }
-    }
 
     public void convertFunctionOutParameters()
     {
@@ -270,10 +259,8 @@ class SimpleParameterList implements V3ParameterList {
     boolean hasUnresolvedTypes() {
         for (int i=0; i< paramTypes.length; i++) {
             if (paramTypes[i] == Oid.UNSPECIFIED)
-            {
                 return true;
             }
-        }
         return false;
     }
 
@@ -303,21 +290,15 @@ class SimpleParameterList implements V3ParameterList {
 
         // Null?
         if (paramValues[index] == NULL_OBJECT)
-        {
             throw new IllegalArgumentException("can't getV3Length() on a null parameter");
-        }
 
         // Directly encoded?
         if (paramValues[index] instanceof byte[])
-        {
             return ((byte[]) paramValues[index]).length;
-        }
 
         // Binary-format bytea?
         if (paramValues[index] instanceof StreamWrapper)
-        {
             return ((StreamWrapper) paramValues[index]).getLength();
-        }
 
         // Already encoded?
         if (encoded[index] == null)
@@ -334,9 +315,7 @@ class SimpleParameterList implements V3ParameterList {
 
         // Null?
         if (paramValues[index] == NULL_OBJECT)
-        {
             throw new IllegalArgumentException("can't writeV3Value() on a null parameter");
-        }
 
         // Directly encoded?
         if (paramValues[index] instanceof byte[])
@@ -354,9 +333,7 @@ class SimpleParameterList implements V3ParameterList {
 
         // Encoded string.
         if (encoded[index] == null)
-        {
             encoded[index] = Utils.encodeUTF8((String) paramValues[index]);
-        }
         pgStream.Send(encoded[index]);
     }
 

-- 
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