db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1465956 - in /db/derby/code/trunk/java/client/org/apache/derby/client: ./ am/ net/
Date Tue, 09 Apr 2013 10:11:30 GMT
Author: dag
Date: Tue Apr  9 10:11:30 2013
New Revision: 1465956

URL: http://svn.apache.org/r1465956
Log:
DERBY-6125 Code cleanup in client driver

Patch derby-6125-visibility-01-b; details

- limits visibility of many classes, methods and fields to what's
  necessary,

- adds final specification to ClobWriter#clob_ and

- removes ClientPooledConnection.getNetXAConnection by inlining its
  content in the one usage location.

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/ClientXid.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobLocatorWriter.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobOutputStream.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/EncryptionManager.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientPooledConnection.java Tue
Apr  9 10:11:30 2013
@@ -60,7 +60,8 @@ public class ClientPooledConnection impl
     private int eventIterators;
 
     org.apache.derby.client.am.Connection physicalConnection_ = null;
-    org.apache.derby.client.net.NetConnection netPhysicalConnection_ = null;
+    private org.apache.derby.client.net.NetConnection
+            netPhysicalConnection_ = null;
     org.apache.derby.client.net.NetXAConnection netXAPhysicalConnection_ = null;
 
     /**
@@ -72,11 +73,12 @@ public class ClientPooledConnection impl
 
     /** The logical connection using the physical connection. */
     //@GuardedBy("this")
-    org.apache.derby.client.am.LogicalConnection logicalConnection_ = null;
+    private org.apache.derby.client.am.LogicalConnection
+        logicalConnection_ = null;
 
     protected org.apache.derby.client.am.LogWriter logWriter_ = null;
 
