Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.4
-
None
Description
One of last statements in AstBuilder.visitImportDeclaration() are
moduleNode.addImport(alias, classNode, annotationNodeList); importNode = last(moduleNode.getImports());
Since ModuleNode.imports is a HashMap, last() method return unpredictable result.
I guess this can be fixed by changing the implementation of ModuleNode.imports into LinkedHashMap instead of HashMap as is currently.
I stumbled on this while trying to use CodeNarc with the latest Groovy.