Skip to content

Commit

Permalink
ArC: improve description of injection points that are parameters
Browse files Browse the repository at this point in the history
The improvement is twofold:

- it highlights that the injection point is a parameter by putting
  the parameter name at the beginning instead of the end;
- it uses the word "constructor" explicitly in case the parameter
  belongs to a constructor.
  • Loading branch information
Ladicek committed Jan 3, 2024
1 parent 72b3808 commit 2401bd6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class InjectionFailedTest {
assertTrue(s.getMessage().contains(
"No template found for path [foo] defined at io.quarkus.qute.deployment.inject.InjectionFailedTest#foo")
|| s.getMessage().contains(
"No template found for path [alpha] defined at io.quarkus.qute.deployment.inject.InjectionFailedTest$Client()"),
"No template found for path [alpha] defined at parameter 'alpha' of io.quarkus.qute.deployment.inject.InjectionFailedTest$Client constructor"),
s.getMessage());
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ public String getTargetInfo() {
}
String method = target.asMethod().name();
if (method.equals(Methods.INIT)) {
method = "";
method = " constructor";
} else {
method = "#" + method;
method = "#" + method + "()";
}
return target.asMethod().declaringClass().name() + method + "()" + ":" + param;
return "parameter '" + param + "' of " + target.asMethod().declaringClass().name() + method;
default:
return target.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void testError() {
assertNotNull(failure);
assertTrue(failure instanceof DefinitionException);
assertEquals(
"Type variable is not a legal injection point type: io.quarkus.arc.test.injection.illegal.TypeVariableInitializerInjectionPointTest$Head#setIt():it",
"Type variable is not a legal injection point type: parameter 'it' of io.quarkus.arc.test.injection.illegal.TypeVariableInitializerInjectionPointTest$Head#setIt()",
failure.getMessage());
}

Expand Down

0 comments on commit 2401bd6

Please sign in to comment.