Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void adapt(
ASTCDCompilationUnit refCD = JavaLoader.loadCD(referenceCD);
ASTCDCompilationUnit conCD = JavaLoader.loadCD(concreteCD);

Set<ASTOrdinaryCompilationUnit> adaptedCode = new HashSet<>();
Set<ASTOrdinaryCompilationUnit> adaptedCode = new LinkedHashSet<>();

for (String mapping : mappings) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public BasicUpdateHandler(
public void handleUpdate(Set<ASTOrdinaryCompilationUnit> javaFiles) {

// Collect elements of each type
Set<JavaAstElemCollector> typeElements = new HashSet<>();
Set<JavaAstElemCollector> typeElements = new LinkedHashSet<>();
for (ASTOrdinaryCompilationUnit ast : javaFiles) {

// collect code elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static String mkTemplateFormInfix(String name, List<ISymbol> infixList) {
public static List<ISymbol> cleanReferences(String name, List<ISymbol> infixList) {
List<String> refs =
infixList.stream().map(ref -> ref.getName().toLowerCase()).collect(Collectors.toList());
Map<Integer, ISymbol> refMap = new HashMap<>();
Map<Integer, ISymbol> refMap = new LinkedHashMap<>();

for (int i = 0; i < refs.size(); i++) {
refMap.put(name.toLowerCase().indexOf(refs.get(i)), infixList.get(i));
Expand Down Expand Up @@ -189,7 +189,7 @@ public static List<ISymbol> cleanReferences(List<ISymbol> references) {
return references;
}

Set<ISymbol> temps = new HashSet<>(references);
Set<ISymbol> temps = new LinkedHashSet<>(references);
for (ISymbol symbol : temps) {
for (ISymbol symbol1 : temps) {
if (!symbol.equals(symbol1) && (matchInfix(symbol.getName(), symbol1.getName()))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class SpoonUpdater implements CodeUpdater {
private File outputDir;
private Launcher launcher;
private CtModel spoonModel;
private final Map<ASTTypeDeclaration, CtType<?>> typeMap = new HashMap<>();
private final Map<ASTMethodDeclaration, CtMethod<?>> methodMap = new HashMap<>();
private final Map<ASTTypeDeclaration, CtType<?>> typeMap = new LinkedHashMap<>();
private final Map<ASTMethodDeclaration, CtMethod<?>> methodMap = new LinkedHashMap<>();

@Override
public void setCodePath(Path path) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
public class AdapterUtils {

public static Set<ASTCDType> getAllCDTypes(ASTCDCompilationUnit cd) {
Set<ASTCDType> res = new HashSet<>();
Set<ASTCDType> res = new LinkedHashSet<>();
res.addAll(cd.getCDDefinition().getCDClassesList());
res.addAll(cd.getCDDefinition().getCDInterfacesList());
res.addAll(cd.getCDDefinition().getCDEnumsList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public static void writeFile(Path path, String content) {
* @return A set of Java files represented as ASTOrdinaryCompilationUnit.
*/
public static Set<ASTOrdinaryCompilationUnit> readJavaCode(Path directoryPath) {
Set<File> res = new HashSet<>();
Set<File> res = new LinkedHashSet<>();
readJavaCode(directoryPath, res);
return res.stream().map(JavaLoader::loadJava).collect(Collectors.toSet());
}
Expand All @@ -179,7 +179,7 @@ public static Set<ASTOrdinaryCompilationUnit> readJavaCode(Path directoryPath) {
* @return A set of Java files as File objects.
*/
public static Set<File> readJavaFile(Path directoryPath) {
Set<File> res = new HashSet<>();
Set<File> res = new LinkedHashSet<>();
readJavaCode(directoryPath, res);
return res;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

public class JavaAstElemCollector implements JavaDSLVisitor2 {
private final List<ASTTypeDeclaration> typeDeclarations = new ArrayList<>();
private final Map<ASTTypeDeclaration, TypeElementCollector> typeElements = new HashMap<>();
private final Map<ASTTypeDeclaration, TypeElementCollector> typeElements = new LinkedHashMap<>();

@Override
public void visit(ASTClassDeclaration node) {
Expand Down Expand Up @@ -109,8 +109,8 @@ class TypeElementCollector implements JavaDSLVisitor2, JavaLightVisitor2 {
List<ASTFieldDeclaration> fieldDeclarations = new ArrayList<>();
List<ASTMCType> supertypesDeclarations = new ArrayList<>();

Map<ASTMethodDeclaration, List<ASTLocalVariableDeclaration>> localVarsMap = new HashMap<>();
Map<ASTMethodDeclaration, List<ASTFormalParameter>> formalParamsMap = new HashMap<>();
Map<ASTMethodDeclaration, List<ASTLocalVariableDeclaration>> localVarsMap = new LinkedHashMap<>();
Map<ASTMethodDeclaration, List<ASTFormalParameter>> formalParamsMap = new LinkedHashMap<>();

@Override
public void visit(ASTMethodDeclaration node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public boolean isValid(ASTCDCompilationUnit refCD, Path refCode) {
asts.forEach(ast -> runCoCosPhase2(ast, refCD));

// check that all elements matched
Set<ASTTypeDeclaration> allType = new HashSet<>();
Set<ASTTypeDeclaration> allType = new LinkedHashSet<>();
for (ASTOrdinaryCompilationUnit ast : asts) {
JavaAstElemCollector collector = new JavaAstElemCollector();
JavaDSLTraverser traverser = JavaDSLMill.traverser();
Expand Down