IDP-1004 and @Duration
Rod Widdowson
rdw at steadingsoftware.com
Wed Jul 6 11:16:50 EDT 2016
> It seems unnecessary, if @Duration exists and would also work.
Indeed it does work once you've edited the definition to allow it. But I
think that
@Duration public void setFoo(@Duration long whatever)
Reads wrongly, and it isn't obvious to anyone who doesn't understand the
Spring bug (or whatever) what is going on. Whereas
@DurationSetter public void setFoo(@Duration long whatever)
(perhaps with a
@DurationGetter public long getFoo()
)
Becomes more obvious.
> Annotating the
> field seems like a good solution as well, unless of course there isn't
one.
There isn't one in this case and indeed it turns out that the entirety of
our Duration support only works "by accident" because we tend to be
retentive about marking the field as well as the parameter.
Of course in this case we could introduce the field as well - it doesn't
even need to be consulted (modulo a few compiler warnings), but fixing this
particular issue isn't my primary concern - we have a band aid in place
right now anyway, but I want to avoid it biting us in the future...
Best would be if Spring fixed the issue, but I am not holding my breath -
I'd guess that there's a good chance that this might be viewed as too
destabilising.
R
More information about the dev
mailing list