fix: fixed NoClassDefFoundError for non-java classes

This commit is contained in:
zaaarf 2023-03-17 19:09:32 +01:00
parent 3b560f5990
commit 5fd954a118
No known key found for this signature in database
GPG key ID: 82240E075E31FA4C

View file

@ -329,10 +329,16 @@ public class LilleroProcessor extends AbstractProcessor {
for(Modifier mod : targetMethod.getModifiers())
b.addStatement("bd.addModifier($L)", mapModifier(mod));
for(VariableElement p : targetMethod.getParameters())
b.addStatement("bd.addParameter($T.class)",p.asType());
for(VariableElement p : targetMethod.getParameters()) {
if(p.asType().getKind().isPrimitive())
b.addStatement("bd.addParameter($T.class)", p.asType());
else b.addStatement("bd.addParameter($S)", p.asType().toString());
}
if(targetMethod.getReturnType().getKind().isPrimitive())
b.addStatement("bd.setReturnType($T.class)", targetMethod.getReturnType());
else b.addStatement("bd.setReturnType($S)", targetMethod.getReturnType().toString());
b.addStatement("return bd.build()");
generated.add(b.build());
@ -358,7 +364,10 @@ public class LilleroProcessor extends AbstractProcessor {
for(Modifier mod : targetField.getModifiers())
b.addStatement("bd.addModifier($L)", mapModifier(mod));
if(targetField.asType().getKind().isPrimitive())
b.addStatement("bd.setType($T.class)", targetField.asType());
else b.addStatement("bd.setType($S)", targetField.asType().toString());
b.addStatement("return bd.build()");
generated.add(b.build());