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

AbstractSelectableChannel.register() throws ClassCastException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 1.4.0
    • 1.4.0
    • core-libs
    • beta
    • sparc
    • solaris_7
    • Verified

      1.4 Build B-54

      ----------- test code ------------
      try {
      Selector pipeSelector = Selector.open() ;
      Pipe pipe = Pipe.open();
      Pipe.SourceChannel sourceChannel = pipe.source();
      sourceChannel.configureBlocking(false);
      System.out.println("Configured to nonblocking mode. isBlocking()= " + sourceChannel.isBlocking());
      SelectionKey pipeKey = sourceChannel.register(pipeSelector,
                                                        SelectionKey.OP_READ);

         System.out.println("isRegistered()= " + sourceChannel.isRegistered());

      } catch (Exception e) {
      System.out.println("FAIL : unexpected Exception ! ");
      e.printStackTrace() ;
      }
      ---------- results --------------
      FAIL : unexpected Exception !
      java.lang.ClassCastException: sun.nio.ch.SourceChannelImpl
      at sun.nio.ch.SelectorImpl.register(SelectorImpl.java:179)
      at java.nio.spi.AbstractSelectableChannel.register(AbstractSelectableChannel.java:150)
      :
      :

            mmcclosksunw Michael Mccloskey (Inactive)
            hvilekar Harshad Vilekar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: