Derby
  1. Derby
  2. DERBY-4412

Make getNegation() abstract in BinaryComparisonOperatorNode and UnaryComparisonOperatorNode

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 10.6.1.0
    • Fix Version/s: 10.6.1.0
    • Component/s: SQL
    • Labels:
      None

      Description

      Both BinaryComparisonOperatorNode and UnaryComparisonOperatorNode have a method called getNegation() with the following code:

      /* Keep the compiler happy - this method should never be called.

      • We should always be calling the method in a sub-class.
        */
        if (SanityManager.DEBUG)
        SanityManager.ASSERT(false,
        "expected to call getNegation() for subclass " +
        getClass().toString());
        return this;

      Instead of relying on asserts to detect missing method overrides at run-time, we should make the methods abstract so that such errors are detected by the compiler.

      1. abstract.diff
        2 kB
        Knut Anders Hatlen

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        2h 46m 1 Knut Anders Hatlen 19/Oct/09 16:12
        In Progress In Progress Closed Closed
        20h 8m 1 Knut Anders Hatlen 20/Oct/09 12:20
        Gavin made changes -
        Workflow jira [ 12479795 ] Default workflow, editable Closed status [ 12798855 ]
        Knut Anders Hatlen made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Issue & fix info [Patch Available]
        Fix Version/s 10.6.0.0 [ 12313727 ]
        Resolution Fixed [ 1 ]
        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 827035.

        Show
        Knut Anders Hatlen added a comment - Committed revision 827035.
        Knut Anders Hatlen made changes -
        Issue & fix info [Patch Available]
        Hide
        Knut Anders Hatlen added a comment -

        All the regression tests passed.

        Show
        Knut Anders Hatlen added a comment - All the regression tests passed.
        Knut Anders Hatlen made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Knut Anders Hatlen made changes -
        Field Original Value New Value
        Attachment abstract.diff [ 12422549 ]
        Hide
        Knut Anders Hatlen added a comment -

        The attached patch makes the two methods abstract. Also, the UnaryComparisonOperatorNode class had to be made abstract. BinaryComparisonOperatorNode was already abstract. I've started the regression tests.

        Show
        Knut Anders Hatlen added a comment - The attached patch makes the two methods abstract. Also, the UnaryComparisonOperatorNode class had to be made abstract. BinaryComparisonOperatorNode was already abstract. I've started the regression tests.
        Knut Anders Hatlen created issue -

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development