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

Remove ReuseFactory

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.13.1.0
    • 10.13.1.0
    • Services
    • None

    Description

      ReuseFactory used to help reduce object allocations when converting numbers/booleans from primitive types to object types. After DERBY-2383 and DERBY-6230, the ReuseFactory methods are just wrappers around standard library methods such as Integer.valueOf() and Long.valueOf().

      Callers could just as easily call the corresponding valueOf() method directly, or rely on auto-boxing. Both ways use the same cache as ReuseFactory currently does, so ReuseFactory has no purpose anymore.

      One exception: ReuseFactory.getZeroLenByteArray() is still used and provides value, as it avoids the allocation cost when an empty byte array is needed. The ArrayUtil class is probably just as good a home for it, so I propose we move it there and remove the ReuseFactory class.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment