diff --git a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java index 8c7fd5bedc8..c7cd4087ad7 100644 --- a/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java +++ b/org.eclipse.jdt.core.javac/src/org/eclipse/jdt/core/dom/JavacConverter.java @@ -1660,6 +1660,13 @@ private List convert(JCModifiers modifiers, ASTNode parent) { while(mods.hasNext()) { res.add(convert(mods.next(), modifiers.pos, parent.getStartPosition() + parent.getLength())); } + res.sort(new Comparator() { + @Override + public int compare(IExtendedModifier o1, IExtendedModifier o2) { + ASTNode a1 = (ASTNode)o1; + ASTNode a2 = (ASTNode)o2; + return a1.getStartPosition() - a2.getStartPosition(); + }}); return res; }