Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-4412

Make getNegation() abstract in BinaryComparisonOperatorNode and UnaryComparisonOperatorNode

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.6.1.0
    • 10.6.1.0
    • SQL
    • 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.

      Attachments

        1. abstract.diff
          2 kB
          Knut Anders Hatlen

        Activity

          People

            knutanders Knut Anders Hatlen
            knutanders Knut Anders Hatlen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: