Derby
  1. Derby
  2. DERBY-5076

[patch] move instanceof check up above where casts occur

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.8.1.2
    • Component/s: Network Client
    • Labels:
      None
    • Urgency:
      Low

      Description

      code does an instanceof check on Diagnosable much after multiple casts to Diagnosable occurs above it.

      Move the instanceof check up before the first cast, so that it does some good.

      1. move_instanceof_check.diff
        6 kB
        Dave Brosius
      2. unnecessary_casts.diff
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Thanks, Dave!

        It looks to me that the casts are unnecessary in the first place, since the declared type client.am.SqlException implements the Diagnosable interface. Uploading an updated patch that removes the casts and the instanceof check.

        Running regression tests.

        Show
        Knut Anders Hatlen added a comment - Thanks, Dave! It looks to me that the casts are unnecessary in the first place, since the declared type client.am.SqlException implements the Diagnosable interface. Uploading an updated patch that removes the casts and the instanceof check. Running regression tests.
        Hide
        Knut Anders Hatlen added a comment -

        All the regression tests ran cleanly.

        Committed revision 1075842.

        Show
        Knut Anders Hatlen added a comment - All the regression tests ran cleanly. Committed revision 1075842.

          People

          • Assignee:
            Dave Brosius
            Reporter:
            Dave Brosius
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development