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

(spec) Deque.push specifies that it returns a value but the method is void

XMLWordPrintable

        A DESCRIPTION OF THE PROBLEM :
        The specification for java.util.Deque.push() states that this method
        "returns true upon success", but this is not true because push() cannot return any result because it is void.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, throwing an IllegalStateException if no space is currently available.
        ACTUAL -
        Pushes an element onto the stack represented by this deque (in other words, at the head of this deque) if it is possible to do so immediately without violating capacity restrictions, returning true upon success and throwing an IllegalStateException if no space is currently available.

        URL OF FAULTY DOCUMENTATION :
        http://docs.oracle.com/javase/7/docs/api/java/util/Deque.html#push(E)

              chegar Chris Hegarty
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: