Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5045213

SyncFactory.getRegisteredProviders() returns wrong Enumeration

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      sparc
    • OS:
      solaris_2.6

      Description



      Name: vsR10316 Date: 05/11/2004


      Filed By : SPB JCK team (###@###.###)
      JDK :
      JCK : 1.5
      Platform[s] : Solaris
      switch/Mode :
      JCK test owner : http://javaweb.eng/jct/sqe/JCK-tck/usr/owners.jto
      Failing Test [s] : N/A


      Specification excerpt:
      ======================
      --------- J2SE API spec v.1.5 ---------
      ...

      javax.sql.rowset.spi.SyncFactory.getRegisteredProviders

      public static Enumeration<SyncProvider> getRegisteredProviders()
                                                              throws SyncFactoryException
      ...
      ---------- end-of-excerpt ---------------

      Problem description
      ===================
      Actually this method returns Enumeration<String> instead of Enumeration<SyncProvider>. So, it cause ClassCastException to be thrown.

      Should returns Enumeration containing documented elements.

          
      Minimized test:
      ===============
      ------- Test.java -------
      import javax.sql.rowset.*;
      import javax.sql.rowset.spi.*;
      import java.util.*;

      public class Test {

          public static void main(String [] arg) {
          try {
           Enumeration<SyncProvider> e = SyncFactory.getRegisteredProviders();
           while(e.hasMoreElements()){
           System.out.println(e.nextElement().getProviderID());
           }
          } catch (Exception e){
           e.printStackTrace();
          }
          }
      }
      ------- end-of-Test.java -------

      Minimized test output:
      ======================
      C:\temp>O:\JDK1.5.0b50\windows-i586\bin\java.exe Test
      java.lang.ClassCastException: java.lang.String
              at Test.main(Test.java:11)

      JCK test source location:
      ==========================
      /java/re/jck/1.5/promoted/latest/JCK-runtime-15/tests

      Additional comments:
      ====================
      Test.java should be compiled with "-source 1.5" option enabled.
          
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ahandasunw Amit Handa (Inactive)
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: