db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r543057 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile: AggregateNode.java CastNode.java NewInvocationNode.java QueryTreeNode.java StaticClassFieldReferenceNode.java StaticMethodCallNode.java
Date Thu, 31 May 2007 04:57:59 GMT
Author: djd
Date: Wed May 30 21:57:58 2007
New Revision: 543057

URL: http://svn.apache.org/viewvc?view=rev&rev=543057
Log:
Minor cleanup of QueryTreeNode.verifyClassName() to remove old code and comments
that was related to the old non-standard class aliases.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NewInvocationNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/AggregateNode.java Wed
May 30 21:57:58 2007
@@ -423,7 +423,7 @@
 	*/
 	private void checkAggregatorClassName(String className) throws StandardException
 	{
-		className = verifyClassExist(className, false);
+		verifyClassExist(className);
 
 		if (!classInspector.assignableTo(className, "org.apache.derby.iapi.sql.execute.ExecAggregator"))
 		{
@@ -446,7 +446,7 @@
 		if (theClass == null)
 		{
 			String aggClassName = aggregateDefinitionClassName;
-			aggClassName = verifyClassExist(aggClassName, false);
+			verifyClassExist(aggClassName);
 
 			try
 			{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/CastNode.java Wed May
30 21:57:58 2007
@@ -376,11 +376,9 @@
 		*/
 		if (destCTI.userType())
 		{
-			String className = ((TypeId) dataTypeServices.getTypeId()).getCorrespondingJavaTypeName();
+			String className = dataTypeServices.getTypeId().getCorrespondingJavaTypeName();
 
-			boolean convertCase = ! destCTI.getClassNameWasDelimitedIdentifier();
-
-			className = verifyClassExist(className, convertCase);
+			verifyClassExist(className);
 
 			castTarget = new DataTypeDescriptor(TypeId.getUserDefinedTypeId(className, false),
 														true /* assume nullable for now, change it if not nullable */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NewInvocationNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NewInvocationNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NewInvocationNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/NewInvocationNode.java
Wed May 30 21:57:58 2007
@@ -253,7 +253,7 @@
 	{
 		bindParameters(fromList, subqueryList, aggregateVector);
 
-		javaClassName = verifyClassExist(javaClassName, !delimitedIdentifier);
+		verifyClassExist(javaClassName);
 		/*
 		** Get the parameter type names out of the parameters and put them
 		** in an array.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/QueryTreeNode.java Wed
May 30 21:57:58 2007
@@ -1436,26 +1436,18 @@
 	}
 
 	/**
-	 * 
+	 * Verify that a java class exists, is accessible (public)
+     * and not a class representing a primitive type.
 	 * @param javaClassName	The name of the java class to resolve.
 	 *
-	 * @param convertCase	whether to convert the case before resolving class alias.
-	 *
-	 * @return	Resolved class name or class alias name.
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	String verifyClassExist(String javaClassName, boolean convertCase)
+	void verifyClassExist(String javaClassName)
 		throws StandardException
 	{
-		/* Verify that the class exists */
-
 		ClassInspector classInspector = getClassFactory().getClassInspector();
 
-		/* We first try to resolve the javaClassName as a class.  If that
-		 * fails then we try to resolve it as a class alias.
-		 */
-
 		Throwable reason = null;
 		boolean foundMatch = false;
 		try {
@@ -1472,8 +1464,6 @@
 
 		if (ClassInspector.primitiveType(javaClassName))
 			throw StandardException.newException(SQLState.LANG_TYPE_DOESNT_EXIST3, javaClassName);
-
-		return javaClassName;
 	}
 
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticClassFieldReferenceNode.java
Wed May 30 21:57:58 2007
@@ -109,7 +109,7 @@
 			throw StandardException.newException(SQLState.LANG_SYNTAX_ERROR, javaClassName + "::"
+ fieldName);
 		}
 
-		javaClassName = verifyClassExist(javaClassName, ! classNameDelimitedIdentifier);
+		verifyClassExist(javaClassName);
 
 		/*
 		** Find the field that is public.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java?view=diff&rev=543057&r1=543056&r2=543057
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/StaticMethodCallNode.java
Wed May 30 21:57:58 2007
@@ -236,7 +236,7 @@
 		}
 
 
-		javaClassName = verifyClassExist(javaClassName, true);
+		verifyClassExist(javaClassName);
 
 		/* Resolve the method call */
 		resolveMethodCall(javaClassName, true);



Mime
View raw message