Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ private void writeFields() {
}

private void writeConstructor() {
writer.append(" @Inject\n");
writer.append(" public %s%s(", shortName, suffix);
int count = 0;
for (final String aspectName : aspects.aspectNames()) {
Expand Down Expand Up @@ -96,7 +95,6 @@ private void writeImports() {
writer.append("import %s;", Constants.INVOCATION_EXCEPTION).eol();
writer.append("import %s;", Constants.METHOD_INTERCEPTOR).eol();
writer.append("import %s;", Constants.COMPONENT).eol();
writer.append("import %s;", Constants.INJECT).eol();
writer.append("import %s;", Constants.PROXY).eol();
beanReader.writeImports(writer, packageName);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.avaje.inject.generator;

import static io.avaje.inject.generator.APContext.logError;
import static io.avaje.inject.generator.APContext.logWarn;
import static io.avaje.inject.generator.ProcessingContext.getImportedAspect;

import javax.lang.model.element.AnnotationMirror;
Expand Down Expand Up @@ -59,6 +60,11 @@ void read(TypeElement type) {
break;
}
}
if (injectConstructor != null
&& otherConstructors.isEmpty()
&& InjectPrism.isPresent(injectConstructor.element())) {
logWarn(injectConstructor.element(), "Remove Unused @Inject Annotation");
}
}

/** Read the annotations on the type. */
Expand Down