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

CheckedQueue.offer calls wrong method on wrapped queue

XMLWordPrintable

    • b22
    • generic
    • generic
    • Verified

        FULL PRODUCT VERSION :


        A DESCRIPTION OF THE PROBLEM :
        In java.util.Collections.CheckedQueue, the offer() method calls the add() method of the wrapped queue instead of offer(). They do not do the same thing!

        This is the offending code:

            public boolean offer(E e) {
                typeCheck(e);
                return add(e);
            }

        Should be:

            public boolean offer(E e) {
                typeCheck(e);
                return queue.offer(e);
            }



        REPRODUCIBILITY :
        This bug can be reproduced always.

              mduigou Mike Duigou
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Created:
                Updated:
                Resolved: