Skip to content

Commit

Permalink
Merge remote-tracking branch 'Tim203/feature/interfaces'
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim203 committed Feb 11, 2024
2 parents 63bbae7 + c5533d5 commit 7200e86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ private boolean gatherElementSpec(
if (element.isDefault()) {
continue;
}
this.processor.error(
this.processor.printError(
"Cannot make config due to method %s, which is an excluded method that has no implementation!",
element
);
Expand All @@ -133,7 +133,7 @@ private boolean gatherElementSpec(

final List<? extends VariableElement> parameters = element.getParameters();
if (parameters.size() > 1) {
this.processor.error("Setters cannot have more than one parameter! Method: " + element);
this.processor.printError("Setters cannot have more than one parameter! Method: " + element);
return false;
}

Expand Down Expand Up @@ -183,7 +183,7 @@ private boolean handleSetter(
// we have two main branches of setters, default non-void setters and non-default any setters
if (element.isDefault()) {
if (MoreTypes.isTypeOf(Void.TYPE, returnType)) {
this.processor.error("A default setter cannot have void as return type. Method: " + element);
this.processor.printError("A default setter cannot have void as return type. Method: " + element);
return false;
}

Expand All @@ -202,7 +202,7 @@ private boolean handleSetter(
if (!MoreTypes.isTypeOf(Void.TYPE, returnType)) {
// the return type can be a parent type of parameter, but it has to be assignable
if (!this.processor.typeUtils.isAssignable(parameter.asType(), returnType)) {
this.processor.error(
this.processor.printError(
"Cannot create a setter with return type %s for argument type %s. Method: %s",
returnType,
parameter.asType(),
Expand All @@ -225,7 +225,7 @@ private void handleGetter(
) {
// voids aren't valid
if (MoreTypes.isTypeOf(Void.TYPE, nodeType)) {
this.processor.error(
this.processor.printError(
"Cannot create a getter with return type void for method %s, did you forget to @Exclude this method?",
element
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean process(final Set<? extends TypeElement> ignored, final RoundEnvi
try {
processInterface(typeElement);
} catch (final IOException exception) {
error(exception.getMessage());
printError(exception.getMessage());
}
}

Expand Down Expand Up @@ -143,7 +143,7 @@ Properties generatedClasses() {
return this.mappings;
}

void error(final String message, final Object... arguments) {
void printError(final String message, final Object... arguments) {
this.messager.printMessage(Kind.ERROR, String.format(Locale.ROOT, message, arguments));
}

Expand Down

0 comments on commit 7200e86

Please sign in to comment.