Skip to content

Commit

Permalink
[jOOQ#117] Use LinkedHashMap to store compilation objects
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaseder committed Nov 23, 2021
1 parent 085dde8 commit 7986382
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions jOOR-java-8/src/main/java/org/joor/Compile.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -214,7 +213,7 @@ static final class ClassFileManager extends ForwardingJavaFileManager<StandardJa
ClassFileManager(StandardJavaFileManager standardManager) {
super(standardManager);

fileObjectMap = new HashMap<>();
fileObjectMap = new LinkedHashMap<>();
}

@Override
Expand All @@ -235,7 +234,7 @@ boolean isEmpty() {

Map<String, byte[]> classes() {
if (classes == null) {
classes = new HashMap<>();
classes = new LinkedHashMap<>();

for (Entry<String, JavaFileObject> entry : fileObjectMap.entrySet())
classes.put(entry.getKey(), entry.getValue().getBytes());
Expand Down
7 changes: 3 additions & 4 deletions jOOR/src/main/java/org/joor/Compile.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
import java.net.URI;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
Expand Down Expand Up @@ -214,7 +213,7 @@ static final class ClassFileManager extends ForwardingJavaFileManager<StandardJa
ClassFileManager(StandardJavaFileManager standardManager) {
super(standardManager);

fileObjectMap = new HashMap<>();
fileObjectMap = new LinkedHashMap<>();
}

@Override
Expand All @@ -235,7 +234,7 @@ boolean isEmpty() {

Map<String, byte[]> classes() {
if (classes == null) {
classes = new HashMap<>();
classes = new LinkedHashMap<>();

for (Entry<String, JavaFileObject> entry : fileObjectMap.entrySet())
classes.put(entry.getKey(), entry.getValue().getBytes());
Expand Down

0 comments on commit 7986382

Please sign in to comment.