Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8206122

Use Queue in place of ArrayList when need to remove first element

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P5
    • 12
    • None
    • tools
    • b03

    Description

      There are couple of places where ArrayList is used a FIFO structure.
      Using ArrayDeque would be more efficient.

      src/jdk.compiler/share/classes/com/sun/tools/javac/api/JavacTaskPool.java
          private final Map<List<String>, List<ReusableContext>> options2Contexts;
      (value type is in fact ArrayList)

      src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Analyzer.java
              Map<ClassSymbol, ArrayList<RewritingContext>> Q = new HashMap<>();

      Attachments

        Issue Links

          Activity

            People

              igerasim Ivan Gerasimov
              igerasim Ivan Gerasimov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: