db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmars...@apache.org
Subject svn commit: r264135 - in /db/derby/code/branches/10.1/java: testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
Date Mon, 29 Aug 2005 13:14:19 GMT
Author: kmarsden
Date: Mon Aug 29 06:14:13 2005
New Revision: 264135

URL: http://svn.apache.org/viewcvs?rev=264135&view=rev
Log:
merge change 239718 from the trunk.

DERBY-470 - Exception when using LOCALIZEDDISPLAY with JSR169

1. Check for BigDecimal class in the JVM by doing a Class.forName
2. Call getNumberAsString for NUMERIC and DECIMAL types only if BigDecimal class is available.
Otherwise, return rs.getString.

                Contributed by Deepa Remesh



Modified:
    db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties
    db/derby/code/branches/10.1/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java

Modified: db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties?rev=264135&r1=264134&r2=264135&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties
(original)
+++ db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/i18n/I18NImportExport_app.properties
Mon Aug 29 06:14:13 2005
@@ -1,7 +1,4 @@
 supportfiles=tests/i18n/data/Tab1_fr.ctrl,tests/i18n/data/Tab1_il.ctrl,tests/i18n/data/Tab1_jp.ctrl
 usedefaults=true
 derby.ui.locale=en_US
-useextdirs=true
-
-#Exclude for J2ME/Foundation - test requires java.math.BigDecimal
-runwithfoundation=false
\ No newline at end of file
+useextdirs=true
\ No newline at end of file

Modified: db/derby/code/branches/10.1/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
URL: http://svn.apache.org/viewcvs/db/derby/code/branches/10.1/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java?rev=264135&r1=264134&r2=264135&view=diff
==============================================================================
--- db/derby/code/branches/10.1/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
(original)
+++ db/derby/code/branches/10.1/java/tools/org/apache/derby/iapi/tools/i18n/LocalizedResource.java
Mon Aug 29 06:14:13 2005
@@ -44,6 +44,19 @@
 
 public final class LocalizedResource  implements java.security.PrivilegedAction {
 
+	private static boolean HAVE_BIG_DECIMAL;
+	
+	{
+		boolean haveBigDecimal;
+		try {
+			Class.forName("java.math.BigDecimal");
+			haveBigDecimal = true;
+		} catch (Throwable t) {
+			haveBigDecimal = false;
+		}
+		HAVE_BIG_DECIMAL = haveBigDecimal;
+	}
+	
 	private ResourceBundle res;
 	private Locale locale;
 	private String encode;
@@ -305,7 +318,7 @@
 					type == Types.DOUBLE ) {
 				return getNumberAsString(rs.getDouble(columnNumber));
 			}
-			else if (type == Types.NUMERIC || type == Types.DECIMAL ) {
+			else if (HAVE_BIG_DECIMAL && (type == Types.NUMERIC || type == Types.DECIMAL))
{
 				return	getNumberAsString(rs.getBigDecimal(columnNumber,
 											rsm.getScale(columnNumber)));
 			}



Mime
View raw message