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

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

XMLWordPrintable

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

      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<>();

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

              Created:
              Updated:
              Resolved: