diff --git a/src/main/java/dev/mccue/magicbean/processor/AnnotationProcessor.java b/src/main/java/dev/mccue/magicbean/processor/AnnotationProcessor.java index b1694d6..efebd49 100644 --- a/src/main/java/dev/mccue/magicbean/processor/AnnotationProcessor.java +++ b/src/main/java/dev/mccue/magicbean/processor/AnnotationProcessor.java @@ -204,6 +204,14 @@ public boolean process( return true; } + String packageName; + if (packageElement.isUnnamed()) { + packageName = null; + } + else { + packageName = packageElement.toString(); + } + String selfExpr; if (typeElement.getAnnotation(MagicBean.class).useTypeSafeCast()) { @@ -298,7 +306,7 @@ public boolean process( try { var file = filer.createSourceFile( - packageElement + "." + className + "BeanOps", + (packageName == null ? "" : packageName + ".") + className + "BeanOps", element ); try (var writer = file.openWriter()) {