You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.
Consider that DeleteBastion class has no injectable members and I have a factory class as follows:
@Singleton
public static class Factory {
@Inject
MembersInjector<DeleteBastion> injector;
public DeleteBastion create(Regions region, Environment env) {
DeleteBastion cmd = new DeleteBastion(region, env);
injector.injectMembers(cmd);
return cmd;
}
}
Compiling gives me the following error:
Error:(43, 8) java: No injectable members on DeleteBastion. Do you want to add an injectable constructor? required by DeleteBastion.Factory for Main
Now, the error message is pretty obvious since I don't have an injectable member in the DeleteBastion, but that is quite inconvenient. Right now I don't have an injectable member, but it is quite possible that I may have one in the future. Does that mean I need to manage this by commenting out code and uncommenting it when I do have an injectable member? Shouldn't this be a warning at most or am I missing something?
The text was updated successfully, but these errors were encountered:
As the logs suggest: Do you want to add an injectable constructor?
This is what I usually do if I inject the class that doesn't have an injectable member. you can just add @Inject public void DeleteBastion() {}
and you will not get an error. In the future if you want to inject a member in that class, just do that and remove the default constructor with the @Inject annotation.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Consider that DeleteBastion class has no injectable members and I have a factory class as follows:
Compiling gives me the following error:
Now, the error message is pretty obvious since I don't have an injectable member in the DeleteBastion, but that is quite inconvenient. Right now I don't have an injectable member, but it is quite possible that I may have one in the future. Does that mean I need to manage this by commenting out code and uncommenting it when I do have an injectable member? Shouldn't this be a warning at most or am I missing something?
The text was updated successfully, but these errors were encountered: