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

remove unneeded object creation in newException() calls in releases > 10.10

    XMLWordPrintableJSON

Details

    • Known fix, Newcomer

    Description

      In releases after 10.10 the code has been converted to use new
      java language features. One of the benefits I just noticed is that
      arguments to StandardException.newException() no longer have
      to be Objects. I believe this is due to reimplementation using varargs.

      As an example old code use to have to be written as:
      throw StandardException.newException(
      SQLState.FILE_BAD_CHECKSUM,
      id,
      new Long(checksum.getValue()),
      new Long(onDiskChecksum),
      pagedataToHexDump(pageData));

      The only reason for the new Long() calls was to make them Objects so
      that the call would match up to a hard coded N Object arg version of
      the newException call. I believe these conversions to Objects are no
      longer needed (but formatting of the args might change).

      There may be code size savings to be had by doing this code
      rototil.

      Anyone see a downside to changing the code in this way?

      Attachments

        1. Derby-6391.diff
          0.6 kB
          Danoja Dias

        Issue Links

          Activity

            People

              Dnj Danoja Dias
              mikem Mike Matrigali
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: