harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r548553 - in /harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi: ProviderImpl.java SyncFactory.java
Date Tue, 19 Jun 2007 01:56:08 GMT
Author: tonywu
Date: Mon Jun 18 18:56:07 2007
New Revision: 548553

URL: http://svn.apache.org/viewvc?view=rev&rev=548553
Log:
Apply patch HARMONY-4197 ([classlib][sql]SyncFactory.getInstance cannot find the providers
that are in the default package)

Modified:
    harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/ProviderImpl.java
    harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/ProviderImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/ProviderImpl.java?view=diff&rev=548553&r1=548552&r2=548553
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/ProviderImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/ProviderImpl.java
Mon Jun 18 18:56:07 2007
@@ -25,7 +25,8 @@
         className = name;
 
         try {
-            Class<?> implClass = Class.forName(className);
+			Class<?> implClass = Class.forName(className, true, Thread
+					.currentThread().getContextClassLoader());
             impl = (SyncProvider) implClass.newInstance();
         } catch (ClassNotFoundException e) {
             errMsg = Messages.getString("sql.40", className); //$NON-NLS-1$
@@ -41,7 +42,11 @@
         this.version = version;
     }
 
-    public SyncProvider getImpl() {
+    public SyncProvider getImpl() throws SyncFactoryException {
+		if (null == impl) {
+			throw new SyncFactoryException(Messages.getString(
+					"sql.40", className)); //$NON-NLS-1$
+		}
         return impl;
     }
 

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java?view=diff&rev=548553&r1=548552&r2=548553
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/main/java/javax/sql/rowset/spi/SyncFactory.java
Mon Jun 18 18:56:07 2007
@@ -86,10 +86,13 @@
     private static Enumeration<SyncProvider> getRegisteredProvidersImpl() {
         if (!initialized) {
             // 1. load from System property
-            String sysProvider = System.getProperty(ROWSET_SYNC_PROVIDER);
-            if (sysProvider != null) {
-                providers.put(sysProvider, new ProviderImpl(sysProvider));
-            }
+        	String rowsetPropStr = System.getProperty(ROWSET_SYNC_PROVIDER);
+        	if (rowsetPropStr != null) {
+        		String[] sysProviders = rowsetPropStr.split(":"); //$NON-NLS-1$    			
+				for (String sysProvider : sysProviders) {
+					providers.put(sysProvider, new ProviderImpl(sysProvider));
+				}   		
+        	}
 
             // 2. looks in the resource file
             Properties rowsetProp = new Properties();



Mime
View raw message