You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2011/01/06 15:08:45 UTC
[jira] Issue Comment Edited: (MATH-422) Constructor calls
overrideable methods
[ https://issues.apache.org/jira/browse/MATH-422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12978325#action_12978325 ]
Sebb edited comment on MATH-422 at 1/6/11 9:08 AM:
---------------------------------------------------
The setters (in ComplexFormat) don't add any functionality to the class, because the constructor allows all the values to be set.
Rather than try to re-use the class with a different setting, just create a new instance of the class.
It has very little data, so won't require much storage.
The getters are potentially useful, as they allow access to the defaults.
I agree - the setters should be removed.
was (Author: sebb@apache.org):
The setters don't add any functionality to the class, because the constructor allows all the values to be set.
Rather than try to re-use the class with a different setting, just create a new instance of the class.
It has very little data, so won't require much storage.
The getters are potentially useful, as they allow access to the defaults.
I agree - the setters should be removed.
> Constructor calls overrideable methods
> --------------------------------------
>
> Key: MATH-422
> URL: https://issues.apache.org/jira/browse/MATH-422
> Project: Commons Math
> Issue Type: Bug
> Reporter: Sebb
> Fix For: 3.0
>
>
> The ctor MicrosphereInterpolator(int microsphereElements, int brightnessExponent) calls 2 public setters that are not final.
> This is unsafe if the class is ever extended.
> Likewise for ComplexFormat(String imaginaryCharacter, NumberFormat realFormat, NumberFormat imaginaryFormat)
> Are the setters even needed?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.