db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1471087 - in /db/derby/code/trunk/java: engine/org/apache/derby/vti/ tools/org/apache/derby/impl/tools/ij/ tools/org/apache/derby/impl/tools/planexporter/ tools/org/apache/derby/tools/
Date Tue, 23 Apr 2013 18:42:44 GMT
Author: rhillegas
Date: Tue Apr 23 18:42:44 2013
New Revision: 1471087

URL: http://svn.apache.org/r1471087
Log:
DERBY-6197: Cleanup various encapsulation problems.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/vti/ForeignTableVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
    db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
    db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/vti/ForeignTableVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/vti/ForeignTableVTI.java?rev=1471087&r1=1471086&r2=1471087&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/ForeignTableVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/ForeignTableVTI.java Tue Apr 23 18:42:44
2013
@@ -41,6 +41,7 @@ import java.util.Calendar;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.util.IdUtil;
 
 /**
@@ -315,7 +316,7 @@ public	class   ForeignTableVTI extends V
         ( String[] columnNames, Restriction restriction )
         throws SQLException
     {
-        _columnNames = columnNames;
+        _columnNames = ArrayUtil.copy( columnNames );
         _restriction = restriction;
 
         int columnCount = _columnNames.length;
@@ -324,7 +325,7 @@ public	class   ForeignTableVTI extends V
         int foreignColumnID = 1;
         for ( int i = 0; i < columnCount; i++ )
         {
-            if ( columnNames[ i ] != null ) { _columnNumberMap[ i ] = foreignColumnID++;
}
+            if ( _columnNames[ i ] != null ) { _columnNumberMap[ i ] = foreignColumnID++;
}
         }
     }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java?rev=1471087&r1=1471086&r2=1471087&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java Tue Apr 23 18:42:44
2013
@@ -34,6 +34,7 @@ import java.sql.Timestamp;
 import java.text.DateFormat;
 import java.text.ParseException;
 
+import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.types.HarmonySerialBlob;
 import org.apache.derby.iapi.types.HarmonySerialClob;
 
@@ -100,7 +101,7 @@ public  abstract    class   StringColumn
      */
     public  StringColumnVTI( String[] columnNames )
     {
-        _columnNames = columnNames;
+        _columnNames = ArrayUtil.copy( columnNames );
     }
     
     ///////////////////////////////////////////////////////////////////////////////////

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java?rev=1471087&r1=1471086&r2=1471087&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/ij/utilMain.java Tue Apr 23
18:42:44 2013
@@ -269,7 +269,7 @@ public class utilMain implements java.se
 	  //check if the property is set to not show select count and set the static variable
         //accordingly. 
         boolean showNoCountForSelect = Boolean.valueOf(util.getSystemProperty("ij.showNoCountForSelect")).booleanValue();
-        JDBCDisplayUtil.showSelectCount = !showNoCountForSelect;
+        JDBCDisplayUtil.setShowSelectCount( !showNoCountForSelect );
 
         //check if the property is set to not show initial connections and accordingly set
the
         //static variable.

Modified: db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java?rev=1471087&r1=1471086&r2=1471087&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
(original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/impl/tools/planexporter/AccessDatabase.java
Tue Apr 23 18:42:44 2013
@@ -27,6 +27,8 @@ import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.apache.derby.iapi.tools.ToolUtils;
+
 /**
  * This class will perform the database connection establishment,
  * querying the database, shut downing the database.
@@ -581,6 +583,6 @@ public class AccessDatabase {
      * @return data array of TreeNode Objects
      */
     public TreeNode[] getData() {
-        return data;
+        return (TreeNode[]) ToolUtils.copy( data );
     }
 }

Modified: db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java?rev=1471087&r1=1471086&r2=1471087&view=diff
==============================================================================
--- db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java (original)
+++ db/derby/code/trunk/java/tools/org/apache/derby/tools/JDBCDisplayUtil.java Tue Apr 23
18:42:44 2013
@@ -62,7 +62,7 @@ public class JDBCDisplayUtil {
 	// used to control display
 	static final private int MINWIDTH = 4;
 	static private int maxWidth = 128;
-    static public boolean showSelectCount = false;
+    static private boolean showSelectCount = false;
 
     static {
         // initialize the locale support functions to default value of JVM 
@@ -70,6 +70,12 @@ public class JDBCDisplayUtil {
     }
 
 	//-----------------------------------------------------------------
+	// Accessors
+
+    public  static  boolean getShowSelectCount() { return showSelectCount; }
+    public  static  void    setShowSelectCount( boolean newValue ) { showSelectCount = newValue;
}
+
+	//-----------------------------------------------------------------
 	// Methods for displaying and checking errors
 
 	/**



Mime
View raw message