db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1477476 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql: compile/CreateViewNode.java depend/BasicDependencyManager.java depend/BasicProviderInfo.java
Date Tue, 30 Apr 2013 05:34:03 GMT
Author: kahatlen
Date: Tue Apr 30 05:34:02 2013
New Revision: 1477476

URL: http://svn.apache.org/r1477476
Log:
DERBY-6169: Reduce visibility of classes and methods under impl/sql

- Make all fields of CreateViewNode and BasicProviderInfo private.

- Make BasicProviderInfo's constructor package private.

- Make CreateViewNode.getProviderInfo() return an immutable list
  instead of the actual array to prevent accidental modification by
  the caller.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicProviderInfo.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java?rev=1477476&r1=1477475&r2=1477476&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CreateViewNode.java
Tue Apr 30 05:34:02 2013
@@ -21,11 +21,12 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.compile.Visitable;
+import java.util.List;
+
 import org.apache.derby.iapi.sql.compile.Visitor;
 
 import org.apache.derby.iapi.services.context.ContextManager;
-
+import org.apache.derby.iapi.services.io.ArrayUtil;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 
 import org.apache.derby.iapi.error.StandardException;
@@ -38,11 +39,9 @@ import org.apache.derby.iapi.sql.conn.Au
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 
 import org.apache.derby.iapi.sql.depend.DependencyManager;
-import org.apache.derby.iapi.sql.depend.Dependent;
 import org.apache.derby.iapi.sql.depend.ProviderInfo;
 import org.apache.derby.iapi.sql.depend.ProviderList;
 
@@ -62,12 +61,12 @@ import org.apache.derby.catalog.UUID;
 
 public class CreateViewNode extends DDLStatementNode
 {
-	ResultColumnList	resultColumns;
-	ResultSetNode		queryExpression;
-	String				qeText;
-	int					checkOption;
-	ProviderInfo[]		providerInfos;
-	ColumnInfo[]		colInfos;
+    private ResultColumnList resultColumns;
+    private ResultSetNode    queryExpression;
+    private String           qeText;
+    private int              checkOption;
+    private ProviderInfo[]   providerInfos;
+    private ColumnInfo[]     colInfos;
 	private OrderByList orderByList;
     private ValueNode   offset;
     private ValueNode   fetchFirst;
@@ -167,7 +166,9 @@ public class CreateViewNode extends DDLS
 
 	// accessors
 
-	public	ProviderInfo[]	getProviderInfo() { return providerInfos; }
+    public final List getProviderInfo() {
+        return ArrayUtil.asReadOnlyList(colInfos);
+    }
 
 	// We inherit the generate() method from DDLStatementNode.
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java?rev=1477476&r1=1477475&r2=1477476&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicDependencyManager.java
Tue Apr 30 05:34:02 2013
@@ -377,17 +377,18 @@ public class BasicDependencyManager impl
 							// need a current dependent for bind
 							newCC.setCurrentDependent(dep);
 							cvn.bindStatement();
-							ProviderInfo[] providerInfos = cvn.getProviderInfo();
 							lcc.popCompilerContext(newCC);
 
 							boolean		interferent = false;
-							for (int i = 0; i < providerInfos.length; i++)
+
+                            Iterator it = cvn.getProviderInfo().iterator();
+                            while (it.hasNext())
 							{
-								Provider provider = null;
-									provider = (Provider) providerInfos[i].
+                                ProviderInfo info = (ProviderInfo) it.next();
+                                Provider provider = (Provider) info.
 													getDependableFinder().
 													getDependable(dd,
-													providerInfos[i].getObjectId());
+                                                    info.getObjectId());
 								if (provider instanceof TableDescriptor)
 								{
 									TableDescriptor tab = (TableDescriptor)provider;

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicProviderInfo.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicProviderInfo.java?rev=1477476&r1=1477475&r2=1477476&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicProviderInfo.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/depend/BasicProviderInfo.java
Tue Apr 30 05:34:02 2013
@@ -55,9 +55,9 @@ public class BasicProviderInfo implement
 	**
 	********************************************************/
 
-	public	UUID						uuid;
-	public	DependableFinder			dFinder;
-	public	String						providerName;
+    private UUID             uuid;
+    private DependableFinder dFinder;
+    private String           providerName;
 
 	// CONSTRUCTORS
 
@@ -74,7 +74,7 @@ public class BasicProviderInfo implement
 	 *  @param dFinder		DependableFinder for Provider.
 	 *	@param providerName	Name of the Provider.
 	 */
-	public	BasicProviderInfo(
+    BasicProviderInfo(
 		               UUID				uuid,
 					   DependableFinder	dFinder,
 					   String			providerName)



Mime
View raw message