You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by rh...@apache.org on 2008/05/21 17:41:48 UTC

svn commit: r658730 - in /db/derby/code/trunk/java: engine/org/apache/derby/iapi/services/loader/ testing/org/apache/derbyTesting/functionTests/tests/lang/

Author: rhillegas
Date: Wed May 21 08:41:48 2008
New Revision: 658730

URL: http://svn.apache.org/viewvc?rev=658730&view=rev
Log:
DERBY-3652: Remove best-fit logic which applied Java signature resolution rules instead of ANSI signature matching rules.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/loader/ClassInspector.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignaturesTest.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/loader/ClassInspector.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/loader/ClassInspector.java?rev=658730&r1=658729&r2=658730&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/loader/ClassInspector.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/loader/ClassInspector.java Wed May 21 08:41:48 2008
@@ -705,48 +705,13 @@
 					continue;
 				}
 
-				/* Not the first match, so find out which one, if either one,
-				 * has the best match on the parameters.  (No narrowing
-				 * conversions.)  15.11 of Java Language Specification.
-				 */
-
-				Member candidateMethod = methods[candidateIndex];
-
-				// If the candidate method is more specific than the current
-				// method then the candidate method is still the maximally specific method
-				// Note at this point we could still have a ambiguous situation.
-
-				boolean candidateMoreOrEqual = isMethodMoreSpecificOrEqual(
-							candidateMethod, currentMethod, isParam);
-				boolean currentMoreOrEqual = isMethodMoreSpecificOrEqual(
-							currentMethod, candidateMethod, isParam);
-				if (candidateMoreOrEqual && ! currentMoreOrEqual) {
-					if (SanityManager.DEBUG) {
-					  if (SanityManager.DEBUG_ON("MethodResolutionInfo")) {
-						SanityManager.DEBUG("MethodResolutionInfo",
-						"MRI - Candidate is still maximally specific");
-					  }
-					}
-					methods[i] = null; // remove non-applicable methods
-					continue;
-				}
-
-				// if the current method is more specific than the candidiate
-				// method then it becomes the new maximally specific method
-				// Note at this point we could still have a ambiguous situation.
-
-				if (currentMoreOrEqual && ! candidateMoreOrEqual) {
-					if (SanityManager.DEBUG) {
-					  if (SanityManager.DEBUG_ON("MethodResolutionInfo")) {
-						SanityManager.DEBUG("MethodResolutionInfo",
-						"MRI - Current method is now candidate, replaced previous candidate");
-					  }
-					}
-					methods[candidateIndex] = null; // remove non-applicable methods
-					candidateIndex = i;
-					somethingChanged = true;
-					continue;
-				}
+                //
+                // Before the fixes to DERBY-3652, we used to weed out
+                // ambiguities by applying the rules from section 15.11
+                // of the Java Language Specification. These are not the
+                // ANSI resolution rules however. The code to weed out
+                // ambiguities has been removed.
+                //
 
 				/* We have seen an ambiguous situation; one of the cases may
 				 * tie on each parameter.

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java?rev=658730&r1=658729&r2=658730&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java Wed May 21 08:41:48 2008
@@ -86,7 +86,6 @@
     public  static  Short   smallint_unres_Short( double a ) { return new Short( (short) a ); }
     public  static  Short   smallint_unres_Short( Byte a ) { return new Short( a.shortValue() ); }
     public  static  Short   smallint_unres_Short( Short a ) { return new Short( a.shortValue() ); }
-    public  static  Short   smallint_unres_Short( Integer a ) { return new Short( a.shortValue() ); }
     public  static  Short   smallint_unres_Short( Long a ) { return new Short( a.shortValue() ); }
     public  static  Short   smallint_unres_Short( Float a ) { return new Short( a.shortValue() ); }
     public  static  Short   smallint_unres_Short( Double a ) { return new Short( a.shortValue() ); }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignaturesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignaturesTest.java?rev=658730&r1=658729&r2=658730&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignaturesTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignaturesTest.java Wed May 21 08:41:48 2008
@@ -260,14 +260,14 @@
     public  void    test_smallint_amb_short_short()
         throws Exception
     {
-        //FIXME declareAndFailFunction
-        //FIXME ( "smallint_amb_short_short", "smallint", new String[] { "smallint" }, "3", "3", AMBIGUOUS );
+        declareAndFailFunction
+            ( "smallint_amb_short_short", "smallint", new String[] { "smallint" }, "3", "3", AMBIGUOUS );
     }
     public  void    test_smallint_amb_Integer_short()
         throws Exception
     {
-        //FIXME declareAndFailFunction
-        //FIXME ( "smallint_amb_Integer_short", "smallint", new String[] { "smallint" }, "3", "3", AMBIGUOUS );
+        declareAndFailFunction
+            ( "smallint_amb_Integer_short", "smallint", new String[] { "smallint" }, "3", "3", AMBIGUOUS );
     }
 
     public  void    test_integer_amb_int_int()