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

CheckedQueue.offer calls wrong method on wrapped queue

    Details

    • Subcomponent:
    • Resolved In Build:
      b22
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: