You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gilles Sadowski <gi...@harfang.homelinux.org> on 2010/08/01 19:06:26 UTC
Re: svn commit: r981238 - in
/commons/proper/math/trunk/src/main/java/org/apache/commons/math:
analysis/interpolation/ optimization/general/ optimization/univariate/
util/
> /** {@inheritDoc} */
> - public void setConvergenceChecker(RealConvergenceChecker checker) {
> - this.checker = checker;
> + public void setConvergenceChecker(RealConvergenceChecker convergenceChecker) {
> + this.checker = convergenceChecker;
> }
Why does "checkstyle" complain about the name "checker" for the parameter?
> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=981238&r1=981237&r2=981238&view=diff
> ==============================================================================
> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Sun Aug 1 15:01:30 2010
> @@ -1868,10 +1868,18 @@ public final class MathUtils {
> }
>
> public static class Order {
> +
> + /** Enumerate type for increasing/decreasing directions. */
> public static enum Direction {
> - INCREASING,
> - DECREASING
> +
> + /** Constant for increasing direction. */
> + INCREASING,
> +
> + /** Constant for decreasing direction. */
> + DECREASING
Indeed, I don't know why I had created a two-level enum...
Although, maybe it was because I was thinking that we could put other
"characteristics" there, such as "strictness" (which now is specified
through a boolean).
> - * @throws {@link NotStrictlyPositiveException} if one of the sizes is
> + * @throws NotStrictlyPositiveException if one of the sizes is
Does Javadoc automatically create an HTML link for the argument of the
"@throws" tag?
> - public int getCount(int ... c) {
> + public int getCount(int ... c) throws OutOfRangeException {
Does "checkstyle" complain about unchecked exceptions not appearing in the
throws clause?
On the one hand I would agree to put unchecked exceptions if it prevents
tools from complaining about unused "import". On the other hand, it is
considered to be bad programming style since it cannot mean that only the
unchecked exceptions referred to there can actually be thrown.
Gilles
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r981238 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math:
analysis/interpolation/ optimization/general/ optimization/univariate/ util/
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 01/08/2010 20:56, Luc Maisonobe a écrit :
> Le 01/08/2010 19:06, Gilles Sadowski a écrit :
>>> /** {@inheritDoc} */
>>> - public void setConvergenceChecker(RealConvergenceChecker checker) {
>>> - this.checker = checker;
>>> + public void setConvergenceChecker(RealConvergenceChecker convergenceChecker) {
>>> + this.checker = convergenceChecker;
>>> }
>>
>> Why does "checkstyle" complain about the name "checker" for the parameter?
>
> It hides a field.
To be more precise, it hides a field and the name of the field is not
exactly the name of the set method (checkstyle recognizes setters and we
have set up a configuration were hiding a field in a setter was allowed).
>
>>
>>> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
>>> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=981238&r1=981237&r2=981238&view=diff
>>> ==============================================================================
>>> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
>>> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Sun Aug 1 15:01:30 2010
>>> @@ -1868,10 +1868,18 @@ public final class MathUtils {
>>> }
>>>
>>> public static class Order {
>>> +
>>> + /** Enumerate type for increasing/decreasing directions. */
>>> public static enum Direction {
>>> - INCREASING,
>>> - DECREASING
>>> +
>>> + /** Constant for increasing direction. */
>>> + INCREASING,
>>> +
>>> + /** Constant for decreasing direction. */
>>> + DECREASING
>>
>> Indeed, I don't know why I had created a two-level enum...
>> Although, maybe it was because I was thinking that we could put other
>> "characteristics" there, such as "strictness" (which now is specified
>> through a boolean).
>
> The perhaps we could revert to one level only ?
>
>>
>>> - * @throws {@link NotStrictlyPositiveException} if one of the sizes is
>>> + * @throws NotStrictlyPositiveException if one of the sizes is
>>
>> Does Javadoc automatically create an HTML link for the argument of the
>> "@throws" tag?
>>
>>> - public int getCount(int ... c) {
>>> + public int getCount(int ... c) throws OutOfRangeException {
>>
>> Does "checkstyle" complain about unchecked exceptions not appearing in the
>> throws clause?
>
> It depends on the configuration. The current setting we have in [math]
> is to allow missing RuntimeException. This specific change is an error
> from me. I tried different solutions because checkstyle had a problem
> with this file and stopped with an error. Feel free to revert it.
>
>> On the one hand I would agree to put unchecked exceptions if it prevents
>> tools from complaining about unused "import". On the other hand, it is
>> considered to be bad programming style since it cannot mean that only the
>> unchecked exceptions referred to there can actually be thrown.
>
> I'm on the fence here. Personnally I would like to have all exceptions
> declared and checkstyle could help us here if we adjust its setting. But
> we did set it up this way and I don't remember why.
>
> Luc
>
>>
>>
>> Gilles
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org
Re: svn commit: r981238 - in /commons/proper/math/trunk/src/main/java/org/apache/commons/math:
analysis/interpolation/ optimization/general/ optimization/univariate/ util/
Posted by Luc Maisonobe <Lu...@free.fr>.
Le 01/08/2010 19:06, Gilles Sadowski a écrit :
>> /** {@inheritDoc} */
>> - public void setConvergenceChecker(RealConvergenceChecker checker) {
>> - this.checker = checker;
>> + public void setConvergenceChecker(RealConvergenceChecker convergenceChecker) {
>> + this.checker = convergenceChecker;
>> }
>
> Why does "checkstyle" complain about the name "checker" for the parameter?
It hides a field.
>
>> Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java
>> URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java?rev=981238&r1=981237&r2=981238&view=diff
>> ==============================================================================
>> --- commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java (original)
>> +++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/util/MathUtils.java Sun Aug 1 15:01:30 2010
>> @@ -1868,10 +1868,18 @@ public final class MathUtils {
>> }
>>
>> public static class Order {
>> +
>> + /** Enumerate type for increasing/decreasing directions. */
>> public static enum Direction {
>> - INCREASING,
>> - DECREASING
>> +
>> + /** Constant for increasing direction. */
>> + INCREASING,
>> +
>> + /** Constant for decreasing direction. */
>> + DECREASING
>
> Indeed, I don't know why I had created a two-level enum...
> Although, maybe it was because I was thinking that we could put other
> "characteristics" there, such as "strictness" (which now is specified
> through a boolean).
The perhaps we could revert to one level only ?
>
>> - * @throws {@link NotStrictlyPositiveException} if one of the sizes is
>> + * @throws NotStrictlyPositiveException if one of the sizes is
>
> Does Javadoc automatically create an HTML link for the argument of the
> "@throws" tag?
>
>> - public int getCount(int ... c) {
>> + public int getCount(int ... c) throws OutOfRangeException {
>
> Does "checkstyle" complain about unchecked exceptions not appearing in the
> throws clause?
It depends on the configuration. The current setting we have in [math]
is to allow missing RuntimeException. This specific change is an error
from me. I tried different solutions because checkstyle had a problem
with this file and stopped with an error. Feel free to revert it.
> On the one hand I would agree to put unchecked exceptions if it prevents
> tools from complaining about unused "import". On the other hand, it is
> considered to be bad programming style since it cannot mean that only the
> unchecked exceptions referred to there can actually be thrown.
I'm on the fence here. Personnally I would like to have all exceptions
declared and checkstyle could help us here if we adjust its setting. But
we did set it up this way and I don't remember why.
Luc
>
>
> Gilles
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org