|
@@ -4,6 +4,8 @@ import org.openzen.zenscript.codemodel.generic.TypeParameterBound;
|
4
|
4
|
import org.openzen.zenscript.codemodel.generic.ParameterTypeBound;
|
5
|
5
|
import org.openzen.zenscript.codemodel.type.*;
|
6
|
6
|
|
|
7
|
+import java.util.Arrays;
|
|
8
|
+
|
7
|
9
|
public class JavaTypeDescriptorVisitor implements TypeVisitor<String> {
|
8
|
10
|
private final JavaTypeDescriptorVisitor forOptional;
|
9
|
11
|
private final JavaContext context;
|
|
@@ -85,8 +87,11 @@ public class JavaTypeDescriptorVisitor implements TypeVisitor<String> {
|
85
|
87
|
return "[B"; // instead of int[], save memory, save compatibility
|
86
|
88
|
else if (array.elementType.type == BasicTypeID.USHORT)
|
87
|
89
|
return "[S"; // instead of int[], save memory
|
88
|
|
- else
|
89
|
|
- return "[" + this.context.getDescriptor(array.elementType);
|
|
90
|
+ else {
|
|
91
|
+ char[] arrayDepth = new char[array.dimension];
|
|
92
|
+ Arrays.fill(arrayDepth, '[');
|
|
93
|
+ return new String(arrayDepth) + this.context.getDescriptor(array.elementType);
|
|
94
|
+ }
|
90
|
95
|
}
|
91
|
96
|
|
92
|
97
|
@Override
|