mirror of
https://github.com/zaaarf/lillero-processor.git
synced 2024-11-22 15:54:48 +01:00
fix: fixed failure to write descriptor of parametrised type
This commit is contained in:
parent
1a4716dafe
commit
062f8117b9
1 changed files with 3 additions and 6 deletions
|
@ -1,9 +1,6 @@
|
||||||
package ftbsc.lll.processor.tools;
|
package ftbsc.lll.processor.tools;
|
||||||
|
|
||||||
import com.squareup.javapoet.ArrayTypeName;
|
import com.squareup.javapoet.*;
|
||||||
import com.squareup.javapoet.ClassName;
|
|
||||||
import com.squareup.javapoet.MethodSpec;
|
|
||||||
import com.squareup.javapoet.TypeName;
|
|
||||||
import ftbsc.lll.tools.DescriptorBuilder;
|
import ftbsc.lll.tools.DescriptorBuilder;
|
||||||
|
|
||||||
import javax.annotation.processing.ProcessingEnvironment;
|
import javax.annotation.processing.ProcessingEnvironment;
|
||||||
|
@ -53,8 +50,8 @@ public class ASTUtils {
|
||||||
desc.append("[");
|
desc.append("[");
|
||||||
type = ((ArrayTypeName) type).componentType;
|
type = ((ArrayTypeName) type).componentType;
|
||||||
}
|
}
|
||||||
if(type instanceof ClassName) {
|
if(type instanceof ClassName || type instanceof ParameterizedTypeName) {
|
||||||
ClassName var = (ClassName) type;
|
ClassName var = type instanceof ParameterizedTypeName ? ((ParameterizedTypeName) type).rawType : (ClassName) type;
|
||||||
desc.append(DescriptorBuilder.nameToDescriptor(var.canonicalName(), 0));
|
desc.append(DescriptorBuilder.nameToDescriptor(var.canonicalName(), 0));
|
||||||
} else {
|
} else {
|
||||||
if(TypeName.BOOLEAN.equals(type))
|
if(TypeName.BOOLEAN.equals(type))
|
||||||
|
|
Loading…
Reference in a new issue