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/27 20:08:23 UTC
svn commit: r660630 - in /db/derby/code/trunk/java:
engine/org/apache/derby/iapi/services/loader/
testing/org/apache/derbyTesting/functionTests/tests/lang/
Author: rhillegas
Date: Tue May 27 11:08:17 2008
New Revision: 660630
URL: http://svn.apache.org/viewvc?rev=660630&view=rev
Log:
DERBY-3652: Don't match SQL NUMERIC to Java Object.
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=660630&r1=660629&r2=660630&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 Tue May 27 11:08:17 2008
@@ -55,6 +55,7 @@
private static final String OBJECT_TYPE_NAME = "java.lang.Object";
private static final String STRING_TYPE_NAME = "java.lang.String";
+ private static final String BIGDECIMAL_TYPE_NAME = "java.math.BigDecimal";
private final ClassFactory cf;
@@ -688,7 +689,6 @@
continue;
}
-
if (SanityManager.DEBUG) {
if (SanityManager.DEBUG_ON("MethodResolutionInfo")) {
SanityManager.DEBUG("MethodResolutionInfo", "MRI - Match found ");
@@ -958,13 +958,25 @@
//
// public static String f( Object a )
//
+ // Also don't allow the widening of BigDecimal to Object. Otherwise, the
+ // SQL signature
+ //
+ // f( a numeric( 7, 2 ) ) returns numeric( 7, 2 )
+ //
+ // will incorrectly match the Java signature
+ //
+ // public static BigDecimal f( Object a )
+ //
+ //
// For a description of the ANSI signature matching rules, see
// DERBY-3652.
//
if (
!(
- STRING_TYPE_NAME.equals( fromClass.getName() ) &&
- OBJECT_TYPE_NAME.equals( toClass.getName() )
+ (
+ STRING_TYPE_NAME.equals( fromClass.getName() ) ||
+ BIGDECIMAL_TYPE_NAME.equals( fromClass.getName() )
+ ) && OBJECT_TYPE_NAME.equals( toClass.getName() )
) &&
toClass.isAssignableFrom(fromClass)
)
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=660630&r1=660629&r2=660630&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 Tue May 27 11:08:17 2008
@@ -21,6 +21,7 @@
package org.apache.derbyTesting.functionTests.tests.lang;
+import java.math.BigDecimal;
/**
* <p>
@@ -61,6 +62,7 @@
public static short smallint_short_short( Long a ) { return (short) -1; }
public static short smallint_short_short( Float a ) { return (short) -1; }
public static short smallint_short_short( Double a ) { return (short) -1; }
+ public static short smallint_short_short( BigDecimal a ) { return (short) -1; }
public static short smallint_short_short( String a ) { return (short) -1; }
public static short smallint_short_short( Object a ) { return (short) -1; }
@@ -75,6 +77,7 @@
public static short smallint_short_Integer( Long a ) { return (short) -1; }
public static short smallint_short_Integer( Float a ) { return (short) -1; }
public static short smallint_short_Integer( Double a ) { return (short) -1; }
+ public static short smallint_short_Integer( BigDecimal a ) { return (short) -1; }
public static short smallint_short_Integer( String a ) { return (short) -1; }
public static short smallint_short_Integer( Object a ) { return (short) -1; }
@@ -89,6 +92,7 @@
public static Integer smallint_Integer_short( Long a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_short( Float a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_short( Double a ) { return new Integer( -1 ); }
+ public static Integer smallint_Integer_short( BigDecimal a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_short( String a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_short( Object a ) { return new Integer( -1 ); }
@@ -103,48 +107,55 @@
public static Integer smallint_Integer_Integer( Long a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_Integer( Float a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_Integer( Double a ) { return new Integer( -1 ); }
+ public static Integer smallint_Integer_Integer( BigDecimal a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_Integer( String a ) { return new Integer( -1 ); }
public static Integer smallint_Integer_Integer( Object a ) { return new Integer( -1 ); }
// outside the spec. these should not resolve.
- public static short smallint_bad_short_Short( Short a ) { return a.shortValue(); }
- public static Short smallint_bad_Short_short( short a ) { return new Short( a ); }
- public static Short smallint_bad_Short_Short( Short a ) { return a; }
+ public static short smallint_bad_short_Short( Short a ) { return (short) -1; }
+ public static Short smallint_bad_Short_short( short a ) { return new Short( (short) -1 ); }
+ public static Short smallint_bad_Short_Short( Short a ) { return new Short( (short) -1 ); }
// bad return type
- public static byte smallint_badreturn_byte_short( short a ) { return (byte) a; }
+ public static byte smallint_badreturn_byte_short( short a ) { return (byte) -1; }
// illegal ambiguity
- public static short smallint_amb_short_short( short a ) { return a; }
- public static short smallint_amb_short_short( Integer a ) { return a.shortValue(); }
- public static Integer smallint_amb_Integer_short( short a ) { return new Integer( a ); }
- public static Integer smallint_amb_Integer_short( Integer a ) { return a; }
- public static byte smallint_amb_byte_short( short a ) { return (byte) a; }
- public static byte smallint_amb_byte_short( Integer a ) { return a.byteValue(); }
+ public static short smallint_amb_short_short( short a ) { return (short) -1; }
+ public static short smallint_amb_short_short( Integer a ) { return (short) -1; }
+ public static Integer smallint_amb_Integer_short( short a ) { return new Integer( -1 ); }
+ public static Integer smallint_amb_Integer_short( Integer a ) { return new Integer( -1 ); }
+ public static byte smallint_amb_byte_short( short a ) { return (byte) -1; }
+ public static byte smallint_amb_byte_short( Integer a ) { return (byte) -1; }
// unresolvable
- public static short smallint_unres_short( byte a ) { return (short) a; }
- public static short smallint_unres_short( int a ) { return (short) a; }
- public static short smallint_unres_short( long a ) { return (short) a; }
- public static short smallint_unres_short( float a ) { return (short) a; }
- public static short smallint_unres_short( double a ) { return (short) a; }
- public static short smallint_unres_short( Byte a ) { return a.shortValue(); }
- public static short smallint_unres_short( Short a ) { return a.shortValue(); }
- public static short smallint_unres_short( Long a ) { return a.shortValue(); }
- public static short smallint_unres_short( Float a ) { return a.shortValue(); }
- public static short smallint_unres_short( Double a ) { return a.shortValue(); }
-
- public static Short smallint_unres_Short( byte a ) { return new Short( (short) a ); }
- public static Short smallint_unres_Short( short a ) { return new Short( (short) a ); }
- public static Short smallint_unres_Short( int a ) { return new Short( (short) a ); }
- public static Short smallint_unres_Short( long a ) { return new Short( (short) a ); }
- public static Short smallint_unres_Short( float a ) { return new Short( (short) a ); }
- 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( 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() ); }
+ public static short smallint_unres_short( byte a ) { return (short) -1; }
+ public static short smallint_unres_short( int a ) { return (short) -1; }
+ public static short smallint_unres_short( long a ) { return (short) -1; }
+ public static short smallint_unres_short( float a ) { return (short) -1; }
+ public static short smallint_unres_short( double a ) { return (short) -1; }
+ public static short smallint_unres_short( Byte a ) { return (short) -1; }
+ public static short smallint_unres_short( Short a ) { return (short) -1; }
+ public static short smallint_unres_short( Long a ) { return (short) -1; }
+ public static short smallint_unres_short( Float a ) { return (short) -1; }
+ public static short smallint_unres_short( Double a ) { return (short) -1; }
+ public static short smallint_unres_short( BigDecimal a ) { return (short) -1; }
+ public static short smallint_unres_short( String a ) { return (short) -1; }
+ public static short smallint_unres_short( Object a ) { return (short) -1; }
+
+ public static Short smallint_unres_Short( byte a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( short a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( int a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( long a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( float a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( double a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Byte a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Short a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Long a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Float a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Double a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( BigDecimal a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( String a ) { return new Short( (short) -1 ); }
+ public static Short smallint_unres_Short( Object a ) { return new Short( (short) -1 ); }
@@ -164,6 +175,7 @@
public static int integer_int_int( Long a ) { return -1; }
public static int integer_int_int( Float a ) { return -1; }
public static int integer_int_int( Double a ) { return -1; }
+ public static int integer_int_int( BigDecimal a ) { return -1; }
public static int integer_int_int( String a ) { return -1; }
public static int integer_int_int( Object a ) { return -1; }
@@ -178,6 +190,7 @@
public static int integer_int_Integer( Long a ) { return -1; }
public static int integer_int_Integer( Float a ) { return -1; }
public static int integer_int_Integer( Double a ) { return -1; }
+ public static int integer_int_Integer( BigDecimal a ) { return -1; }
public static int integer_int_Integer( String a ) { return -1; }
public static int integer_int_Integer( Object a ) { return -1; }
@@ -192,6 +205,7 @@
public static Integer integer_Integer_int( Long a ) { return new Integer( -1 ); }
public static Integer integer_Integer_int( Float a ) { return new Integer( -1 ); }
public static Integer integer_Integer_int( Double a ) { return new Integer( -1 ); }
+ public static Integer integer_Integer_int( BigDecimal a ) { return new Integer( -1 ); }
public static Integer integer_Integer_int( String a ) { return new Integer( -1 ); }
public static Integer integer_Integer_int( Object a ) { return new Integer( -1 ); }
@@ -206,42 +220,49 @@
public static Integer integer_Integer_Integer( Long a ) { return new Integer( -1 ); }
public static Integer integer_Integer_Integer( Float a ) { return new Integer( -1 ); }
public static Integer integer_Integer_Integer( Double a ) { return new Integer( -1 ); }
+ public static Integer integer_Integer_Integer( BigDecimal a ) { return new Integer( -1 ); }
public static Integer integer_Integer_Integer( String a ) { return new Integer( -1 ); }
public static Integer integer_Integer_Integer( Object a ) { return new Integer( -1 ); }
// bad return type
- public static byte integer_badreturn_byte_int( int a ) { return (byte) a; }
+ public static byte integer_badreturn_byte_int( int a ) { return (byte) -1; }
// illegal ambiguity
- public static int integer_amb_int_int( int a ) { return a; }
- public static int integer_amb_int_int( Integer a ) { return a.intValue(); }
- public static Integer integer_amb_Integer_int( int a ) { return new Integer( a ); }
- public static Integer integer_amb_Integer_int( Integer a ) { return a; }
- public static byte integer_amb_byte_int( int a ) { return (byte) a; }
- public static byte integer_amb_byte_int( Integer a ) { return (byte) a.intValue(); }
+ public static int integer_amb_int_int( int a ) { return -1; }
+ public static int integer_amb_int_int( Integer a ) { return -1; }
+ public static Integer integer_amb_Integer_int( int a ) { return new Integer( -1 ); }
+ public static Integer integer_amb_Integer_int( Integer a ) { return new Integer( -1 ); }
+ public static byte integer_amb_byte_int( int a ) { return (byte) -1; }
+ public static byte integer_amb_byte_int( Integer a ) { return (byte) -1; }
// unresolvable
- public static int integer_unres_int( byte a ) { return (int) a; }
- public static int integer_unres_int( short a ) { return (int) a; }
- public static int integer_unres_int( long a ) { return (int) a; }
- public static int integer_unres_int( float a ) { return (int) a; }
- public static int integer_unres_int( double a ) { return (int) a; }
- public static int integer_unres_int( Byte a ) { return a.intValue(); }
- public static int integer_unres_int( Short a ) { return a.intValue(); }
- public static int integer_unres_int( Long a ) { return a.intValue(); }
- public static int integer_unres_int( Float a ) { return a.intValue(); }
- public static int integer_unres_int( Double a ) { return a.intValue(); }
-
- public static Integer integer_unres_Integer( byte a ) { return new Integer( (int) a ); }
- public static Integer integer_unres_Integer( short a ) { return new Integer( (int) a ); }
- public static Integer integer_unres_Integer( long a ) { return new Integer( (int) a ); }
- public static Integer integer_unres_Integer( float a ) { return new Integer( (int) a ); }
- public static Integer integer_unres_Integer( double a ) { return new Integer( (int) a ); }
- public static Integer integer_unres_Integer( Byte a ) { return new Integer( a.intValue() ); }
- public static Integer integer_unres_Integer( Short a ) { return new Integer( a.intValue() ); }
- public static Integer integer_unres_Integer( Long a ) { return new Integer( a.intValue() ); }
- public static Integer integer_unres_Integer( Float a ) { return new Integer( a.intValue() ); }
- public static Integer integer_unres_Integer( Double a ) { return new Integer( a.intValue() ); }
+ public static int integer_unres_int( byte a ) { return -1; }
+ public static int integer_unres_int( short a ) { return -1; }
+ public static int integer_unres_int( long a ) { return -1; }
+ public static int integer_unres_int( float a ) { return -1; }
+ public static int integer_unres_int( double a ) { return -1; }
+ public static int integer_unres_int( Byte a ) { return -1; }
+ public static int integer_unres_int( Short a ) { return -1; }
+ public static int integer_unres_int( Long a ) { return -1; }
+ public static int integer_unres_int( Float a ) { return -1; }
+ public static int integer_unres_int( Double a ) { return -1; }
+ public static int integer_unres_int( BigDecimal a ) { return -1; }
+ public static int integer_unres_int( String a ) { return -1; }
+ public static int integer_unres_int( Object a ) { return -1; }
+
+ public static Integer integer_unres_Integer( byte a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( short a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( long a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( float a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( double a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Byte a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Short a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Long a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Float a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Double a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( BigDecimal a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( String a ) { return new Integer( -1 ); }
+ public static Integer integer_unres_Integer( Object a ) { return new Integer( -1 ); }
//
// BIGINT
@@ -259,6 +280,7 @@
public static long bigint_long_long( Integer a ) { return -1L; }
public static long bigint_long_long( Float a ) { return -1L; }
public static long bigint_long_long( Double a ) { return -1L; }
+ public static long bigint_long_long( BigDecimal a ) { return -1L; }
public static long bigint_long_long( String a ) { return -1L; }
public static long bigint_long_long( Object a ) { return -1L; }
@@ -273,6 +295,7 @@
public static long bigint_long_Long( Integer a ) { return -1L; }
public static long bigint_long_Long( Float a ) { return -1L; }
public static long bigint_long_Long( Double a ) { return -1L; }
+ public static long bigint_long_Long( BigDecimal a ) { return -1L; }
public static long bigint_long_Long( String a ) { return -1L; }
public static long bigint_long_Long( Object a ) { return -1L; }
@@ -287,6 +310,7 @@
public static Long bigint_Long_long( Integer a ) { return new Long( -1L ); }
public static Long bigint_Long_long( Float a ) { return new Long( -1L ); }
public static Long bigint_Long_long( Double a ) { return new Long( -1L ); }
+ public static Long bigint_Long_long( BigDecimal a ) { return new Long( -1L ); }
public static Long bigint_Long_long( String a ) { return new Long( -1L ); }
public static Long bigint_Long_long( Object a ) { return new Long( -1L ); }
@@ -301,42 +325,49 @@
public static Long bigint_Long_Long( Integer a ) { return new Long( -1L ); }
public static Long bigint_Long_Long( Float a ) { return new Long( -1L ); }
public static Long bigint_Long_Long( Double a ) { return new Long( -1L ); }
+ public static Long bigint_Long_Long( BigDecimal a ) { return new Long( -1L ); }
public static Long bigint_Long_Long( String a ) { return new Long( -1L ); }
public static Long bigint_Long_Long( Object a ) { return new Long( -1L ); }
// bad return type
- public static byte bigint_badreturn_byte_long( long a ) { return (byte) a; }
+ public static byte bigint_badreturn_byte_long( long a ) { return (byte) -1; }
// illegal ambiguity
- public static long bigint_amb_long_long( long a ) { return a; }
- public static long bigint_amb_long_long( Long a ) { return a.longValue(); }
- public static Long bigint_amb_Long_long( long a ) { return new Long( a ); }
- public static Long bigint_amb_Long_long( Long a ) { return a; }
- public static byte bigint_amb_byte_long( long a ) { return (byte) a; }
- public static byte bigint_amb_byte_long( Long a ) { return a.byteValue(); }
+ public static long bigint_amb_long_long( long a ) { return -1L; }
+ public static long bigint_amb_long_long( Long a ) { return -1L; }
+ public static Long bigint_amb_Long_long( long a ) { return new Long( -1L ); }
+ public static Long bigint_amb_Long_long( Long a ) { return new Long( -1L ); }
+ public static byte bigint_amb_byte_long( long a ) { return (byte) -1; }
+ public static byte bigint_amb_byte_long( Long a ) { return (byte) -1; }
// unresolvable
- public static long bigint_unres_long( byte a ) { return (long) a; }
- public static long bigint_unres_long( short a ) { return (long) a; }
- public static long bigint_unres_long( int a ) { return (long) a; }
- public static long bigint_unres_long( float a ) { return (long) a; }
- public static long bigint_unres_long( double a ) { return (long) a; }
- public static long bigint_unres_long( Byte a ) { return a.longValue(); }
- public static long bigint_unres_long( Short a ) { return a.longValue(); }
- public static long bigint_unres_long( Integer a ) { return a.longValue(); }
- public static long bigint_unres_long( Float a ) { return a.longValue(); }
- public static long bigint_unres_long( Double a ) { return a.longValue(); }
-
- public static Long bigint_unres_Long( byte a ) { return new Long( (long) a ); }
- public static Long bigint_unres_Long( short a ) { return new Long( (long) a ); }
- public static Long bigint_unres_Long( int a ) { return new Long( (long) a ); }
- public static Long bigint_unres_Long( float a ) { return new Long( (long) a ); }
- public static Long bigint_unres_Long( double a ) { return new Long( (long) a ); }
- public static Long bigint_unres_Long( Byte a ) { return new Long( a.longValue() ); }
- public static Long bigint_unres_Long( Short a ) { return new Long( a.longValue() ); }
- public static Long bigint_unres_Long( Integer a ) { return new Long( a.longValue() ); }
- public static Long bigint_unres_Long( Float a ) { return new Long( a.longValue() ); }
- public static Long bigint_unres_Long( Double a ) { return new Long( a.longValue() ); }
+ public static long bigint_unres_long( byte a ) { return -1L; }
+ public static long bigint_unres_long( short a ) { return -1L; }
+ public static long bigint_unres_long( int a ) { return -1L; }
+ public static long bigint_unres_long( float a ) { return -1L; }
+ public static long bigint_unres_long( double a ) { return -1L; }
+ public static long bigint_unres_long( Byte a ) { return -1L; }
+ public static long bigint_unres_long( Short a ) { return -1L; }
+ public static long bigint_unres_long( Integer a ) { return -1L; }
+ public static long bigint_unres_long( Float a ) { return -1L; }
+ public static long bigint_unres_long( Double a ) { return -1L; }
+ public static long bigint_unres_long( BigDecimal a ) { return -1L; }
+ public static long bigint_unres_long( String a ) { return -1L; }
+ public static long bigint_unres_long( Object a ) { return -1L; }
+
+ public static Long bigint_unres_Long( byte a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( short a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( int a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( float a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( double a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Byte a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Short a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Integer a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Float a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Double a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( BigDecimal a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( String a ) { return new Long( -1L ); }
+ public static Long bigint_unres_Long( Object a ) { return new Long( -1L ); }
//
// REAL
@@ -354,6 +385,7 @@
public static float real_float_float( Integer a ) { return -1.0F; }
public static float real_float_float( Long a ) { return -1.0F; }
public static float real_float_float( Double a ) { return -1.0F; }
+ public static float real_float_float( BigDecimal a ) { return -1.0F; }
public static float real_float_float( String a ) { return -1.0F; }
public static float real_float_float( Object a ) { return -1.0F; }
@@ -368,6 +400,7 @@
public static float real_float_Float( Integer a ) { return -1.0F; }
public static float real_float_Float( Long a ) { return -1.0F; }
public static float real_float_Float( Double a ) { return -1.0F; }
+ public static float real_float_Float( BigDecimal a ) { return -1.0F; }
public static float real_float_Float( String a ) { return -1.0F; }
public static float real_float_Float( Object a ) { return -1.0F; }
@@ -382,6 +415,7 @@
public static Float real_Float_float( Integer a ) { return new Float( -1.0F ); }
public static Float real_Float_float( Long a ) { return new Float( -1.0F ); }
public static Float real_Float_float( Double a ) { return new Float( -1.0F ); }
+ public static Float real_Float_float( BigDecimal a ) { return new Float( -1.0F ); }
public static Float real_Float_float( String a ) { return new Float( -1.0F ); }
public static Float real_Float_float( Object a ) { return new Float( -1.0F ); }
@@ -396,42 +430,49 @@
public static Float real_Float_Float( Integer a ) { return new Float( -1.0F ); }
public static Float real_Float_Float( Long a ) { return new Float( -1.0F ); }
public static Float real_Float_Float( Double a ) { return new Float( -1.0F ); }
+ public static Float real_Float_Float( BigDecimal a ) { return new Float( -1.0F ); }
public static Float real_Float_Float( String a ) { return new Float( -1.0F ); }
public static Float real_Float_Float( Object a ) { return new Float( -1.0F ); }
// bad return type
- public static byte real_badreturn_byte_float( float a ) { return (byte) a; }
+ public static byte real_badreturn_byte_float( float a ) { return (byte) -1; }
// illegal ambiguity
- public static float real_amb_float_float( float a ) { return a; }
- public static float real_amb_float_float( Float a ) { return a.floatValue(); }
- public static Float real_amb_Float_float( float a ) { return new Float( a ); }
- public static Float real_amb_Float_float( Float a ) { return a; }
- public static byte real_amb_byte_float( float a ) { return (byte) a; }
- public static byte real_amb_byte_float( Float a ) { return a.byteValue(); }
+ public static float real_amb_float_float( float a ) { return -1.0F; }
+ public static float real_amb_float_float( Float a ) { return -1.0F; }
+ public static Float real_amb_Float_float( float a ) { return new Float( -1.0F ); }
+ public static Float real_amb_Float_float( Float a ) { return new Float( -1.0F ); }
+ public static byte real_amb_byte_float( float a ) { return (byte) -1; }
+ public static byte real_amb_byte_float( Float a ) { return (byte) -1; }
// unresolvable
- public static float real_unres_float( byte a ) { return (float) a; }
- public static float real_unres_float( short a ) { return (float) a; }
- public static float real_unres_float( int a ) { return (float) a; }
- public static float real_unres_float( long a ) { return (float) a; }
- public static float real_unres_float( double a ) { return (float) a; }
- public static float real_unres_float( Byte a ) { return a.floatValue(); }
- public static float real_unres_float( Short a ) { return a.floatValue(); }
- public static float real_unres_float( Integer a ) { return a.floatValue(); }
- public static float real_unres_float( Long a ) { return a.floatValue(); }
- public static float real_unres_float( Double a ) { return a.floatValue(); }
-
- public static Float real_unres_Float( byte a ) { return new Float( (float) a ); }
- public static Float real_unres_Float( short a ) { return new Float( (float) a ); }
- public static Float real_unres_Float( int a ) { return new Float( (float) a ); }
- public static Float real_unres_Float( long a ) { return new Float( (float) a ); }
- public static Float real_unres_Float( double a ) { return new Float( (float) a ); }
- public static Float real_unres_Float( Byte a ) { return new Float( a.floatValue() ); }
- public static Float real_unres_Float( Short a ) { return new Float( a.floatValue() ); }
- public static Float real_unres_Float( Integer a ) { return new Float( a.floatValue() ); }
- public static Float real_unres_Float( Long a ) { return new Float( a.floatValue() ); }
- public static Float real_unres_Float( Double a ) { return new Float( a.floatValue() ); }
+ public static float real_unres_float( byte a ) { return -1.0F; }
+ public static float real_unres_float( short a ) { return -1.0F; }
+ public static float real_unres_float( int a ) { return -1.0F; }
+ public static float real_unres_float( long a ) { return -1.0F; }
+ public static float real_unres_float( double a ) { return -1.0F; }
+ public static float real_unres_float( Byte a ) { return -1.0F; }
+ public static float real_unres_float( Short a ) { return -1.0F; }
+ public static float real_unres_float( Integer a ) { return -1.0F; }
+ public static float real_unres_float( Long a ) { return -1.0F; }
+ public static float real_unres_float( Double a ) { return -1.0F; }
+ public static float real_unres_float( BigDecimal a ) { return -1.0F; }
+ public static float real_unres_float( String a ) { return -1.0F; }
+ public static float real_unres_float( Object a ) { return -1.0F; }
+
+ public static Float real_unres_Float( byte a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( short a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( int a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( long a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( double a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Byte a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Short a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Integer a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Long a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Double a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( BigDecimal a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( String a ) { return new Float( -1.0F ); }
+ public static Float real_unres_Float( Object a ) { return new Float( -1.0F ); }
//
// DOUBLE
@@ -449,6 +490,7 @@
public static double double_double_double( Integer a ) { return -1.0; }
public static double double_double_double( Long a ) { return -1.0; }
public static double double_double_double( Float a ) { return -1.0; }
+ public static double double_double_double( BigDecimal a ) { return -1.0; }
public static double double_double_double( String a ) { return -1.0; }
public static double double_double_double( Object a ) { return -1.0; }
@@ -463,6 +505,7 @@
public static double double_double_Double( Integer a ) { return -1.0; }
public static double double_double_Double( Long a ) { return -1.0; }
public static double double_double_Double( Float a ) { return -1.0; }
+ public static double double_double_Double( BigDecimal a ) { return -1.0; }
public static double double_double_Double( String a ) { return -1.0; }
public static double double_double_Double( Object a ) { return -1.0; }
@@ -477,6 +520,7 @@
public static Double double_Double_double( Integer a ) { return new Double( -1.0 ); }
public static Double double_Double_double( Long a ) { return new Double( -1.0 ); }
public static Double double_Double_double( Float a ) { return new Double( -1.0 ); }
+ public static Double double_Double_double( BigDecimal a ) { return new Double( -1.0 ); }
public static Double double_Double_double( String a ) { return new Double( -1.0 ); }
public static Double double_Double_double( Object a ) { return new Double( -1.0 ); }
@@ -491,43 +535,71 @@
public static Double double_Double_Double( Integer a ) { return new Double( -1.0 ); }
public static Double double_Double_Double( Long a ) { return new Double( -1.0 ); }
public static Double double_Double_Double( Float a ) { return new Double( -1.0 ); }
+ public static Double double_Double_Double( BigDecimal a ) { return new Double( -1.0 ); }
public static Double double_Double_Double( String a ) { return new Double( -1.0 ); }
public static Double double_Double_Double( Object a ) { return new Double( -1.0 ); }
// bad return type
- public static byte double_badreturn_byte_double( double a ) { return (byte) a; }
+ public static byte double_badreturn_byte_double( double a ) { return (byte) -1; }
// illegal ambiguity
- public static double double_amb_double_double( double a ) { return a; }
- public static double double_amb_double_double( Double a ) { return a.doubleValue(); }
- public static Double double_amb_Double_double( double a ) { return new Double( a ); }
- public static Double double_amb_Double_double( Double a ) { return a; }
- public static byte double_amb_byte_double( double a ) { return (byte) a; }
- public static byte double_amb_byte_double( Double a ) { return a.byteValue(); }
+ public static double double_amb_double_double( double a ) { return -1.0; }
+ public static double double_amb_double_double( Double a ) { return -1.0; }
+ public static Double double_amb_Double_double( double a ) { return new Double( -1.0 ); }
+ public static Double double_amb_Double_double( Double a ) { return new Double( -1.0 ); }
+ public static byte double_amb_byte_double( double a ) { return (byte) -1; }
+ public static byte double_amb_byte_double( Double a ) { return (byte) -1; }
// unresolvable
- public static double double_unres_double( byte a ) { return (double) a; }
- public static double double_unres_double( short a ) { return (double) a; }
- public static double double_unres_double( int a ) { return (double) a; }
- public static double double_unres_double( long a ) { return (double) a; }
- public static double double_unres_double( float a ) { return (double) a; }
- public static double double_unres_double( Byte a ) { return a.doubleValue(); }
- public static double double_unres_double( Short a ) { return a.doubleValue(); }
- public static double double_unres_double( Integer a ) { return a.doubleValue(); }
- public static double double_unres_double( Long a ) { return a.doubleValue(); }
- public static double double_unres_double( Float a ) { return a.doubleValue(); }
-
- public static Double double_unres_Double( byte a ) { return new Double( (double) a ); }
- public static Double double_unres_Double( short a ) { return new Double( (double) a ); }
- public static Double double_unres_Double( int a ) { return new Double( (double) a ); }
- public static Double double_unres_Double( long a ) { return new Double( (double) a ); }
- public static Double double_unres_Double( float a ) { return new Double( (double) a ); }
- public static Double double_unres_Double( Byte a ) { return new Double( a.doubleValue() ); }
- public static Double double_unres_Double( Short a ) { return new Double( a.doubleValue() ); }
- public static Double double_unres_Double( Integer a ) { return new Double( a.doubleValue() ); }
- public static Double double_unres_Double( Long a ) { return new Double( a.doubleValue() ); }
- public static Double double_unres_Double( Float a ) { return new Double( a.doubleValue() ); }
+ public static double double_unres_double( byte a ) { return -1.0; }
+ public static double double_unres_double( short a ) { return -1.0; }
+ public static double double_unres_double( int a ) { return -1.0; }
+ public static double double_unres_double( long a ) { return -1.0; }
+ public static double double_unres_double( float a ) { return -1.0; }
+ public static double double_unres_double( Byte a ) { return -1.0; }
+ public static double double_unres_double( Short a ) { return -1.0; }
+ public static double double_unres_double( Integer a ) { return -1.0; }
+ public static double double_unres_double( Long a ) { return -1.0; }
+ public static double double_unres_double( Float a ) { return -1.0; }
+ public static double double_unres_double( BigDecimal a ) { return -1.0; }
+ public static double double_unres_double( String a ) { return -1.0; }
+ public static double double_unres_double( Object a ) { return -1.0; }
+ public static Double double_unres_Double( byte a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( short a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( int a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( long a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( float a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Byte a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Short a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Integer a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Long a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Float a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( BigDecimal a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( String a ) { return new Double( -1.0 ); }
+ public static Double double_unres_Double( Object a ) { return new Double( -1.0 ); }
+
+ //
+ // NUMERIC
+ //
+
+ // legal resolutions
+ public static BigDecimal numeric_BigDecimal_BigDecimal( BigDecimal a ) { return a; }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( byte a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( int a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( short a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( long a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( float a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( double a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Byte a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Short a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Integer a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Long a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Float a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Double a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( String a ) { return new BigDecimal( -1.0 ); }
+ public static BigDecimal numeric_BigDecimal_BigDecimal( Object a ) { return new BigDecimal( -1.0 ); }
+
//
// VARCHAR
//
@@ -548,4 +620,6 @@
public static String varchar_String_String( Double a ) { return "-1"; }
public static String varchar_String_String( Object a ) { return "-1"; }
+
+
}
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=660630&r1=660629&r2=660630&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 Tue May 27 11:08:17 2008
@@ -225,13 +225,20 @@
( "double_Double_Double", "double", new String[] { "double" }, "3.0", "3.0" );
}
+ public void test_numeric_BigDecimal_BigDecimal()
+ throws Exception
+ {
+ declareAndRunFunction
+ ( "numeric_BigDecimal_BigDecimal", "numeric( 7, 2 )", new String[] { "numeric( 7, 2 )" }, "12345.67", "12345.67" );
+ }
+
public void test_varchar_String_String()
throws Exception
{
declareAndRunFunction
( "varchar_String_String", "varchar( 10 )", new String[] { "varchar( 10 )" }, "'3.0'", "3.0" );
}
-
+
///////////////////////////////////////////////////////////////////////////////////
//
// SHOULD NOT RESOLVE