db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1401250 - in /db/derby/code/trunk/java/engine/org/apache/derby: iapi/sql/dictionary/AliasDescriptor.java impl/sql/compile/AggregateNode.java impl/sql/compile/UserAggregateDefinition.java
Date Tue, 23 Oct 2012 11:25:53 GMT
Author: kahatlen
Date: Tue Oct 23 11:25:52 2012
New Revision: 1401250

URL: http://svn.apache.org/viewvc?rev=1401250&view=rev
Log:
DERBY-672: Remove unneeded exceptions and a redundant null check

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
    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/UserAggregateDefinition.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java?rev=1401250&r1=1401249&r2=1401250&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/sql/dictionary/AliasDescriptor.java
Tue Oct 23 11:25:52 2012
@@ -182,7 +182,7 @@ public final class AliasDescriptor 
 	 * @return	A String containing the name of the schema that the alias
 	 *		lives in.
 	 */
-	public String	getSchemaName() throws StandardException
+	public String getSchemaName()
 	{
 		return schemaDescriptor.getSchemaName();
 	}
@@ -192,7 +192,7 @@ public final class AliasDescriptor 
 	 *
 	 * @return	A String containing the name of the table.
 	 */
-	public String	getQualifiedName() throws StandardException
+	public String getQualifiedName()
 	{
         return IdUtil.mkQualifiedName(getSchemaName(), aliasName);
 	}

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?rev=1401250&r1=1401249&r2=1401250&view=diff
==============================================================================
--- 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 Tue
Oct 23 11:25:52 2012
@@ -725,20 +725,8 @@ public class AggregateNode extends Unary
     {
         if ( isUserDefinedAggregate() )
         {
-            //
-            // In theory, we could incur a StandardException while looking up the schema
-            // descriptor. In practice that would mean a seriously corrupted database and
-            // we would expect the schema resolution problem to have surfaced long before
-            // we got to this code. But, just in case, if we can't find the schema, we will
return
-            // a different handle for the user-defined aggregate, in order to give the user
-            // some information.
-            //
-            try {
-                return ((UserAggregateDefinition) uad).getAliasDescriptor().getQualifiedName();
-            } catch (StandardException se)
-            {
-                return aggregateName;
-            }
+            return ((UserAggregateDefinition) uad).
+                    getAliasDescriptor().getQualifiedName();
         }
         else { return aggregateName; }
     }
@@ -746,7 +734,7 @@ public class AggregateNode extends Unary
     /** Return true if this is a user-defined aggregate */
     private boolean isUserDefinedAggregate()
     {
-        return ( (uad != null) && (uad instanceof UserAggregateDefinition) );
+        return uad instanceof UserAggregateDefinition;
     }
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java?rev=1401250&r1=1401249&r2=1401250&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/UserAggregateDefinition.java
Tue Oct 23 11:25:52 2012
@@ -251,7 +251,6 @@ public class UserAggregateDefinition imp
      * Make a "Could not instantiate aggregator" exception.
      */
     private StandardException   aggregatorInstantiation( Throwable t )
-        throws StandardException
     {
         return StandardException.newException
             (



Mime
View raw message