Selaa lähdekoodia

Removed some unneeded static fields

Jared 5 vuotta sitten
vanhempi
commit
aaca0261f1
No account linked to committer's email address

+ 4
- 3
CodeModel/src/main/java/org/openzen/zenscript/codemodel/annotations/NativeAnnotationDefinition.java Näytä tiedosto

@@ -5,8 +5,6 @@
5 5
  */
6 6
 package org.openzen.zenscript.codemodel.annotations;
7 7
 
8
-import java.util.Collections;
9
-import java.util.List;
10 8
 import org.openzen.zencode.shared.CodePosition;
11 9
 import org.openzen.zenscript.codemodel.FunctionHeader;
12 10
 import org.openzen.zenscript.codemodel.FunctionParameter;
@@ -24,6 +22,9 @@ import org.openzen.zenscript.codemodel.statement.Statement;
24 22
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
25 23
 import org.openzen.zenscript.codemodel.type.StringTypeID;
26 24
 
25
+import java.util.Collections;
26
+import java.util.List;
27
+
27 28
 /**
28 29
  *
29 30
  * @author Hoofdgebruiker
@@ -31,7 +32,7 @@ import org.openzen.zenscript.codemodel.type.StringTypeID;
31 32
 public class NativeAnnotationDefinition implements AnnotationDefinition {
32 33
 	public static final NativeAnnotationDefinition INSTANCE = new NativeAnnotationDefinition();
33 34
 	
34
-	private static final List<FunctionHeader> INITIALIZERS = Collections.singletonList(
35
+	private final List<FunctionHeader> INITIALIZERS = Collections.singletonList(
35 36
 			new FunctionHeader(BasicTypeID.VOID, StringTypeID.UNIQUE));
36 37
 	
37 38
 	private NativeAnnotationDefinition() {}

+ 23
- 10
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/definitions/JavaDefinitionVisitor.java Näytä tiedosto

@@ -1,32 +1,45 @@
1 1
 package org.openzen.zenscript.javabytecode.compiler.definitions;
2 2
 
3
-import org.openzen.zenscript.codemodel.member.MethodMember;
4
-import org.openzen.zenscript.javashared.*;
5 3
 import org.objectweb.asm.ClassWriter;
6 4
 import org.objectweb.asm.Opcodes;
7
-import org.openzen.zenscript.codemodel.definition.*;
5
+import org.openzen.zenscript.codemodel.definition.AliasDefinition;
6
+import org.openzen.zenscript.codemodel.definition.ClassDefinition;
7
+import org.openzen.zenscript.codemodel.definition.DefinitionVisitor;
8
+import org.openzen.zenscript.codemodel.definition.EnumDefinition;
9
+import org.openzen.zenscript.codemodel.definition.ExpansionDefinition;
10
+import org.openzen.zenscript.codemodel.definition.FunctionDefinition;
11
+import org.openzen.zenscript.codemodel.definition.InterfaceDefinition;
12
+import org.openzen.zenscript.codemodel.definition.StructDefinition;
13
+import org.openzen.zenscript.codemodel.definition.VariantDefinition;
8 14
 import org.openzen.zenscript.codemodel.generic.TypeParameter;
9 15
 import org.openzen.zenscript.codemodel.member.IDefinitionMember;
16
+import org.openzen.zenscript.codemodel.member.ImplementationMember;
10 17
 import org.openzen.zenscript.codemodel.type.BasicTypeID;
11 18
 import org.openzen.zenscript.codemodel.type.GenericTypeID;
19
+import org.openzen.zenscript.codemodel.type.StoredType;
12 20
 import org.openzen.zenscript.javabytecode.JavaBytecodeContext;
13
-import org.openzen.zenscript.javabytecode.compiler.*;
21
+import org.openzen.zenscript.javabytecode.compiler.CompilerUtils;
22
+import org.openzen.zenscript.javabytecode.compiler.JavaClassWriter;
23
+import org.openzen.zenscript.javabytecode.compiler.JavaStatementVisitor;
24
+import org.openzen.zenscript.javabytecode.compiler.JavaWriter;
25
+import org.openzen.zenscript.javashared.JavaClass;
26
+import org.openzen.zenscript.javashared.JavaMethod;
27
+import org.openzen.zenscript.javashared.JavaModifiers;
28
+import org.openzen.zenscript.javashared.JavaTypeGenericVisitor;
29
+import org.openzen.zenscript.javashared.JavaVariantOption;
14 30
 
15
-import java.io.FileNotFoundException;
16 31
 import java.io.FileOutputStream;
17 32
 import java.io.IOException;
18 33
 import java.util.ArrayList;
19 34
 import java.util.List;
20
-import org.openzen.zenscript.codemodel.member.ImplementationMember;
21
-import org.openzen.zenscript.codemodel.type.StoredType;
22 35
 
23 36
 
24 37
 public class JavaDefinitionVisitor implements DefinitionVisitor<byte[]> {
25
-	private static final JavaMethod CLASS_FORNAME
38
+	private final JavaMethod CLASS_FORNAME
26 39
 			= JavaMethod.getNativeStatic(JavaClass.CLASS, "forName", "(Ljava/lang/String;)Ljava/lang/Class;");
27
-	private static final JavaMethod ENUM_VALUEOF
40
+	private final JavaMethod ENUM_VALUEOF
28 41
 			= JavaMethod.getNativeStatic(JavaClass.CLASS, "valueOf", "(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;");
29
-	private static final JavaMethod ARRAY_CLONE
42
+	private final JavaMethod ARRAY_CLONE
30 43
 			= JavaMethod.getNativeVirtual(JavaClass.ARRAYS, "clone", "()Ljava/lang/Object;");
31 44
 
32 45
 	private final JavaClassWriter outerWriter;

+ 2
- 2
JavaShared/src/main/java/org/openzen/zenscript/javashared/prepare/JavaPrepareDefinitionVisitor.java Näytä tiedosto

@@ -41,9 +41,9 @@ import java.util.Map;
41 41
  * @author Hoofdgebruiker
42 42
  */
43 43
 public class JavaPrepareDefinitionVisitor implements DefinitionVisitor<JavaClass> {
44
-	private static final Map<String, JavaNativeClass> nativeClasses = new HashMap<>();
44
+	private final Map<String, JavaNativeClass> nativeClasses = new HashMap<>();
45 45
 	
46
-	static {
46
+	 {
47 47
 		{
48 48
 			JavaNativeClass cls = new JavaNativeClass(new JavaClass("java.lang", "StringBuilder", JavaClass.Kind.CLASS));
49 49
 			cls.addConstructor("constructor", "()V");

Loading…
Peruuta
Tallenna