Multiple setters for a bean and a Spring warning

Brent Putman putmanb at georgetown.edu
Fri Mar 28 15:20:03 EDT 2014


On 3/28/14 11:55 AM, Rod Widdowson wrote:
>> A quick look at the Spring source makes me wonder if providing the
>> accessor method, i.e. getBasicCredential(), might not trigger that
>> warning.
> Adding that certainly does seem to do the trick.  I wonder why?
>
> Brent, how would you like me to address this?

Now that you've stumpled upon it, I think I've hit upon the very same
issue in the past with classes in other libraries, and had to work
around in the same ways (adding a getter and/or setter methods).

The path of least resistance was just to change the method name for the
2-arg variant, which I just checked in.  Doing a getter isn't really
straightforward, as we don't actually store the credentials itself. 
Retrieving it from the credentials provider that we do store is also not
straightforward, since it requires the AuthScope, which we also don't
currently otherwise store.  It's not worth messing with.


More information about the dev mailing list