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

javax.sql.rowset.Predicate documentation wrong algorithm example

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P4
    • 8
    • 7
    • core-libs
    • b108
    • x86
    • windows_7

    Description

      A DESCRIPTION OF THE PROBLEM :
      The example of code is not accurate and does not represent what the class is intended to do. The Range class example states the value should be within a 2 values, but the algorithm example shows that the value must be >= than the 2 values.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      if ((rs.getObject(idx[i]) >= lo[i]) &&
                        (rs.getObject(idx[i]) <= hi[i]) {
                        bool1 = true; // within filter constraints
                } else {
                  bool2 = true; // outside of filter constraints
                }
      ACTUAL -
      if ((rs.getObject(idx[i]) >= lo[i]) &&
                        (rs.getObject(idx[i]) >= hi[i]) {
                        bool1 = true; // within filter constraints
                } else {
                  bool2 = true; // outside of filter constraints
                }

      URL OF FAULTY DOCUMENTATION :
      http://download.oracle.com/javase/7/docs/api/javax/sql/rowset/Predicate.html

      Attachments

        Activity

          People

            lancea Lance Andersen
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: