You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Tony Wu (JIRA)" <ji...@apache.org> on 2007/06/18 13:51:26 UTC

[jira] Assigned: (HARMONY-4197) [classlib][sql]SyncFactory.getInstance cannot find the providers that are in the default package

     [ https://issues.apache.org/jira/browse/HARMONY-4197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tony Wu reassigned HARMONY-4197:
--------------------------------

    Assignee: Tony Wu

> [classlib][sql]SyncFactory.getInstance cannot find the providers that are in the default package
> ------------------------------------------------------------------------------------------------
>
>                 Key: HARMONY-4197
>                 URL: https://issues.apache.org/jira/browse/HARMONY-4197
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: Windows XP / Linux
>            Reporter: Ruth Cao
>            Assignee: Tony Wu
>         Attachments: Harmony-4197.diff
>
>
> SyncFactory.getInstance(String) is not able to return the providers which are in the default package. The following test case shows this problem:
> public class SyncFactoryTest {
>         static String providerName = "DummyProvider";
>         public static void main( String args[] ) {
>                 try {
>                         System.out.println("Provider name is " + providerName);
>                         SyncFactory.registerProvider(providerName);
>                         System.out.println("Provider registered.");
>                         SyncProvider provider = SyncFactory.getInstance(providerName);
>                         System.out.println("Got Instance of Provider.");
>                         if( provider == null ) {
>                                 System.out.println("That shouldn't have happened. The provider is null");
>                         } else {
>                                 System.out.println("Provider retrieved is " + provider.getProviderID() );
>                         }
>                 } catch (Exception e) {
>                         System.out.println("Caught an exception!");
>                         e.printStackTrace();
>                 } finally {
>                        System.unregisterProvider(providerName);
>                }
>         }
> }
> public class DummyProvider extends SyncProvider {
>                 public String getProviderID() {
>                         return getClass().getName();
>                 }
>                 public String getVendor() {
>                         return "Me";
>                 }
>                 public String getVersion() {
>                         return "2.0";
>                 }
>                 public int supportsUpdatableView() {
>                         return 0;
>                 }
>                 public int getDataSourceLock() {
>                         return 0;
>                 }
>                 public void setDataSourceLock( int i ) {}
>                 public int getProviderGrade() {
>                         return 0;
>                 }
>                 public RowSetWriter getRowSetWriter() {
>                         return null;
>                 }
>                 public RowSetReader getRowSetReader() {
>                         return null;
>                 }
> }
> RI prints: Provider retrieved is DummyProvider
> while Harmony prints: Caught an exception! javax.sql.rowset.spi.SyncFactoryException: ClassNotFoundException: DummyProvider
> ...
> It seems that the way Harmony looks for the provider class is different from RI. I'll create a patch for this soon, thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.