summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc
diff options
context:
space:
mode:
author zaaarf <zaaarf@proton.me>2023-03-15 20:32:44 +0100
committer zaaarf <zaaarf@proton.me>2023-03-15 20:32:44 +0100
commit062f8117b9f00459c52d91e3e30b5e65e77604d7 (patch)
tree87dcf5896bfce03ed7d89ff7a8a7c3ce11097f8f /src/main/java/ftbsc
parent1a4716dafedd7008b8b66e587cb8f35570be0363 (diff)
fix: fixed failure to write descriptor of parametrised type
Diffstat (limited to 'src/main/java/ftbsc')
-rw-r--r--src/main/java/ftbsc/lll/processor/tools/ASTUtils.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
index faac3dc..fe72167 100644
--- a/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
+++ b/src/main/java/ftbsc/lll/processor/tools/ASTUtils.java
@@ -1,9 +1,6 @@
package ftbsc.lll.processor.tools;
-import com.squareup.javapoet.ArrayTypeName;
-import com.squareup.javapoet.ClassName;
-import com.squareup.javapoet.MethodSpec;
-import com.squareup.javapoet.TypeName;
+import com.squareup.javapoet.*;
import ftbsc.lll.tools.DescriptorBuilder;
import javax.annotation.processing.ProcessingEnvironment;
@@ -53,8 +50,8 @@ public class ASTUtils {
desc.append("[");
type = ((ArrayTypeName) type).componentType;
}
- if(type instanceof ClassName) {
- ClassName var = (ClassName) type;
+ if(type instanceof ClassName || type instanceof ParameterizedTypeName) {
+ ClassName var = type instanceof ParameterizedTypeName ? ((ParameterizedTypeName) type).rawType : (ClassName) type;
desc.append(DescriptorBuilder.nameToDescriptor(var.canonicalName(), 0));
} else {
if(TypeName.BOOLEAN.equals(type))