-    /** Resource manager identificator. */
+    /** Resource manager identifier. */
     protected int rmId_ = 0;
 
     /**
@@ -159,11 +161,14 @@ public class ClientPooledConnection impl
         }
 
         try {
-            netXAPhysicalConnection_ = getNetXAConnection(ds,
-                    (NetLogWriter) logWriter_,
+            netXAPhysicalConnection_ = new NetXAConnection(
+                    (NetLogWriter)logWriter,
                     user,
                     password,
-                    rmId);
+                    ds,
+                    rmId,
+                    true,
+                    this);
         } catch ( SqlException se ) {
             throw se.getSQLException();
         }
@@ -188,7 +193,7 @@ public class ClientPooledConnection impl
 
     /**
      * Closes the physical connection to the data source and frees all
-     * assoicated resources.
+     * associated resources.
      * 
      * @throws SQLException if closing the connection causes an error. Note that
      *      this connection can still be considered closed even if an error
@@ -454,29 +459,4 @@ public class ClientPooledConnection impl
                     SQLException sqle) {
         
     }
-    
-    /**
-     * creates and returns NetXAConnection. 
-     * Overwrite this method to create different version of NetXAConnection
-     * @param ds 
-     * @param logWriter 
-     * @param user 
-     * @param password 
-     * @param rmId 
-     * @return NetXAConnection
-     */
-    protected NetXAConnection getNetXAConnection (ClientBaseDataSourceRoot ds,
-                                  NetLogWriter logWriter,
-                                  String user,
-                                  String password,
-                                  int rmId) throws SqlException {
-          return new NetXAConnection(logWriter,
-                    user,
-                    password,
-                    ds,
-                    rmId,
-                    true,
-                    this);
-        
-    }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/ClientXid.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/ClientXid.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/ClientXid.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/ClientXid.java Tue Apr  9 10:11:30
2013
@@ -64,7 +64,7 @@ public class ClientXid implements Xid {
     //
     // The maximum size of the branch qualifier.
     //
-    static public final int MAXBQUALSIZE = 64;
+    static private final int MAXBQUALSIZE = 64;
 
     static private final String hextab_ = "0123456789ABCDEF";
 
@@ -94,7 +94,7 @@ public class ClientXid implements Xid {
     }
 
     //
-    // Return a string representing this Xid for debuging
+    // Return a string representing this Xid for debugging
     //
     // @return the string representation of this Xid
     //
@@ -166,7 +166,6 @@ public class ClientXid implements Xid {
     //
     public void setFormatID(int formatID) {
         formatID_ = formatID;
-        return;
     }
 
     //

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClientJDBCObjectFactory.java
Tue Apr  9 10:11:30 2013
@@ -32,7 +32,7 @@ import org.apache.derby.jdbc.ClientBaseD
  *
  * The methods of this interface are used to return JDBC interface
  * implementations to the user depending on the JDBC version supported
- * by the jdk
+ * by the JDK.
  *
  */
 
@@ -185,7 +185,7 @@ public interface ClientJDBCObjectFactory
     
     
     /**
-     * Returns a new logcial prepared statement object.
+     * Returns a new logical prepared statement object.
      *
      * @param ps underlying physical prepared statement
      * @param stmtKey key for the underlying physical prepared statement

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobLocatorWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobLocatorWriter.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobLocatorWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobLocatorWriter.java Tue
Apr  9 10:11:30 2013
@@ -28,10 +28,10 @@ import java.io.IOException;
  * Clob value into the server.
  * <p>
  * This <code>Writer</code> implementation is pretty basic.  No
- * buffering of data is done.  Hence, for efficieny #write(char[])
+ * buffering of data is done.  Hence, for efficiency #write(char[])
  * should be used instead of #write(int).
  */
-public class ClobLocatorWriter extends java.io.Writer {
+class ClobLocatorWriter extends java.io.Writer {
     /**
      * Connection used to read Clob from server.
      */
@@ -67,7 +67,7 @@ public class ClobLocatorWriter extends j
      *        to start writing; the first position is 1
      * @throws org.apache.derby.client.am.SqlException
      */
-    public ClobLocatorWriter(Connection connection, Clob clob, long pos)
+    ClobLocatorWriter(Connection connection, Clob clob, long pos)
     throws SqlException {
         if (pos-1 > clob.sqlLength()) {
             throw new IndexOutOfBoundsException();

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobOutputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobOutputStream.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobOutputStream.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobOutputStream.java Tue Apr
 9 10:11:30 2013
@@ -22,11 +22,12 @@
 package org.apache.derby.client.am;
 
 
-public class ClobOutputStream extends java.io.OutputStream {
+
+class ClobOutputStream extends java.io.OutputStream {
     private Clob clob_;
     private long offset_;
 
-    public ClobOutputStream(Clob clob, long offset) throws SqlException {
+    ClobOutputStream(Clob clob, long offset) throws SqlException {
         clob_ = clob;
         offset_ = offset;
         

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ClobWriter.java Tue Apr  9
10:11:30 2013
@@ -24,14 +24,11 @@ package org.apache.derby.client.am;
 import org.apache.derby.shared.common.reference.SQLState;
 
 
-public class ClobWriter extends java.io.Writer {
-    private Clob clob_;
+class ClobWriter extends java.io.Writer {
+    private final Clob clob_;
     private long offset_;
 
-    public ClobWriter() {
-    }
-
-    public ClobWriter(Clob clob, long offset) throws SqlException {
+    ClobWriter(Clob clob, long offset) throws SqlException {
         clob_ = clob;
         offset_ = offset;
 

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Connection.java Tue Apr  9
10:11:30 2013
@@ -214,10 +214,9 @@ public abstract class Connection
     }
 
     // For jdbc 2 connections
-    protected void initConnection(
-            org.apache.derby.client.am.LogWriter logWriter,
-            org.apache.derby.jdbc.ClientBaseDataSourceRoot dataSource)
-            throws SqlException {
+    private void initConnection(
+            LogWriter logWriter,
+            ClientBaseDataSourceRoot dataSource) throws SqlException {
 
         if (logWriter != null) {
             logWriter.traceConnectEntry(dataSource);

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java Tue Apr  9 10:11:30
2013
@@ -218,7 +218,7 @@ public abstract class Cursor {
         return allRowsReceivedFromServer_;
     }
 
-    public final boolean currentRowPositionIsEqualToNextRowPosition() {
+    final boolean currentRowPositionIsEqualToNextRowPosition() {
         return (currentRowPosition_ == nextRowPosition_);
     }
 
@@ -235,7 +235,7 @@ public abstract class Cursor {
         dataBufferStream_.reset();
     }
 
-    public final boolean dataBufferHasUnprocessedData() {
+    final boolean dataBufferHasUnprocessedData() {
         return (lastValidBytePosition_ - position_) > 0;
     }
 
@@ -1096,8 +1096,7 @@ public abstract class Cursor {
         }
     }
 
-    public final java.io.InputStream getBinaryStream(int column) 
-            throws SqlException 
+    final java.io.InputStream getBinaryStream(int column) throws SqlException
     {
         switch (jdbcTypes_[column - 1]) {
             case java.sql.Types.BINARY:
@@ -1119,8 +1118,7 @@ public abstract class Cursor {
         }
     }
 
-    public final java.io.InputStream getAsciiStream(int column) 
-            throws SqlException
+    final java.io.InputStream getAsciiStream(int column) throws SqlException
     {
         switch (jdbcTypes_[column - 1]) {
             case java.sql.Types.CLOB:
@@ -1210,7 +1208,7 @@ public abstract class Cursor {
         }
     }
 
-    public final java.io.Reader getCharacterStream(int column) 
+    final java.io.Reader getCharacterStream(int column)
             throws SqlException 
     {
         switch (jdbcTypes_[column - 1]) {
@@ -1259,7 +1257,7 @@ public abstract class Cursor {
             }
     }
 
-    public final java.sql.Blob getBlob(int column) throws SqlException {
+    final java.sql.Blob getBlob(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
         case Types.BLOB:
             return getBlobColumn_(column, agent_, true);
@@ -1268,7 +1266,7 @@ public abstract class Cursor {
         }
     }
 
-    public final java.sql.Clob getClob(int column) throws SqlException {
+    final java.sql.Clob getClob(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
         case Types.CLOB:
             return getClobColumn_(column, agent_, true);
@@ -1277,18 +1275,18 @@ public abstract class Cursor {
         }
     }
 
-    public final java.sql.Array getArray(int column) throws SqlException {
+    final java.sql.Array getArray(int column) throws SqlException {
         throw new SqlException(agent_.logWriter_, 
             new ClientMessageId (SQLState.NOT_IMPLEMENTED),
             "getArray(int)");
     }
 
-    public final java.sql.Ref getRef(int column) throws SqlException {
+    final java.sql.Ref getRef(int column) throws SqlException {
         throw new SqlException(agent_.logWriter_, 
             new ClientMessageId (SQLState.NOT_IMPLEMENTED), "getRef(int)");
     }
 
-    public final Object getObject(int column) throws SqlException {
+    final Object getObject(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
         case java.sql.Types.BOOLEAN:
             return get_BOOLEAN(column);
@@ -1350,7 +1348,7 @@ public abstract class Cursor {
         charBuffer_ = new char[maxCharLength];
     }
 
-    private final String getStringWithoutConvert(int position, int actualLength) {
+    private String getStringWithoutConvert(int position, int actualLength) {
         int start = position;
         int end = position + actualLength;
 
@@ -1388,11 +1386,11 @@ public abstract class Cursor {
         charBuffer_ = null;
     }
 
-    private final int getColumnPrecision(int column) {
+    private int getColumnPrecision(int column) {
         return ((fdocaLength_[column] >> 8) & 0xff);
     }
 
-    private final int getColumnScale(int column) {
+    private int getColumnScale(int column) {
         return (fdocaLength_[column] & 0xff);
     }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/EncryptionManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/EncryptionManager.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/EncryptionManager.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/EncryptionManager.java Tue
Apr  9 10:11:30 2013
@@ -40,7 +40,8 @@ import org.apache.derby.shared.common.sa
 // This class also have methods for the SECMEC_USRSSBPWD security mechanism.
 
 public class EncryptionManager {
-    transient Agent agent_; // for obtaining an exception log writer only
+     // for obtaining an exception log writer only
+    private transient Agent agent_;
 
     // PROTOCOL's Diffie-Hellman agreed public value: prime.
     private static final byte modulusBytes__[] = {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/LogWriter.java Tue Apr  9 10:11:30
2013
@@ -76,7 +76,7 @@ public class LogWriter {
 
     // ---------------------------------------------------------------------------
 
-    public void dncprintln(String s) {
+    private void dncprintln(String s) {
         synchronized (printWriter_) {
             printWriter_.println("[derby] " + s);
             printWriter_.flush();
@@ -231,58 +231,66 @@ public class LogWriter {
         }
     }
 
-    public void traceExit(Object instance, String methodName, ResultSet resultSet) {
+    void traceExit(Object instance, String methodName, ResultSet resultSet) {
         String returnValue = (resultSet == null) ? "ResultSet@null" : "ResultSet@" + Integer.toHexString(resultSet.hashCode());
         traceExit(instance, methodName, returnValue);
     }
 
-    public void traceExit(Object instance, String methodName, CallableStatement returnValue)
{
+    void traceExit(
+            Object instance,
+            String methodName,
+            CallableStatement returnValue) {
+
         traceExit(instance, methodName, "CallableStatement@" + Integer.toHexString(returnValue.hashCode()));
     }
 
-    public void traceExit(Object instance, String methodName, PreparedStatement returnValue)
{
+    void traceExit(
+            Object instance,
+            String methodName,
+            PreparedStatement returnValue) {
+
         traceExit(instance, methodName, "PreparedStatement@" + Integer.toHexString(returnValue.hashCode()));
     }
 
-    public void traceExit(Object instance, String methodName, Statement returnValue) {
+    void traceExit(Object instance, String methodName, Statement returnValue) {
         traceExit(instance, methodName, "Statement@" + Integer.toHexString(returnValue.hashCode()));
     }
 
-    public void traceExit(Object instance, String methodName, Blob blob) {
+    void traceExit(Object instance, String methodName, Blob blob) {
         String returnValue = (blob == null) ? "Blob@null" : "Blob@" + Integer.toHexString(blob.hashCode());
         traceExit(instance, methodName, returnValue);
     }
 
-    public void traceExit(Object instance, String methodName, Clob clob) {
+    void traceExit(Object instance, String methodName, Clob clob) {
         String returnValue = (clob == null) ? "Clob@null" : "Clob@" + Integer.toHexString(clob.hashCode());
         traceExit(instance, methodName, returnValue);
     }
 
-    public void traceExit(Object instance, String methodName, DatabaseMetaData returnValue)
{
+    void traceExit(
+            Object instance,
+            String methodName,
+            DatabaseMetaData returnValue) {
+
         traceExit(instance, methodName, "DatabaseMetaData@" + Integer.toHexString(returnValue.hashCode()));
     }
 
-    public void traceExit(Object instance, String methodName, Connection returnValue) {
+    void traceExit(Object instance, String methodName, Connection returnValue) {
         traceExit(instance, methodName, "Connection@" + Integer.toHexString(returnValue.hashCode()));
     }
 
-    public void traceExit(Object instance, String methodName, ColumnMetaData returnValue)
{
+    void traceExit(
+            Object instance,
+            String methodName,
+            ColumnMetaData returnValue) {
+
         traceExit(instance, methodName, "MetaData@" + (returnValue != null ? Integer.toHexString(returnValue.hashCode())
: null));
     }
 
-    public void traceExit(Object instance, String methodName, byte[] returnValue) {
+    void traceExit(Object instance, String methodName, byte[] returnValue) {
         traceExit(instance, methodName, Utils.getStringFromBytes(returnValue));
     }
 
-    public void traceExit(Object instance, String methodName, int[] returnValue) {
-        traceExit(instance, methodName, Utils.getStringFromInts(returnValue));
-    }
-
-    public void traceDeprecatedExit(Object instance, String methodName, byte[] returnValue)
{
-        traceDeprecatedExit(instance, methodName, Utils.getStringFromBytes(returnValue));
-    }
-
-    public void traceExit(Object instance, String methodName, byte returnValue) {
+    void traceExit(Object instance, String methodName, byte returnValue) {
         traceExit(instance, methodName, "0x" + Integer.toHexString(returnValue & 0xff));
     }
 
@@ -294,15 +302,15 @@ public class LogWriter {
         traceExit(instance, methodName, String.valueOf(returnValue));
     }
 
-    public void traceExit(Object instance, String methodName, long returnValue) {
+    void traceExit(Object instance, String methodName, long returnValue) {
         traceExit(instance, methodName, String.valueOf(returnValue));
     }
 
-    public void traceExit(Object instance, String methodName, float returnValue) {
+    void traceExit(Object instance, String methodName, float returnValue) {
         traceExit(instance, methodName, String.valueOf(returnValue));
     }
 
-    public void traceExit(Object instance, String methodName, double returnValue) {
+    void traceExit(Object instance, String methodName, double returnValue) {
         traceExit(instance, methodName, String.valueOf(returnValue));
     }
 
@@ -345,7 +353,7 @@ public class LogWriter {
                 "(" + argument + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, boolean argument) {
+    void traceEntry(Object instance, String methodName, boolean argument) {
         traceEntryAllArgs(instance, methodName,
                 "(" + argument + ")");
     }
@@ -355,12 +363,20 @@ public class LogWriter {
                 "(" + argument + ")");
     }
 
-    public void traceDeprecatedEntry(Object instance, String methodName, int argument) {
+    void traceDeprecatedEntry(
+            Object instance,
+            String methodName,
+            int argument) {
+
         traceDeprecatedEntryAllArgs(instance, methodName,
                 "(" + argument + ")");
     }
 
-    public void traceDeprecatedEntry(Object instance, String methodName, Object argument)
{
+    void traceDeprecatedEntry(
+            Object instance,
+            String methodName,
+            Object argument) {
+
         traceDeprecatedEntryAllArgs(instance, methodName,
                 "(" + argument + ")");
     }
@@ -372,72 +388,102 @@ public class LogWriter {
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, Object arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, Object arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, byte[] arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, byte[] arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + Utils.getStringFromBytes(arg2) + ")");
     }
 
-    public void traceDeprecatedEntry(Object instance, String methodName, int arg1, int arg2)
{
+    void traceDeprecatedEntry(
+            Object instance,
+            String methodName,
+            int arg1,
+            int arg2) {
+
         traceDeprecatedEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceDeprecatedEntry(Object instance, String methodName, Object arg1, int
arg2) {
+    void traceDeprecatedEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            int arg2) {
+
         traceDeprecatedEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, boolean arg2) {
+    void traceEntry(
+            Object instance,
+            String methodName,
+            int arg1,
+            boolean arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, byte arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, byte arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", 0x" + Integer.toHexString(arg2 & 0xff) + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, short arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, short arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, int arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, int arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, long arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, long arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, float arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, float arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, int arg1, double arg2) {
+    void traceEntry(Object instance, String methodName, int arg1, double arg2) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, boolean arg2)
{
+    public void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            boolean arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, byte arg2) {
+    void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            byte arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", 0x" + Integer.toHexString(arg2 & 0xff) + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, short arg2) {
+    void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            short arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
@@ -447,116 +493,119 @@ public class LogWriter {
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, long arg2) {
+    void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            long arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, float arg2) {
+    void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            float arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName, Object arg1, double arg2)
{
+    void traceEntry(
+            Object instance,
+            String methodName,
+            Object arg1,
+            double arg2) {
+
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ")");
     }
 
     // ---------------------- trace entry of methods w/ 3 args -------------------
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, Object arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, Object arg2, Object arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, int arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, Object arg2, int arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceDeprecatedEntry(Object instance, String methodName,
+    void traceDeprecatedEntry(Object instance, String methodName,
                                      int arg1, Object arg2, int arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, int arg2, Object arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, int arg2, int arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, int arg2, int arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, int arg2, Object arg3) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
-                           Object arg1, boolean arg2, boolean arg3) {
-        traceEntryAllArgs(instance, methodName,
-                "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
-    }
-
-    public void traceEntry(Object instance, String methodName,
-                           Object arg1, boolean arg2, int arg3) {
-        traceEntryAllArgs(instance, methodName,
-                "(" + arg1 + ", " + arg2 + ", " + arg3 + ")");
-    }
-
     // ---------------------- trace entry of methods w/ 4 args -------------------
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, Object arg3, Object arg4) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, Object arg2, Object arg3, Object arg4) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            int arg1, Object arg2, int arg3, int arg4) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, int arg2, int arg3, int arg4) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, int arg3, int arg4) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ")");
@@ -564,13 +613,13 @@ public class LogWriter {
 
     // ---------------------- trace entry of methods w/ 5 args -------------------
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, Object arg3, int arg4, boolean arg5)
{
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ", " + arg5 + ")");
     }
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, Object arg3, boolean arg4, boolean arg5)
{
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ", " + arg5 + ")");
@@ -578,7 +627,7 @@ public class LogWriter {
 
     // ---------------------- trace entry of methods w/ 6 args -------------------
 
-    public void traceEntry(Object instance, String methodName,
+    void traceEntry(Object instance, String methodName,
                            Object arg1, Object arg2, Object arg3, Object arg4, Object arg5,
Object arg6) {
         traceEntryAllArgs(instance, methodName,
                 "(" + arg1 + ", " + arg2 + ", " + arg3 + ", " + arg4 + ", " + arg5 + ", "
+ arg6 + ")");
@@ -586,7 +635,7 @@ public class LogWriter {
 
     // ---------------------------tracing exceptions and warnings-----------------
 
-    public void traceDiagnosable(SqlException e) {
+    void traceDiagnosable(SqlException e) {
         if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
             return;
         }
@@ -607,7 +656,7 @@ public class LogWriter {
         }
     }
 
-    public void traceDiagnosable(javax.transaction.xa.XAException e) {
+    void traceDiagnosable(javax.transaction.xa.XAException e) {
         if (!loggingEnabled(ClientDataSourceInterface.TRACE_DIAGNOSTICS)) {
             return;
         }
@@ -619,7 +668,10 @@ public class LogWriter {
     }
     // ------------------------ meta data tracing --------------------------------
 
-    public void traceParameterMetaData(Statement statement, ColumnMetaData columnMetaData)
{
+    void traceParameterMetaData(
+            Statement statement,
+            ColumnMetaData columnMetaData) {
+
         if (!loggingEnabled(
                 ClientDataSourceInterface.TRACE_PARAMETER_META_DATA) ||
                 columnMetaData == null) {
@@ -640,7 +692,10 @@ public class LogWriter {
         }
     }
 
-    public void traceResultSetMetaData(Statement statement, ColumnMetaData columnMetaData)
{
+    void traceResultSetMetaData(
+            Statement statement,
+            ColumnMetaData columnMetaData) {
+
         if (!loggingEnabled(
                 ClientDataSourceInterface.TRACE_RESULT_SET_META_DATA) ||
                 columnMetaData == null) {
@@ -721,7 +776,7 @@ public class LogWriter {
     // Including protocol manager levels, and driver configuration
 
     // Jdbc 2
-    public void traceConnectEntry(ClientBaseDataSourceRoot dataSource) {
+    void traceConnectEntry(ClientBaseDataSourceRoot dataSource) {
         if (loggingEnabled(
                 ClientDataSourceInterface.TRACE_DRIVER_CONFIGURATION)) {
             traceDriverConfigurationJdbc2();
@@ -732,7 +787,7 @@ public class LogWriter {
     }
 
     // Jdbc 1
-    public void traceConnectEntry(String server,
+    void traceConnectEntry(String server,
                                   int port,
                                   String database,
                                   java.util.Properties properties) {
@@ -745,7 +800,7 @@ public class LogWriter {
         }
     }
 
-    public void traceConnectResetEntry(
+    void traceConnectResetEntry(
             Object instance, LogWriter logWriter,
             String user, ClientBaseDataSourceRoot ds) {
 
@@ -755,7 +810,7 @@ public class LogWriter {
         }
     }
 
-    public void traceConnectExit(Connection connection) {
+    void traceConnectExit(Connection connection) {
         if (loggingEnabled(ClientDataSourceInterface.TRACE_CONNECTS)) {
             traceConnectsExit(connection);
         }
@@ -837,7 +892,7 @@ public class LogWriter {
         }
     }
 
-    public void traceConnectsResetExit(org.apache.derby.client.am.Connection c) {
+    public void traceConnectsResetExit(Connection c) {
         synchronized (printWriter_) {
             String header = "[Connection@" + Integer.toHexString(c.hashCode()) + "]";
             try {
@@ -904,8 +959,8 @@ public class LogWriter {
         }
     }
 
-    public void writeDriverConfiguration() {
-        org.apache.derby.client.am.Version.writeDriverConfiguration(printWriter_);
+    private void writeDriverConfiguration() {
+        Version.writeDriverConfiguration(printWriter_);
     }
 
     public static java.io.PrintWriter getPrintWriter(final String fileName, final boolean
fileAppend) throws SqlException {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Section.java Tue Apr  9 10:11:30
2013
@@ -21,16 +21,23 @@ package org.apache.derby.client.am;
 
 public class Section {
 
-    protected int sectionNumber;
-    protected String packageName;
-    protected String serverCursorName; // As given by dnc package set
-    int resultSetHoldability_;
+    private int sectionNumber;
+    private String packageName;
+    private String serverCursorName; // As given by dnc package set
+    private int resultSetHoldability_;
 
     // Stores the package name and consistency token
-    byte[] PKGNAMCBytes;
-    boolean isGenerated; // flag to identify server generated sections
+    private byte[] PKGNAMCBytes;
+    private boolean isGenerated; // flag to identify server generated sections
 
-    public Section(Agent agent, String name, int sectionNumber, String cursorName, int resultSetHoldability)
{
+    private Agent agent_;
+
+
+    Section(Agent agent,
+            String name,
+            int sectionNumber,
+            String cursorName,
+            int resultSetHoldability) {
         // default for all sections except for generated section , isGenerated is set to
false
         init(agent, name, sectionNumber, cursorName, resultSetHoldability, false);
     }
@@ -112,15 +119,18 @@ public class Section {
         return this.serverCursorName;
     }
 
-    // ------------------------ transient members --------------------------------
-
-    public String serverCursorNameForPositionedUpdate_ = null; // member for positioned update
sections only
-    transient protected String clientCursorName_; // As given by jdbc setCursorName(), this
can change
+    // member for positioned update sections only
+    String serverCursorNameForPositionedUpdate_ = null;
 
     public String getServerCursorNameForPositionedUpdate() {
         return serverCursorNameForPositionedUpdate_;
     }
 
+    // ------------------------ transient members --------------------------------
+
+    // As given by jdbc setCursorName(), this can change
+    transient private String clientCursorName_;
+
     public String getClientCursorName() {
         return clientCursorName_;
     }
@@ -130,10 +140,7 @@ public class Section {
         this.clientCursorName_ = clientCursorName;
     }
 
-    protected Agent agent_;
-
-
-    public void free() {
+    void free() {
         if (resultSetHoldability_ != -1) {
             this.agent_.sectionManager_.freeSection(this, resultSetHoldability_);
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveBlobLocatorInputStream.java
Tue Apr  9 10:11:30 2013
@@ -31,7 +31,7 @@ import java.io.InputStream;
  * which re-creates the underlying Blob locator stream whenever a
  * update happens on the Blob object associated with this stream.
  */
-public class UpdateSensitiveBlobLocatorInputStream 
+class UpdateSensitiveBlobLocatorInputStream
         extends UpdateSensitiveLOBLocatorInputStream {
     //Stores the Blob instance associated with
     //this InputStream.
@@ -50,7 +50,7 @@ public class UpdateSensitiveBlobLocatorI
      * @throws SqlException If any exception occurs during stream
      *                      creation.
      */
-    public UpdateSensitiveBlobLocatorInputStream(Connection con, Blob blob)
+    UpdateSensitiveBlobLocatorInputStream(Connection con, Blob blob)
     throws SqlException {
         super(con, blob, new BlobLocatorInputStream(con, blob));
         this.blob = blob;
@@ -71,7 +71,7 @@ public class UpdateSensitiveBlobLocatorI
      * @throws SqlException If any exception occurs during stream
      *                      creation.
      */
-    public UpdateSensitiveBlobLocatorInputStream(Connection con, Blob blob,
+    UpdateSensitiveBlobLocatorInputStream(Connection con, Blob blob,
             long position, long length) throws SqlException {
         super(con, blob, 
                 new BlobLocatorInputStream(con, blob, position, length), 
@@ -88,7 +88,7 @@ public class UpdateSensitiveBlobLocatorI
      *                      re-creating the underlying streams.
      */
     protected InputStream reCreateStream() throws SqlException {
-        InputStream is_ = null;
+        InputStream is_;
         
         //Verify if a subset of the underlying
         //LOB data was requested.

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveClobLocatorInputStream.java
Tue Apr  9 10:11:30 2013
@@ -31,7 +31,7 @@ import java.io.InputStream;
  * which re-creates the underlying Clob locator stream whenever a
  * update happens on the Clob object associated with this stream.
  */
-public class UpdateSensitiveClobLocatorInputStream 
+class UpdateSensitiveClobLocatorInputStream
         extends UpdateSensitiveLOBLocatorInputStream {
     //Stores the Clob instance associated with
     //this InputStream.
@@ -50,7 +50,7 @@ public class UpdateSensitiveClobLocatorI
      * @throws SqlException If any exception occurs during stream
      *                      creation.
      */
-    public UpdateSensitiveClobLocatorInputStream(Connection con, Clob clob)
+    UpdateSensitiveClobLocatorInputStream(Connection con, Clob clob)
     throws SqlException {
         super(con, clob, new BufferedInputStream
                 (new ClobLocatorInputStream(con, clob)));

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/UpdateSensitiveLOBLocatorInputStream.java
Tue Apr  9 10:11:30 2013
@@ -36,7 +36,7 @@ import java.io.InputStream;
  * streams.
  *
  */
-public abstract class UpdateSensitiveLOBLocatorInputStream extends InputStream {
+abstract class UpdateSensitiveLOBLocatorInputStream extends InputStream {
     //The ClobLocatorInputStream or
     //BlobLocatorInputStream instance
     //wrapped inside a BufferedInputStream
@@ -208,7 +208,6 @@ public abstract class UpdateSensitiveLOB
         } else {
             //The underlying LOB value is
             //the same. Hence do nothing.
-            return;
         }
     }
     

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java?rev=1465956&r1=1465955&r2=1465956&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java
(original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/ClientJDBCObjectFactoryImpl40.java
Tue Apr  9 10:11:30 2013
@@ -113,6 +113,7 @@ public class ClientJDBCObjectFactoryImpl
         return new CallableStatement40(agent,connection,sql,type,concurrency,
                 holdability,cpc);
     }
+
     /**
      * Returns an instance of LogicalConnection.
      * This method returns an instance of LogicalConnection
@@ -199,7 +200,7 @@ public class ClientJDBCObjectFactoryImpl
     }
 
     /**
-     * Returns a new logcial prepared statement object.
+     * Returns a new logical prepared statement object.
      *
      * @param ps underlying physical prepared statement
      * @param stmtKey key for the underlying physical prepared statement
@@ -273,6 +274,7 @@ public class ClientJDBCObjectFactoryImpl
         (new NetConnection40((NetLogWriter)netLogWriter,user,password,dataSource,
                 rmId,isXAConn));
     }
+
     /**
      * returns an instance of org.apache.derby.client.net.NetConnection40
      */



Mime
View raw message