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

(file) DirectoryStream#iterator's remove method throws wrong exception when stream is closed

XMLWordPrintable

    • b75
    • generic
    • generic

      "Once a directory stream is closed, all further method invocations on the iterator throw ConcurrentModificationException with cause ClosedDirectoryStreamException".

      At this time (jdk7-b71), the remove method does not wrap the ClosedDirectoryStreamException in a CME.
      A second issue is that next/hasNext throw ConcurrentModificationException(IllegalStateException) rather than the more specific ConcurrentModificationException(ClosedDirectoryStreamException) as specified.

            alanb Alan Bateman
            alanb Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: