There are a lot of classes which have setters for private fields that
are also set by the constructors.

In most cases there is no need to change the values of the fields
after construction, so the setters could be dropped and the fields
made final thus improving thread-safety.
Final fields also make testing easier - fewer states to check.

(In some cases using the setter after the class has been in use for a
while might well cause problems even if all access is thread-safe -
e.g. changing LIFO behaviour midstream would not make sense.)

Dropping the setter methods is an API change, so my question is:
Do all such changes have to be flagged up by deprecating the setters
in a previous release?
Or can a major release just drop the methods?

If deprecation is required, then we should probably start adding
deprecated annotations now.
I suspect there will be quite a lot.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to