So this is a minor IDE-related issue in the context of outjected context variables.
@Out(required=false, scope=ScopeType.SESSION) private String domainAndUsername; public boolean authenticate() { identity.setUsername("me"); identity.setPassword("jibberish"); domainAndUsername = "foo\\bar"; return true; }
So the compiler/IDE complains as such:
The field BypassAuthenticator.domainAndUsername is never read locally
What is the best practice solution to fix
this warning?
I am given 3 options to resolve by the IDE, one of which is to add @SuppressWarning("unused"). The other is remove the variable and the other is create getter/setter. I don't need getter/setter for this context variable in my backing SFSB. Remove is obviously out of the question.
You can set in the session context yourself. If that is not natural state of the object, there's really no reason to make it state so you can trigger outjection.