Skip to content

Commit ba3672a

Browse files
committed
Replace source code generation with bytecode generation
1 parent 4fb97e2 commit ba3672a

File tree

7 files changed

+45
-476
lines changed

7 files changed

+45
-476
lines changed

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535

3636
<dependencies>
3737

38+
<dependency>
39+
<groupId>org.ow2.asm</groupId>
40+
<artifactId>asm</artifactId>
41+
<version>5.1</version>
42+
</dependency>
43+
3844
<dependency>
3945
<groupId>com.intellij</groupId>
4046
<artifactId>annotations</artifactId>

src/main/java/net/openhft/smoothie/CachedCompiler.java

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/main/java/net/openhft/smoothie/CompilerUtils.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@
1919
import org.jetbrains.annotations.NotNull;
2020
import org.jetbrains.annotations.Nullable;
2121

22-
import javax.tools.JavaCompiler;
23-
import javax.tools.StandardJavaFileManager;
24-
import javax.tools.ToolProvider;
2522
import java.lang.reflect.InvocationTargetException;
2623
import java.lang.reflect.Method;
2724

@@ -30,11 +27,8 @@
3027
*/
3128
enum CompilerUtils {
3229
;
33-
public static final CachedCompiler CACHED_COMPILER = new CachedCompiler();
3430

3531
private static final Method DEFINE_CLASS_METHOD;
36-
static JavaCompiler s_compiler;
37-
static StandardJavaFileManager s_standardJavaFileManager;
3832

3933
static {
4034
try {
@@ -46,25 +40,6 @@ enum CompilerUtils {
4640
}
4741
}
4842

49-
static {
50-
reset();
51-
}
52-
53-
private static void reset() {
54-
s_compiler = ToolProvider.getSystemJavaCompiler();
55-
if (s_compiler == null) {
56-
try {
57-
Class<?> javacTool = Class.forName("com.sun.tools.javac.api.JavacTool");
58-
Method create = javacTool.getMethod("create");
59-
s_compiler = (JavaCompiler) create.invoke(null);
60-
} catch (Exception e) {
61-
throw new AssertionError(e);
62-
}
63-
}
64-
65-
s_standardJavaFileManager = s_compiler.getStandardFileManager(null, null, null);
66-
}
67-
6843
/**
6944
* Define a class for byte code.
7045
*

src/main/java/net/openhft/smoothie/JavaSourceFromString.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/main/java/net/openhft/smoothie/MyJavaFileManager.java

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)