diff --git a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java index 32a704d91f..39f4f09301 100644 --- a/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java +++ b/pmd-scala-modules/pmd-scala-common/src/main/java/net/sourceforge/pmd/lang/scala/ast/ScalaTreeBuilder.java @@ -6,9 +6,10 @@ package net.sourceforge.pmd.lang.scala.ast; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayDeque; +import java.util.Deque; import java.util.HashMap; import java.util.Map; -import java.util.Stack; import scala.meta.Case; import scala.meta.Ctor; @@ -171,7 +172,7 @@ class ScalaTreeBuilder { } // The nodes having children built. - private final Stack> nodes = new Stack<>(); + private final Deque> nodes = new ArrayDeque<>(); private static void register(Class nodeType, Class> nodeAdapterType) {