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

Use modern collections in impl/sql/compile

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

Details

    Description

      The code in the org.apache.derby.impl.sql.compile package predates the Java Collections Framework and uses old-style collections like java.util.Vector and java.util.Hashtable. Since the old-style collection classes are used in many method signatures, it's difficult to use modern collection classes when adding new code.

      I suggest we switch to using interfaces (like java.util.List and java.util.Map) instead of specific classes in the signatures, so that we have more flexibility in choosing the right collection class for the job.

      Only changing the signatures would allow us to continue using Vector and Hashtable, since they implement the interfaces. However, I think it would be good to switch to ArrayList and HashMap in a second step. The instances in impl/sql/compile are not shared between threads, so we don't need the synchronization provided by the old-style classes. Switching to unsynchronized classes may make compilation slightly faster.

      Attachments

        1. Compile.java
          0.9 kB
          Knut Anders Hatlen
        2. d6075-10a-aggregate-vectors.diff
          8 kB
          Knut Anders Hatlen
        3. d6075-11a-remaining-vectors.diff
          20 kB
          Knut Anders Hatlen
        4. d6075-12a-stack.diff
          2 kB
          Knut Anders Hatlen
        5. d6075-13a-unused-properties.diff
          22 kB
          Knut Anders Hatlen
        6. d6075-14a-dead-syntax.diff
          25 kB
          Knut Anders Hatlen
        7. d6075-15a-sqlgrammar-vectors.diff
          13 kB
          Knut Anders Hatlen
        8. d6075-16a-negative-test.diff
          1 kB
          Knut Anders Hatlen
        9. d6075-17a-rename-aggregate-vectors.diff
          106 kB
          Knut Anders Hatlen
        10. d6075-18a-rename.diff
          30 kB
          Knut Anders Hatlen
        11. d6075-1a-CollectNodesVisitor.diff
          28 kB
          Knut Anders Hatlen
        12. d6075-2a-bindExpression.diff
          78 kB
          Knut Anders Hatlen
        13. d6075-3a-javadoc.diff
          2 kB
          Knut Anders Hatlen
        14. d6075-4a-parameterList.diff
          16 kB
          Knut Anders Hatlen
        15. d6075-5a-ordering.diff
          6 kB
          Knut Anders Hatlen
        16. d6075-6a-DMLModStatementNode.diff
          4 kB
          Knut Anders Hatlen
        17. d6075-7a-more-signatures.diff
          38 kB
          Knut Anders Hatlen
        18. d6075-8a-local-hashtables.diff
          10 kB
          Knut Anders Hatlen
        19. d6075-9a-hashtable-fields.diff
          13 kB
          Knut Anders Hatlen

        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:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment