You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Frédéric THOMAS <we...@hotmail.com> on 2013/04/07 10:57:56 UTC

Re: git commit: Added override to set value to ensure it is not set to NaN

Take the habit to prepend the issue id to your commit message, it is useful
if someone wants to see the modified code from the source tab of the Jira
issue.

-Fred

-----Message d'origine----- 
From: harbs@apache.org
Sent: Sunday, April 07, 2013 9:02 AM
To: commits@flex.apache.org
Subject: git commit: Added override to set value to ensure it is not set to 
NaN

Updated Branches:
  refs/heads/develop 9ec4d1780 -> 53ad8aa03


Added override to set value to ensure it is not set to NaN


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0

Branch: refs/heads/develop
Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
Parents: 9ec4d17
Author: Harbs <ha...@in-tools.com>
Authored: Sun Apr 7 09:58:20 2013 +0300
Committer: Harbs <ha...@in-tools.com>
Committed: Sun Apr 7 09:58:20 2013 +0300

----------------------------------------------------------------------
.../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
b/frameworks/projects/spark/src/spark/components/NumericStepper.as
index 36a1982..0848245 100644
--- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
+++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
@@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
     /**
      *  @private
      */
+    override public function set value(newValue:Number):void
+    {
+    if(isNaN(newValue))
+    newValue = 0;
+
+    super.value = newValue;
+    }
+
+    /**
+     *  @private
+     */
     override protected function setValue(newValue:Number):void
     {
         super.setValue(newValue);


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
I'm not sure I see why you'd want a NaN value in Range, but I guess you are right that it's technically a legal value. Does range have a skin? I'm guessing not… 

On Apr 7, 2013, at 2:00 PM, Frédéric THOMAS wrote:

> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so, it is valid to set it to a NaN value to say that's a meaningless value but the incr/decr have currently no code to manage that situation, that's the reason why I thing it could be the place to do it.
> 
> What do you think ?
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 12:36 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> If 0 is out of range, 0 will be converted to minimum automatically.
> 
> But you are probably right. I see no reason to not set it straight to minimium.
> 
> It should probably also be fixed in Range set value(). Any reason you can think of why it should not be fixed there?
> 
> If you agree, I'll revert NumericStepper and make the change in Range.as…
> 
> Harbs
> 
> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
> 
>> Hi Harbs,
>> 
>> I guess you will have the opportunity to do it again.
>> 
>> What if 0 is out of the Range ?
>> 
>> I guess the right fix is:
>> 
>> if(isNaN(newValue))
>>  newValue = minimum;
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 11:38 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>> 
>> FWIW, it was FLEX-33288
>> 
>> Harbs
>> 
>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>> 
>>> Take the habit to prepend the issue id to your commit message, it is useful
>>> if someone wants to see the modified code from the source tab of the Jira
>>> issue.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: harbs@apache.org
>>> Sent: Sunday, April 07, 2013 9:02 AM
>>> To: commits@flex.apache.org
>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Updated Branches:
>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>> 
>>> 
>>> Added override to set value to ensure it is not set to NaN
>>> 
>>> 
>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>> 
>>> Branch: refs/heads/develop
>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>> Parents: 9ec4d17
>>> Author: Harbs <ha...@in-tools.com>
>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>> Committer: Harbs <ha...@in-tools.com>
>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>> 
>>> ----------------------------------------------------------------------
>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>> ----------------------------------------------------------------------
>>> 
>>> 
>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> ----------------------------------------------------------------------
>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> index 36a1982..0848245 100644
>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>  /**
>>>   *  @private
>>>   */
>>> +    override public function set value(newValue:Number):void
>>> +    {
>>> +    if(isNaN(newValue))
>>> +    newValue = 0;
>>> +
>>> +    super.value = newValue;
>>> +    }
>>> +
>>> +    /**
>>> +     *  @private
>>> +     */
>>>  override protected function setValue(newValue:Number):void
>>>  {
>>>      super.setValue(newValue);
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Thanks. Good to know.

On Apr 7, 2013, at 3:37 PM, Frédéric THOMAS wrote:

> Btw, FYI, the good way to revert a commit which is not a merge commit is to do 'git revert <SHA1>' where <SHA1> was 53ad8aa in your case, the hash of the commit to revert, it creates another commit strictly the opposite of the bad one, you can then work on.
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 2:08 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Okay. Done.
> 
> I'll set up Mustella when I get a chance…
> 
> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
> 
>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 1:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>> 
>> I'm thinking Range make the most sense because NaN is not a valid value…
>> 
>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>> 
>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>> 
>>> well, nearestValidValue looks to be the place.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 1:00 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>> the incr/decr have currently no code to manage that situation, that's the
>>> reason why I thing it could be the place to do it.
>>> 
>>> What do you think ?
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 12:36 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>> to NaN
>>> 
>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>> 
>>> But you are probably right. I see no reason to not set it straight to
>>> minimium.
>>> 
>>> It should probably also be fixed in Range set value(). Any reason you can
>>> think of why it should not be fixed there?
>>> 
>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>> 
>>> Harbs
>>> 
>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>> 
>>>> Hi Harbs,
>>>> 
>>>> I guess you will have the opportunity to do it again.
>>>> 
>>>> What if 0 is out of the Range ?
>>>> 
>>>> I guess the right fix is:
>>>> 
>>>> if(isNaN(newValue))
>>>> newValue = minimum;
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>> 
>>>> FWIW, it was FLEX-33288
>>>> 
>>>> Harbs
>>>> 
>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>> 
>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>> issue.
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>> To: commits@flex.apache.org
>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> Updated Branches:
>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>> 
>>>>> 
>>>>> Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> 
>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>> 
>>>>> Branch: refs/heads/develop
>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>> Parents: 9ec4d17
>>>>> Author: Harbs <ha...@in-tools.com>
>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>> 
>>>>> ----------------------------------------------------------------------
>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>> ----------------------------------------------------------------------
>>>>> 
>>>>> 
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> ----------------------------------------------------------------------
>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> index 36a1982..0848245 100644
>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>> /**
>>>>> *  @private
>>>>> */
>>>>> +    override public function set value(newValue:Number):void
>>>>> +    {
>>>>> +    if(isNaN(newValue))
>>>>> +    newValue = 0;
>>>>> +
>>>>> +    super.value = newValue;
>>>>> +    }
>>>>> +
>>>>> +    /**
>>>>> +     *  @private
>>>>> +     */
>>>>> override protected function setValue(newValue:Number):void
>>>>> {
>>>>>    super.setValue(newValue);
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Btw, FYI, the good way to revert a commit which is not a merge commit is to 
do 'git revert <SHA1>' where <SHA1> was 53ad8aa in your case, the hash of 
the commit to revert, it creates another commit strictly the opposite of the 
bad one, you can then work on.

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 2:08 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Okay. Done.

I'll set up Mustella when I get a chance…

On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:

> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue 
> is the good place, I haven't seen before because the source code where FB 
> took me wasn't the good function, I have to fix that, that's a pain.
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 1:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Yes. nearestValidValue looks like a good place to fix it. The question is, 
> should it be in Range, Spinner (what a funny name for a base class…) or 
> NumericStepper?
>
> I'm thinking Range make the most sense because NaN is not a valid value…
>
> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>
>> Sorry my bad, you are right, I was looking at another function, I don't 
>> use usually FB and it sent me elsewhere.
>>
>> well, nearestValidValue looks to be the place.
>>
>> -Fred
>>
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 1:00 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>> so,
>> it is valid to set it to a NaN value to say that's a meaningless value 
>> but
>> the incr/decr have currently no code to manage that situation, that's the
>> reason why I thing it could be the place to do it.
>>
>> What do you think ?
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 12:36 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set
>> to NaN
>>
>> If 0 is out of range, 0 will be converted to minimum automatically.
>>
>> But you are probably right. I see no reason to not set it straight to
>> minimium.
>>
>> It should probably also be fixed in Range set value(). Any reason you can
>> think of why it should not be fixed there?
>>
>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>
>> Harbs
>>
>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>
>>> Hi Harbs,
>>>
>>> I guess you will have the opportunity to do it again.
>>>
>>> What if 0 is out of the Range ?
>>>
>>> I guess the right fix is:
>>>
>>> if(isNaN(newValue))
>>> newValue = minimum;
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 11:38 AM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> I thought it was automatically prepended because I created a branch for 
>>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>>> Still learning git… ;-)
>>>
>>> FWIW, it was FLEX-33288
>>>
>>> Harbs
>>>
>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>
>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>> useful
>>>> if someone wants to see the modified code from the source tab of the 
>>>> Jira
>>>> issue.
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: harbs@apache.org
>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>> To: commits@flex.apache.org
>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>> set to NaN
>>>>
>>>> Updated Branches:
>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>
>>>>
>>>> Added override to set value to ensure it is not set to NaN
>>>>
>>>>
>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>
>>>> Branch: refs/heads/develop
>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>> Parents: 9ec4d17
>>>> Author: Harbs <ha...@in-tools.com>
>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>> Committer: Harbs <ha...@in-tools.com>
>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>
>>>> ----------------------------------------------------------------------
>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>> ----------------------------------------------------------------------
>>>>
>>>>
>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> ----------------------------------------------------------------------
>>>> diff --git 
>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> index 36a1982..0848245 100644
>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>> /**
>>>>  *  @private
>>>>  */
>>>> +    override public function set value(newValue:Number):void
>>>> +    {
>>>> +    if(isNaN(newValue))
>>>> +    newValue = 0;
>>>> +
>>>> +    super.value = newValue;
>>>> +    }
>>>> +
>>>> +    /**
>>>> +     *  @private
>>>> +     */
>>>> override protected function setValue(newValue:Number):void
>>>> {
>>>>     super.setValue(newValue);
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
I think that's checking for input validity. The issue we're dealing with is when setting the value programtically.

The relevant code in mx is this:

 setValue(isNaN(proposedValue) ? 0 : proposedValue, false);

So it's changed to 0 before being passed to setValue.

Harbs

On Apr 7, 2013, at 5:45 PM, Frédéric THOMAS wrote:

> Ok, perfect then, maybe I'm wrong, I was reading the mx:NumericStepper:
> 
> private function checkValidValue(value:Number):Number
> {
>   if (isNaN(value))
>       return this.value;
> 
> But if you tried it, it's worth :)
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 4:37 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> I just used the test app with mx:NumericStepper, and it's reverted to 0 when setting it to NaN. So it looks like the behavior is now equivalent.
> 
> Note. It's 0 not minimum, because minimum could be less than 0…
> 
> On Apr 7, 2013, at 3:21 PM, Frédéric THOMAS wrote:
> 
>> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in case of NaN but it never happen because the checkValidValue reset it the old value in case of NaN, it means the Spart one and the Mx one are not consistent, the Mx one doesn’t allows the value to be set with NaN, is this the right answer to apply to the Spark one ?
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 2:08 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Okay. Done.
>> 
>> I'll set up Mustella when I get a chance…
>> 
>> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>> 
>>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 1:21 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>>> 
>>> I'm thinking Range make the most sense because NaN is not a valid value…
>>> 
>>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>> 
>>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>>> 
>>>> well, nearestValidValue looks to be the place.
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Frédéric THOMAS
>>>> Sent: Sunday, April 07, 2013 1:00 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>>> the incr/decr have currently no code to manage that situation, that's the
>>>> reason why I thing it could be the place to do it.
>>>> 
>>>> What do you think ?
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 12:36 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>>> to NaN
>>>> 
>>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>> 
>>>> But you are probably right. I see no reason to not set it straight to
>>>> minimium.
>>>> 
>>>> It should probably also be fixed in Range set value(). Any reason you can
>>>> think of why it should not be fixed there?
>>>> 
>>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>>> 
>>>> Harbs
>>>> 
>>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>> 
>>>>> Hi Harbs,
>>>>> 
>>>>> I guess you will have the opportunity to do it again.
>>>>> 
>>>>> What if 0 is out of the Range ?
>>>>> 
>>>>> I guess the right fix is:
>>>>> 
>>>>> if(isNaN(newValue))
>>>>> newValue = minimum;
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: Harbs
>>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>>> To: dev@flex.apache.org
>>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>>> 
>>>>> FWIW, it was FLEX-33288
>>>>> 
>>>>> Harbs
>>>>> 
>>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>> 
>>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>>> issue.
>>>>>> 
>>>>>> -Fred
>>>>>> 
>>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>>> To: commits@flex.apache.org
>>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>>> 
>>>>>> Updated Branches:
>>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>> 
>>>>>> 
>>>>>> Added override to set value to ensure it is not set to NaN
>>>>>> 
>>>>>> 
>>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>> 
>>>>>> Branch: refs/heads/develop
>>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>>> Parents: 9ec4d17
>>>>>> Author: Harbs <ha...@in-tools.com>
>>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>> 
>>>>>> ----------------------------------------------------------------------
>>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>>> ----------------------------------------------------------------------
>>>>>> 
>>>>>> 
>>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> ----------------------------------------------------------------------
>>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> index 36a1982..0848245 100644
>>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>>> /**
>>>>>> *  @private
>>>>>> */
>>>>>> +    override public function set value(newValue:Number):void
>>>>>> +    {
>>>>>> +    if(isNaN(newValue))
>>>>>> +    newValue = 0;
>>>>>> +
>>>>>> +    super.value = newValue;
>>>>>> +    }
>>>>>> +
>>>>>> +    /**
>>>>>> +     *  @private
>>>>>> +     */
>>>>>> override protected function setValue(newValue:Number):void
>>>>>> {
>>>>>>   super.setValue(newValue);
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Ok, perfect then, maybe I'm wrong, I was reading the mx:NumericStepper:

private function checkValidValue(value:Number):Number
{
    if (isNaN(value))
        return this.value;

But if you tried it, it's worth :)

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 4:37 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

I just used the test app with mx:NumericStepper, and it's reverted to 0 when 
setting it to NaN. So it looks like the behavior is now equivalent.

Note. It's 0 not minimum, because minimum could be less than 0…

On Apr 7, 2013, at 3:21 PM, Frédéric THOMAS wrote:

> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in 
> case of NaN but it never happen because the checkValidValue reset it the 
> old value in case of NaN, it means the Spart one and the Mx one are not 
> consistent, the Mx one doesn’t allows the value to be set with NaN, is 
> this the right answer to apply to the Spark one ?
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 2:08 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Okay. Done.
>
> I'll set up Mustella when I get a chance…
>
> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>
>> Yeah, Range allows to incr/decr in changeValueByStep, so 
>> nearestValidValue is the good place, I haven't seen before because the 
>> source code where FB took me wasn't the good function, I have to fix 
>> that, that's a pain.
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 1:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> Yes. nearestValidValue looks like a good place to fix it. The question 
>> is, should it be in Range, Spinner (what a funny name for a base class…) 
>> or NumericStepper?
>>
>> I'm thinking Range make the most sense because NaN is not a valid value…
>>
>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>
>>> Sorry my bad, you are right, I was looking at another function, I don't 
>>> use usually FB and it sent me elsewhere.
>>>
>>> well, nearestValidValue looks to be the place.
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 1:00 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>>> so,
>>> it is valid to set it to a NaN value to say that's a meaningless value 
>>> but
>>> the incr/decr have currently no code to manage that situation, that's 
>>> the
>>> reason why I thing it could be the place to do it.
>>>
>>> What do you think ?
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 12:36 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set
>>> to NaN
>>>
>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>
>>> But you are probably right. I see no reason to not set it straight to
>>> minimium.
>>>
>>> It should probably also be fixed in Range set value(). Any reason you 
>>> can
>>> think of why it should not be fixed there?
>>>
>>> If you agree, I'll revert NumericStepper and make the change in 
>>> Range.as…
>>>
>>> Harbs
>>>
>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>
>>>> Hi Harbs,
>>>>
>>>> I guess you will have the opportunity to do it again.
>>>>
>>>> What if 0 is out of the Range ?
>>>>
>>>> I guess the right fix is:
>>>>
>>>> if(isNaN(newValue))
>>>> newValue = minimum;
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is 
>>>> not set to NaN
>>>>
>>>> I thought it was automatically prepended because I created a branch for 
>>>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>>>> Still learning git… ;-)
>>>>
>>>> FWIW, it was FLEX-33288
>>>>
>>>> Harbs
>>>>
>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>
>>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>>> useful
>>>>> if someone wants to see the modified code from the source tab of the 
>>>>> Jira
>>>>> issue.
>>>>>
>>>>> -Fred
>>>>>
>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>> To: commits@flex.apache.org
>>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>>> set to NaN
>>>>>
>>>>> Updated Branches:
>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>
>>>>>
>>>>> Added override to set value to ensure it is not set to NaN
>>>>>
>>>>>
>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>> Commit: 
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>
>>>>> Branch: refs/heads/develop
>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>> Parents: 9ec4d17
>>>>> Author: Harbs <ha...@in-tools.com>
>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>
>>>>> ----------------------------------------------------------------------
>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>> ----------------------------------------------------------------------
>>>>>
>>>>>
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> ----------------------------------------------------------------------
>>>>> diff --git 
>>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> index 36a1982..0848245 100644
>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>> /**
>>>>> *  @private
>>>>> */
>>>>> +    override public function set value(newValue:Number):void
>>>>> +    {
>>>>> +    if(isNaN(newValue))
>>>>> +    newValue = 0;
>>>>> +
>>>>> +    super.value = newValue;
>>>>> +    }
>>>>> +
>>>>> +    /**
>>>>> +     *  @private
>>>>> +     */
>>>>> override protected function setValue(newValue:Number):void
>>>>> {
>>>>>    super.setValue(newValue);
>>>>>
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
I just used the test app with mx:NumericStepper, and it's reverted to 0 when setting it to NaN. So it looks like the behavior is now equivalent.

Note. It's 0 not minimum, because minimum could be less than 0…

On Apr 7, 2013, at 3:21 PM, Frédéric THOMAS wrote:

> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in case of NaN but it never happen because the checkValidValue reset it the old value in case of NaN, it means the Spart one and the Mx one are not consistent, the Mx one doesn’t allows the value to be set with NaN, is this the right answer to apply to the Spark one ?
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 2:08 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Okay. Done.
> 
> I'll set up Mustella when I get a chance…
> 
> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
> 
>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 1:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>> 
>> I'm thinking Range make the most sense because NaN is not a valid value…
>> 
>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>> 
>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>> 
>>> well, nearestValidValue looks to be the place.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 1:00 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>> the incr/decr have currently no code to manage that situation, that's the
>>> reason why I thing it could be the place to do it.
>>> 
>>> What do you think ?
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 12:36 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>> to NaN
>>> 
>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>> 
>>> But you are probably right. I see no reason to not set it straight to
>>> minimium.
>>> 
>>> It should probably also be fixed in Range set value(). Any reason you can
>>> think of why it should not be fixed there?
>>> 
>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>> 
>>> Harbs
>>> 
>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>> 
>>>> Hi Harbs,
>>>> 
>>>> I guess you will have the opportunity to do it again.
>>>> 
>>>> What if 0 is out of the Range ?
>>>> 
>>>> I guess the right fix is:
>>>> 
>>>> if(isNaN(newValue))
>>>> newValue = minimum;
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>> 
>>>> FWIW, it was FLEX-33288
>>>> 
>>>> Harbs
>>>> 
>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>> 
>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>> issue.
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>> To: commits@flex.apache.org
>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> Updated Branches:
>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>> 
>>>>> 
>>>>> Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> 
>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>> 
>>>>> Branch: refs/heads/develop
>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>> Parents: 9ec4d17
>>>>> Author: Harbs <ha...@in-tools.com>
>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>> 
>>>>> ----------------------------------------------------------------------
>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>> ----------------------------------------------------------------------
>>>>> 
>>>>> 
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> ----------------------------------------------------------------------
>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> index 36a1982..0848245 100644
>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>> /**
>>>>> *  @private
>>>>> */
>>>>> +    override public function set value(newValue:Number):void
>>>>> +    {
>>>>> +    if(isNaN(newValue))
>>>>> +    newValue = 0;
>>>>> +
>>>>> +    super.value = newValue;
>>>>> +    }
>>>>> +
>>>>> +    /**
>>>>> +     *  @private
>>>>> +     */
>>>>> override protected function setValue(newValue:Number):void
>>>>> {
>>>>>    super.setValue(newValue);
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Yes. I understand. I appreciate your hand-holding…

I'll try to wrap my head around this a bit later…

On Apr 7, 2013, at 6:21 PM, Frédéric THOMAS wrote:

> I understand very well what you mean Harbs, that's the reason I was trying to think with you and go progressively forward with the tests, git and bug correction.
> 
> If it is not already too much for a start, read the following.
> 
> The first part of the test 'setup' says reset the component with those values waiting for the updateComplete before to execute the next step.
> The second part 'body' says, send a TAB key, wait for the focusIn Event, then press Down twice and check the result of previousValue in myNumericStepper, myNumericStepper is defined in U:\sources\asf\flex\sdk\mustella\tests\components\NumericStepper\swfs\NumericStepper_main_spark.mxml for the spark one.
> 
> Is that a bit clearer ?
> Btw, I don't say my example works, it's only to show you the way.
> 
> Doing the tests insures other people code won't break yours.
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 4:59 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Yeah. Easy if you know what you're looking at. To me it looks like a bit of meaningless xml… :P
> 
> I have a lot of new things to absorb, and it'll take me a bit of time getting up to speed on everything… ;-)
> 
> Harbs
> 
> On Apr 7, 2013, at 5:51 PM, Frédéric THOMAS wrote:
> 
>> Those tests are pretty easy, that's properties tests .\mustella\tests\components\NumericStepper\properties
>> Just add a new one for both Mx and Spark.
>> 
>> I guess it could be something like that:
>> 
>> <TestCase testID="NumericStepper_value_NaN_spark" description="Test NumericStepper for NaN Value" keywords="[NumericStepper, value, property]">
>> 
>>  <setup>
>> 
>>      <ResetComponent target="myNumericStepper" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
>> 
>>      <SetProperty target="myNumericStepper" propertyName="maximum" value="-1" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>> 
>>      <SetProperty target="myNumericStepper" propertyName="minimum" value="-100" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>> 
>>      <SetProperty target="myNumericStepper" propertyName="value" value=NaN waitEvent="updateComplete" waitTarget="myNumericStepper" />
>> 
>>      <SetProperty target="myNumericStepper" propertyName="stepSize" value="-3" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>> 
>>  </setup>
>> 
>>  <body>
>> 
>>      <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="myNumericStepper"/>
>> 
>>      <DispatchKeyEvent keys="[DOWN, DOWN]" />
>> 
>>      <AssertPropertyValue target="myNumericStepper" propertyName="previousValue" value="-1"/>
>> 
>>  </body>
>> 
>> </TestCase>
>> 
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 4:39 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Sounds good to me, but I've never created a test case, so I have no idea what to do. Like I just responded, I believe they already are equivalent.
>> 
>> 
>> On Apr 7, 2013, at 3:29 PM, Frédéric THOMAS wrote:
>> 
>>> One more point, none of the Mustella tests for the Mx and the Spark NumericStepper have the use case of the NaN, it would be nice to add this case and make them consistent, what do you think ?
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 2:21 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
>>> case of NaN but it never happen because the checkValidValue reset it the old
>>> value in case of NaN, it means the Spart one and the Mx one are not
>>> consistent, the Mx one doesn’t allows the value to be set with NaN, is this
>>> the right answer to apply to the Spark one ?
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 2:08 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>> to NaN
>>> 
>>> Okay. Done.
>>> 
>>> I'll set up Mustella when I get a chance…
>>> 
>>> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>>> 
>>>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 1:21 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>>>> 
>>>> I'm thinking Range make the most sense because NaN is not a valid value…
>>>> 
>>>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>>> 
>>>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>>>> 
>>>>> well, nearestValidValue looks to be the place.
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: Frédéric THOMAS
>>>>> Sent: Sunday, April 07, 2013 1:00 PM
>>>>> To: dev@flex.apache.org
>>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>>>> the incr/decr have currently no code to manage that situation, that's the
>>>>> reason why I thing it could be the place to do it.
>>>>> 
>>>>> What do you think ?
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: Harbs
>>>>> Sent: Sunday, April 07, 2013 12:36 PM
>>>>> To: dev@flex.apache.org
>>>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>>>> to NaN
>>>>> 
>>>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>>> 
>>>>> But you are probably right. I see no reason to not set it straight to
>>>>> minimium.
>>>>> 
>>>>> It should probably also be fixed in Range set value(). Any reason you can
>>>>> think of why it should not be fixed there?
>>>>> 
>>>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>>>> 
>>>>> Harbs
>>>>> 
>>>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>>> 
>>>>>> Hi Harbs,
>>>>>> 
>>>>>> I guess you will have the opportunity to do it again.
>>>>>> 
>>>>>> What if 0 is out of the Range ?
>>>>>> 
>>>>>> I guess the right fix is:
>>>>>> 
>>>>>> if(isNaN(newValue))
>>>>>> newValue = minimum;
>>>>>> 
>>>>>> -Fred
>>>>>> 
>>>>>> -----Message d'origine----- From: Harbs
>>>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>>>> To: dev@flex.apache.org
>>>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>>>> 
>>>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>>>> 
>>>>>> FWIW, it was FLEX-33288
>>>>>> 
>>>>>> Harbs
>>>>>> 
>>>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>>> 
>>>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>>>> issue.
>>>>>>> 
>>>>>>> -Fred
>>>>>>> 
>>>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>>>> To: commits@flex.apache.org
>>>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>>>> 
>>>>>>> Updated Branches:
>>>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>>> 
>>>>>>> 
>>>>>>> Added override to set value to ensure it is not set to NaN
>>>>>>> 
>>>>>>> 
>>>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>>> 
>>>>>>> Branch: refs/heads/develop
>>>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>>>> Parents: 9ec4d17
>>>>>>> Author: Harbs <ha...@in-tools.com>
>>>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>>> 
>>>>>>> ----------------------------------------------------------------------
>>>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>>>> ----------------------------------------------------------------------
>>>>>>> 
>>>>>>> 
>>>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>>> ----------------------------------------------------------------------
>>>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>>> index 36a1982..0848245 100644
>>>>>>> ---  a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>>>> /**
>>>>>>> *  @private
>>>>>>> */
>>>>>>> +    override public function set value(newValue:Number):void
>>>>>>> +    {
>>>>>>> +    if(isNaN(newValue))
>>>>>>> +    newValue = 0;
>>>>>>> +
>>>>>>> +    super.value = newValue;
>>>>>>> +    }
>>>>>>> +
>>>>>>> +    /**
>>>>>>> +     *  @private
>>>>>>> +     */
>>>>>>> override protected function setValue(newValue:Number):void
>>>>>>> {
>>>>>>>  super.setValue(newValue);
>>>>>>> 
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
I understand very well what you mean Harbs, that's the reason I was trying 
to think with you and go progressively forward with the tests, git and bug 
correction.

If it is not already too much for a start, read the following.

The first part of the test 'setup' says reset the component with those 
values waiting for the updateComplete before to execute the next step.
The second part 'body' says, send a TAB key, wait for the focusIn Event, 
then press Down twice and check the result of previousValue in 
myNumericStepper, myNumericStepper is defined in 
U:\sources\asf\flex\sdk\mustella\tests\components\NumericStepper\swfs\NumericStepper_main_spark.mxml 
for the spark one.

Is that a bit clearer ?
Btw, I don't say my example works, it's only to show you the way.

Doing the tests insures other people code won't break yours.

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 4:59 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Yeah. Easy if you know what you're looking at. To me it looks like a bit of 
meaningless xml… :P

I have a lot of new things to absorb, and it'll take me a bit of time 
getting up to speed on everything… ;-)

Harbs

On Apr 7, 2013, at 5:51 PM, Frédéric THOMAS wrote:

> Those tests are pretty easy, that's properties tests 
> .\mustella\tests\components\NumericStepper\properties
> Just add a new one for both Mx and Spark.
>
> I guess it could be something like that:
>
> <TestCase testID="NumericStepper_value_NaN_spark" description="Test 
> NumericStepper for NaN Value" keywords="[NumericStepper, value, 
> property]">
>
>   <setup>
>
>       <ResetComponent target="myNumericStepper" 
> className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
>
>       <SetProperty target="myNumericStepper" propertyName="maximum" 
> value="-1" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>
>       <SetProperty target="myNumericStepper" propertyName="minimum" 
> value="-100" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>
>       <SetProperty target="myNumericStepper" propertyName="value" 
> value=NaN waitEvent="updateComplete" waitTarget="myNumericStepper" />
>
>       <SetProperty target="myNumericStepper" propertyName="stepSize" 
> value="-3" waitEvent="updateComplete" waitTarget="myNumericStepper" />
>
>   </setup>
>
>   <body>
>
>       <DispatchKeyEvent key="TAB" waitEvent="focusIn" 
> waitTarget="myNumericStepper"/>
>
>       <DispatchKeyEvent keys="[DOWN, DOWN]" />
>
>       <AssertPropertyValue target="myNumericStepper" 
> propertyName="previousValue" value="-1"/>
>
>   </body>
>
> </TestCase>
>
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 4:39 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Sounds good to me, but I've never created a test case, so I have no idea 
> what to do. Like I just responded, I believe they already are equivalent.
>
>
> On Apr 7, 2013, at 3:29 PM, Frédéric THOMAS wrote:
>
>> One more point, none of the Mustella tests for the Mx and the Spark 
>> NumericStepper have the use case of the NaN, it would be nice to add this 
>> case and make them consistent, what do you think ?
>>
>> -Fred
>>
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 2:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
>> case of NaN but it never happen because the checkValidValue reset it the 
>> old
>> value in case of NaN, it means the Spart one and the Mx one are not
>> consistent, the Mx one doesn’t allows the value to be set with NaN, is 
>> this
>> the right answer to apply to the Spark one ?
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 2:08 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set
>> to NaN
>>
>> Okay. Done.
>>
>> I'll set up Mustella when I get a chance…
>>
>> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>>
>>> Yeah, Range allows to incr/decr in changeValueByStep, so 
>>> nearestValidValue is the good place, I haven't seen before because the 
>>> source code where FB took me wasn't the good function, I have to fix 
>>> that, that's a pain.
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 1:21 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> Yes. nearestValidValue looks like a good place to fix it. The question 
>>> is, should it be in Range, Spinner (what a funny name for a base class…) 
>>> or NumericStepper?
>>>
>>> I'm thinking Range make the most sense because NaN is not a valid value…
>>>
>>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>>
>>>> Sorry my bad, you are right, I was looking at another function, I don't 
>>>> use usually FB and it sent me elsewhere.
>>>>
>>>> well, nearestValidValue looks to be the place.
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: Frédéric THOMAS
>>>> Sent: Sunday, April 07, 2013 1:00 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is 
>>>> not set to NaN
>>>>
>>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>>>> so,
>>>> it is valid to set it to a NaN value to say that's a meaningless value 
>>>> but
>>>> the incr/decr have currently no code to manage that situation, that's 
>>>> the
>>>> reason why I thing it could be the place to do it.
>>>>
>>>> What do you think ?
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 12:36 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is 
>>>> not set
>>>> to NaN
>>>>
>>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>>
>>>> But you are probably right. I see no reason to not set it straight to
>>>> minimium.
>>>>
>>>> It should probably also be fixed in Range set value(). Any reason you 
>>>> can
>>>> think of why it should not be fixed there?
>>>>
>>>> If you agree, I'll revert NumericStepper and make the change in 
>>>> Range.as…
>>>>
>>>> Harbs
>>>>
>>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>>
>>>>> Hi Harbs,
>>>>>
>>>>> I guess you will have the opportunity to do it again.
>>>>>
>>>>> What if 0 is out of the Range ?
>>>>>
>>>>> I guess the right fix is:
>>>>>
>>>>> if(isNaN(newValue))
>>>>> newValue = minimum;
>>>>>
>>>>> -Fred
>>>>>
>>>>> -----Message d'origine----- From: Harbs
>>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>>> To: dev@flex.apache.org
>>>>> Subject: Re: git commit: Added override to set value to ensure it is 
>>>>> not set to NaN
>>>>>
>>>>> I thought it was automatically prepended because I created a branch 
>>>>> for it. I see that when I deleted the branch, the JIRA number 
>>>>> disappeared. Still learning git… ;-)
>>>>>
>>>>> FWIW, it was FLEX-33288
>>>>>
>>>>> Harbs
>>>>>
>>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>>
>>>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>>>> useful
>>>>>> if someone wants to see the modified code from the source tab of the 
>>>>>> Jira
>>>>>> issue.
>>>>>>
>>>>>> -Fred
>>>>>>
>>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>>> To: commits@flex.apache.org
>>>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>>>> set to NaN
>>>>>>
>>>>>> Updated Branches:
>>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>>
>>>>>>
>>>>>> Added override to set value to ensure it is not set to NaN
>>>>>>
>>>>>>
>>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>>> Commit: 
>>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>>
>>>>>> Branch: refs/heads/develop
>>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>>> Parents: 9ec4d17
>>>>>> Author: Harbs <ha...@in-tools.com>
>>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>>
>>>>>> ----------------------------------------------------------------------
>>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>>> ----------------------------------------------------------------------
>>>>>>
>>>>>>
>>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> ----------------------------------------------------------------------
>>>>>> diff --git 
>>>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> index 36a1982..0848245 100644
>>>>>> ---  
>>>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> +++ 
>>>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>>> /**
>>>>>> *  @private
>>>>>> */
>>>>>> +    override public function set value(newValue:Number):void
>>>>>> +    {
>>>>>> +    if(isNaN(newValue))
>>>>>> +    newValue = 0;
>>>>>> +
>>>>>> +    super.value = newValue;
>>>>>> +    }
>>>>>> +
>>>>>> +    /**
>>>>>> +     *  @private
>>>>>> +     */
>>>>>> override protected function setValue(newValue:Number):void
>>>>>> {
>>>>>>   super.setValue(newValue);
>>>>>>
>>>>>
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Yeah. Easy if you know what you're looking at. To me it looks like a bit of meaningless xml… :P

I have a lot of new things to absorb, and it'll take me a bit of time getting up to speed on everything… ;-)

Harbs

On Apr 7, 2013, at 5:51 PM, Frédéric THOMAS wrote:

> Those tests are pretty easy, that's properties tests .\mustella\tests\components\NumericStepper\properties
> Just add a new one for both Mx and Spark.
> 
> I guess it could be something like that:
> 
> <TestCase testID="NumericStepper_value_NaN_spark" description="Test NumericStepper for NaN Value" keywords="[NumericStepper, value, property]">
> 
>   <setup>
> 
>       <ResetComponent target="myNumericStepper" className="mx.controls.NumericStepper" waitEvent="updateComplete"/>
> 
>       <SetProperty target="myNumericStepper" propertyName="maximum" value="-1" waitEvent="updateComplete" waitTarget="myNumericStepper" />
> 
>       <SetProperty target="myNumericStepper" propertyName="minimum" value="-100" waitEvent="updateComplete" waitTarget="myNumericStepper" />
> 
>       <SetProperty target="myNumericStepper" propertyName="value" value=NaN waitEvent="updateComplete" waitTarget="myNumericStepper" />
> 
>       <SetProperty target="myNumericStepper" propertyName="stepSize" value="-3" waitEvent="updateComplete" waitTarget="myNumericStepper" />
> 
>   </setup>
> 
>   <body>
> 
>       <DispatchKeyEvent key="TAB" waitEvent="focusIn" waitTarget="myNumericStepper"/>
> 
>       <DispatchKeyEvent keys="[DOWN, DOWN]" />
> 
>       <AssertPropertyValue target="myNumericStepper" propertyName="previousValue" value="-1"/>
> 
>   </body>
> 
> </TestCase>
> 
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 4:39 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Sounds good to me, but I've never created a test case, so I have no idea what to do. Like I just responded, I believe they already are equivalent.
> 
> 
> On Apr 7, 2013, at 3:29 PM, Frédéric THOMAS wrote:
> 
>> One more point, none of the Mustella tests for the Mx and the Spark NumericStepper have the use case of the NaN, it would be nice to add this case and make them consistent, what do you think ?
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 2:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
>> case of NaN but it never happen because the checkValidValue reset it the old
>> value in case of NaN, it means the Spart one and the Mx one are not
>> consistent, the Mx one doesn’t allows the value to be set with NaN, is this
>> the right answer to apply to the Spark one ?
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 2:08 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set
>> to NaN
>> 
>> Okay. Done.
>> 
>> I'll set up Mustella when I get a chance…
>> 
>> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>> 
>>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 1:21 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>>> 
>>> I'm thinking Range make the most sense because NaN is not a valid value…
>>> 
>>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>> 
>>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>>> 
>>>> well, nearestValidValue looks to be the place.
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Frédéric THOMAS
>>>> Sent: Sunday, April 07, 2013 1:00 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>>> the incr/decr have currently no code to manage that situation, that's the
>>>> reason why I thing it could be the place to do it.
>>>> 
>>>> What do you think ?
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 12:36 PM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>>> to NaN
>>>> 
>>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>> 
>>>> But you are probably right. I see no reason to not set it straight to
>>>> minimium.
>>>> 
>>>> It should probably also be fixed in Range set value(). Any reason you can
>>>> think of why it should not be fixed there?
>>>> 
>>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>>> 
>>>> Harbs
>>>> 
>>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>> 
>>>>> Hi Harbs,
>>>>> 
>>>>> I guess you will have the opportunity to do it again.
>>>>> 
>>>>> What if 0 is out of the Range ?
>>>>> 
>>>>> I guess the right fix is:
>>>>> 
>>>>> if(isNaN(newValue))
>>>>> newValue = minimum;
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: Harbs
>>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>>> To: dev@flex.apache.org
>>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>>> 
>>>>> FWIW, it was FLEX-33288
>>>>> 
>>>>> Harbs
>>>>> 
>>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>> 
>>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>>> issue.
>>>>>> 
>>>>>> -Fred
>>>>>> 
>>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>>> To: commits@flex.apache.org
>>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>>> 
>>>>>> Updated Branches:
>>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>> 
>>>>>> 
>>>>>> Added override to set value to ensure it is not set to NaN
>>>>>> 
>>>>>> 
>>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>> 
>>>>>> Branch: refs/heads/develop
>>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>>> Parents: 9ec4d17
>>>>>> Author: Harbs <ha...@in-tools.com>
>>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>> 
>>>>>> ----------------------------------------------------------------------
>>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>>> ----------------------------------------------------------------------
>>>>>> 
>>>>>> 
>>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> ----------------------------------------------------------------------
>>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> index 36a1982..0848245 100644
>>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>>> /**
>>>>>> *  @private
>>>>>> */
>>>>>> +    override public function set value(newValue:Number):void
>>>>>> +    {
>>>>>> +    if(isNaN(newValue))
>>>>>> +    newValue = 0;
>>>>>> +
>>>>>> +    super.value = newValue;
>>>>>> +    }
>>>>>> +
>>>>>> +    /**
>>>>>> +     *  @private
>>>>>> +     */
>>>>>> override protected function setValue(newValue:Number):void
>>>>>> {
>>>>>>   super.setValue(newValue);
>>>>>> 
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Those tests are pretty easy, that's properties tests 
.\mustella\tests\components\NumericStepper\properties
Just add a new one for both Mx and Spark.

I guess it could be something like that:

<TestCase testID="NumericStepper_value_NaN_spark" description="Test 
NumericStepper for NaN Value" keywords="[NumericStepper, value, property]">

    <setup>

        <ResetComponent target="myNumericStepper" 
className="mx.controls.NumericStepper" waitEvent="updateComplete"/>

        <SetProperty target="myNumericStepper" propertyName="maximum" 
value="-1" waitEvent="updateComplete" waitTarget="myNumericStepper" />

        <SetProperty target="myNumericStepper" propertyName="minimum" 
value="-100" waitEvent="updateComplete" waitTarget="myNumericStepper" />

        <SetProperty target="myNumericStepper" propertyName="value" 
value=NaN waitEvent="updateComplete" waitTarget="myNumericStepper" />

        <SetProperty target="myNumericStepper" propertyName="stepSize" 
value="-3" waitEvent="updateComplete" waitTarget="myNumericStepper" />

    </setup>

    <body>

        <DispatchKeyEvent key="TAB" waitEvent="focusIn" 
waitTarget="myNumericStepper"/>

        <DispatchKeyEvent keys="[DOWN, DOWN]" />

        <AssertPropertyValue target="myNumericStepper" 
propertyName="previousValue" value="-1"/>

    </body>

</TestCase>


-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 4:39 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Sounds good to me, but I've never created a test case, so I have no idea 
what to do. Like I just responded, I believe they already are equivalent.


On Apr 7, 2013, at 3:29 PM, Frédéric THOMAS wrote:

> One more point, none of the Mustella tests for the Mx and the Spark 
> NumericStepper have the use case of the NaN, it would be nice to add this 
> case and make them consistent, what do you think ?
>
> -Fred
>
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 2:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
> case of NaN but it never happen because the checkValidValue reset it the 
> old
> value in case of NaN, it means the Spart one and the Mx one are not
> consistent, the Mx one doesn’t allows the value to be set with NaN, is 
> this
> the right answer to apply to the Spark one ?
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 2:08 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set
> to NaN
>
> Okay. Done.
>
> I'll set up Mustella when I get a chance…
>
> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
>
>> Yeah, Range allows to incr/decr in changeValueByStep, so 
>> nearestValidValue is the good place, I haven't seen before because the 
>> source code where FB took me wasn't the good function, I have to fix 
>> that, that's a pain.
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 1:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> Yes. nearestValidValue looks like a good place to fix it. The question 
>> is, should it be in Range, Spinner (what a funny name for a base class…) 
>> or NumericStepper?
>>
>> I'm thinking Range make the most sense because NaN is not a valid value…
>>
>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>>
>>> Sorry my bad, you are right, I was looking at another function, I don't 
>>> use usually FB and it sent me elsewhere.
>>>
>>> well, nearestValidValue looks to be the place.
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 1:00 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>>> so,
>>> it is valid to set it to a NaN value to say that's a meaningless value 
>>> but
>>> the incr/decr have currently no code to manage that situation, that's 
>>> the
>>> reason why I thing it could be the place to do it.
>>>
>>> What do you think ?
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 12:36 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set
>>> to NaN
>>>
>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>>
>>> But you are probably right. I see no reason to not set it straight to
>>> minimium.
>>>
>>> It should probably also be fixed in Range set value(). Any reason you 
>>> can
>>> think of why it should not be fixed there?
>>>
>>> If you agree, I'll revert NumericStepper and make the change in 
>>> Range.as…
>>>
>>> Harbs
>>>
>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>>
>>>> Hi Harbs,
>>>>
>>>> I guess you will have the opportunity to do it again.
>>>>
>>>> What if 0 is out of the Range ?
>>>>
>>>> I guess the right fix is:
>>>>
>>>> if(isNaN(newValue))
>>>> newValue = minimum;
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is 
>>>> not set to NaN
>>>>
>>>> I thought it was automatically prepended because I created a branch for 
>>>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>>>> Still learning git… ;-)
>>>>
>>>> FWIW, it was FLEX-33288
>>>>
>>>> Harbs
>>>>
>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>>
>>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>>> useful
>>>>> if someone wants to see the modified code from the source tab of the 
>>>>> Jira
>>>>> issue.
>>>>>
>>>>> -Fred
>>>>>
>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>> To: commits@flex.apache.org
>>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>>> set to NaN
>>>>>
>>>>> Updated Branches:
>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>>
>>>>>
>>>>> Added override to set value to ensure it is not set to NaN
>>>>>
>>>>>
>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>> Commit: 
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>>
>>>>> Branch: refs/heads/develop
>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>> Parents: 9ec4d17
>>>>> Author: Harbs <ha...@in-tools.com>
>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>>
>>>>> ----------------------------------------------------------------------
>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>> ----------------------------------------------------------------------
>>>>>
>>>>>
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> ----------------------------------------------------------------------
>>>>> diff --git 
>>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> index 36a1982..0848245 100644
>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>> /**
>>>>> *  @private
>>>>> */
>>>>> +    override public function set value(newValue:Number):void
>>>>> +    {
>>>>> +    if(isNaN(newValue))
>>>>> +    newValue = 0;
>>>>> +
>>>>> +    super.value = newValue;
>>>>> +    }
>>>>> +
>>>>> +    /**
>>>>> +     *  @private
>>>>> +     */
>>>>> override protected function setValue(newValue:Number):void
>>>>> {
>>>>>    super.setValue(newValue);
>>>>>
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Sounds good to me, but I've never created a test case, so I have no idea what to do. Like I just responded, I believe they already are equivalent.


On Apr 7, 2013, at 3:29 PM, Frédéric THOMAS wrote:

> One more point, none of the Mustella tests for the Mx and the Spark NumericStepper have the use case of the NaN, it would be nice to add this case and make them consistent, what do you think ?
> 
> -Fred
> 
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 2:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
> case of NaN but it never happen because the checkValidValue reset it the old
> value in case of NaN, it means the Spart one and the Mx one are not
> consistent, the Mx one doesn’t allows the value to be set with NaN, is this
> the right answer to apply to the Spark one ?
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 2:08 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set
> to NaN
> 
> Okay. Done.
> 
> I'll set up Mustella when I get a chance…
> 
> On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:
> 
>> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 1:21 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
>> 
>> I'm thinking Range make the most sense because NaN is not a valid value…
>> 
>> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>> 
>>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>>> 
>>> well, nearestValidValue looks to be the place.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Frédéric THOMAS
>>> Sent: Sunday, April 07, 2013 1:00 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>>> it is valid to set it to a NaN value to say that's a meaningless value but
>>> the incr/decr have currently no code to manage that situation, that's the
>>> reason why I thing it could be the place to do it.
>>> 
>>> What do you think ?
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 12:36 PM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set
>>> to NaN
>>> 
>>> If 0 is out of range, 0 will be converted to minimum automatically.
>>> 
>>> But you are probably right. I see no reason to not set it straight to
>>> minimium.
>>> 
>>> It should probably also be fixed in Range set value(). Any reason you can
>>> think of why it should not be fixed there?
>>> 
>>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>> 
>>> Harbs
>>> 
>>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>> 
>>>> Hi Harbs,
>>>> 
>>>> I guess you will have the opportunity to do it again.
>>>> 
>>>> What if 0 is out of the Range ?
>>>> 
>>>> I guess the right fix is:
>>>> 
>>>> if(isNaN(newValue))
>>>> newValue = minimum;
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: Harbs
>>>> Sent: Sunday, April 07, 2013 11:38 AM
>>>> To: dev@flex.apache.org
>>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>>> 
>>>> FWIW, it was FLEX-33288
>>>> 
>>>> Harbs
>>>> 
>>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>> 
>>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>>> if someone wants to see the modified code from the source tab of the Jira
>>>>> issue.
>>>>> 
>>>>> -Fred
>>>>> 
>>>>> -----Message d'origine----- From: harbs@apache.org
>>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>>> To: commits@flex.apache.org
>>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> Updated Branches:
>>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>> 
>>>>> 
>>>>> Added override to set value to ensure it is not set to NaN
>>>>> 
>>>>> 
>>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>> 
>>>>> Branch: refs/heads/develop
>>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>>> Parents: 9ec4d17
>>>>> Author: Harbs <ha...@in-tools.com>
>>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>>> Committer: Harbs <ha...@in-tools.com>
>>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>> 
>>>>> ----------------------------------------------------------------------
>>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>>> ----------------------------------------------------------------------
>>>>> 
>>>>> 
>>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> ----------------------------------------------------------------------
>>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> index 36a1982..0848245 100644
>>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>>> /**
>>>>> *  @private
>>>>> */
>>>>> +    override public function set value(newValue:Number):void
>>>>> +    {
>>>>> +    if(isNaN(newValue))
>>>>> +    newValue = 0;
>>>>> +
>>>>> +    super.value = newValue;
>>>>> +    }
>>>>> +
>>>>> +    /**
>>>>> +     *  @private
>>>>> +     */
>>>>> override protected function setValue(newValue:Number):void
>>>>> {
>>>>>    super.setValue(newValue);
>>>>> 
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
One more point, none of the Mustella tests for the Mx and the Spark 
NumericStepper have the use case of the NaN, it would be nice to add this 
case and make them consistent, what do you think ?

-Fred

-----Message d'origine----- 
From: Frédéric THOMAS
Sent: Sunday, April 07, 2013 2:21 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in
case of NaN but it never happen because the checkValidValue reset it the old
value in case of NaN, it means the Spart one and the Mx one are not
consistent, the Mx one doesn’t allows the value to be set with NaN, is this
the right answer to apply to the Spark one ?

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 2:08 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set
to NaN

Okay. Done.

I'll set up Mustella when I get a chance…

On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:

> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue 
> is the good place, I haven't seen before because the source code where FB 
> took me wasn't the good function, I have to fix that, that's a pain.
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 1:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Yes. nearestValidValue looks like a good place to fix it. The question is, 
> should it be in Range, Spinner (what a funny name for a base class…) or 
> NumericStepper?
>
> I'm thinking Range make the most sense because NaN is not a valid value…
>
> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>
>> Sorry my bad, you are right, I was looking at another function, I don't 
>> use usually FB and it sent me elsewhere.
>>
>> well, nearestValidValue looks to be the place.
>>
>> -Fred
>>
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 1:00 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>> so,
>> it is valid to set it to a NaN value to say that's a meaningless value 
>> but
>> the incr/decr have currently no code to manage that situation, that's the
>> reason why I thing it could be the place to do it.
>>
>> What do you think ?
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 12:36 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set
>> to NaN
>>
>> If 0 is out of range, 0 will be converted to minimum automatically.
>>
>> But you are probably right. I see no reason to not set it straight to
>> minimium.
>>
>> It should probably also be fixed in Range set value(). Any reason you can
>> think of why it should not be fixed there?
>>
>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>
>> Harbs
>>
>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>
>>> Hi Harbs,
>>>
>>> I guess you will have the opportunity to do it again.
>>>
>>> What if 0 is out of the Range ?
>>>
>>> I guess the right fix is:
>>>
>>> if(isNaN(newValue))
>>> newValue = minimum;
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 11:38 AM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> I thought it was automatically prepended because I created a branch for 
>>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>>> Still learning git… ;-)
>>>
>>> FWIW, it was FLEX-33288
>>>
>>> Harbs
>>>
>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>
>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>> useful
>>>> if someone wants to see the modified code from the source tab of the 
>>>> Jira
>>>> issue.
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: harbs@apache.org
>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>> To: commits@flex.apache.org
>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>> set to NaN
>>>>
>>>> Updated Branches:
>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>
>>>>
>>>> Added override to set value to ensure it is not set to NaN
>>>>
>>>>
>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>
>>>> Branch: refs/heads/develop
>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>> Parents: 9ec4d17
>>>> Author: Harbs <ha...@in-tools.com>
>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>> Committer: Harbs <ha...@in-tools.com>
>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>
>>>> ----------------------------------------------------------------------
>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>> ----------------------------------------------------------------------
>>>>
>>>>
>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> ----------------------------------------------------------------------
>>>> diff --git 
>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> index 36a1982..0848245 100644
>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>> /**
>>>>  *  @private
>>>>  */
>>>> +    override public function set value(newValue:Number):void
>>>> +    {
>>>> +    if(isNaN(newValue))
>>>> +    newValue = 0;
>>>> +
>>>> +    super.value = newValue;
>>>> +    }
>>>> +
>>>> +    /**
>>>> +     *  @private
>>>> +     */
>>>> override protected function setValue(newValue:Number):void
>>>> {
>>>>     super.setValue(newValue);
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Ok, I just noticed the mx:NumericStepper commitProperties set it to 0 in 
case of NaN but it never happen because the checkValidValue reset it the old 
value in case of NaN, it means the Spart one and the Mx one are not 
consistent, the Mx one doesn’t allows the value to be set with NaN, is this 
the right answer to apply to the Spark one ?

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 2:08 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Okay. Done.

I'll set up Mustella when I get a chance…

On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:

> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue 
> is the good place, I haven't seen before because the source code where FB 
> took me wasn't the good function, I have to fix that, that's a pain.
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 1:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> Yes. nearestValidValue looks like a good place to fix it. The question is, 
> should it be in Range, Spinner (what a funny name for a base class…) or 
> NumericStepper?
>
> I'm thinking Range make the most sense because NaN is not a valid value…
>
> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
>
>> Sorry my bad, you are right, I was looking at another function, I don't 
>> use usually FB and it sent me elsewhere.
>>
>> well, nearestValidValue looks to be the place.
>>
>> -Fred
>>
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 1:00 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
>> so,
>> it is valid to set it to a NaN value to say that's a meaningless value 
>> but
>> the incr/decr have currently no code to manage that situation, that's the
>> reason why I thing it could be the place to do it.
>>
>> What do you think ?
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 12:36 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set
>> to NaN
>>
>> If 0 is out of range, 0 will be converted to minimum automatically.
>>
>> But you are probably right. I see no reason to not set it straight to
>> minimium.
>>
>> It should probably also be fixed in Range set value(). Any reason you can
>> think of why it should not be fixed there?
>>
>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>>
>> Harbs
>>
>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>>
>>> Hi Harbs,
>>>
>>> I guess you will have the opportunity to do it again.
>>>
>>> What if 0 is out of the Range ?
>>>
>>> I guess the right fix is:
>>>
>>> if(isNaN(newValue))
>>> newValue = minimum;
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 11:38 AM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not 
>>> set to NaN
>>>
>>> I thought it was automatically prepended because I created a branch for 
>>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>>> Still learning git… ;-)
>>>
>>> FWIW, it was FLEX-33288
>>>
>>> Harbs
>>>
>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>>
>>>> Take the habit to prepend the issue id to your commit message, it is 
>>>> useful
>>>> if someone wants to see the modified code from the source tab of the 
>>>> Jira
>>>> issue.
>>>>
>>>> -Fred
>>>>
>>>> -----Message d'origine----- From: harbs@apache.org
>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>> To: commits@flex.apache.org
>>>> Subject: git commit: Added override to set value to ensure it is not 
>>>> set to NaN
>>>>
>>>> Updated Branches:
>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>>
>>>>
>>>> Added override to set value to ensure it is not set to NaN
>>>>
>>>>
>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>>
>>>> Branch: refs/heads/develop
>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>> Parents: 9ec4d17
>>>> Author: Harbs <ha...@in-tools.com>
>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>> Committer: Harbs <ha...@in-tools.com>
>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>>
>>>> ----------------------------------------------------------------------
>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>> ----------------------------------------------------------------------
>>>>
>>>>
>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> ----------------------------------------------------------------------
>>>> diff --git 
>>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> index 36a1982..0848245 100644
>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>> /**
>>>>  *  @private
>>>>  */
>>>> +    override public function set value(newValue:Number):void
>>>> +    {
>>>> +    if(isNaN(newValue))
>>>> +    newValue = 0;
>>>> +
>>>> +    super.value = newValue;
>>>> +    }
>>>> +
>>>> +    /**
>>>> +     *  @private
>>>> +     */
>>>> override protected function setValue(newValue:Number):void
>>>> {
>>>>     super.setValue(newValue);
>>>>
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Okay. Done.

I'll set up Mustella when I get a chance…

On Apr 7, 2013, at 2:28 PM, Frédéric THOMAS wrote:

> Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue is the good place, I haven't seen before because the source code where FB took me wasn't the good function, I have to fix that, that's a pain.
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 1:21 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?
> 
> I'm thinking Range make the most sense because NaN is not a valid value…
> 
> On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:
> 
>> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
>> 
>> well, nearestValidValue looks to be the place.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 1:00 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
>> it is valid to set it to a NaN value to say that's a meaningless value but
>> the incr/decr have currently no code to manage that situation, that's the
>> reason why I thing it could be the place to do it.
>> 
>> What do you think ?
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 12:36 PM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set
>> to NaN
>> 
>> If 0 is out of range, 0 will be converted to minimum automatically.
>> 
>> But you are probably right. I see no reason to not set it straight to
>> minimium.
>> 
>> It should probably also be fixed in Range set value(). Any reason you can
>> think of why it should not be fixed there?
>> 
>> If you agree, I'll revert NumericStepper and make the change in Range.as…
>> 
>> Harbs
>> 
>> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>> 
>>> Hi Harbs,
>>> 
>>> I guess you will have the opportunity to do it again.
>>> 
>>> What if 0 is out of the Range ?
>>> 
>>> I guess the right fix is:
>>> 
>>> if(isNaN(newValue))
>>> newValue = minimum;
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: Harbs
>>> Sent: Sunday, April 07, 2013 11:38 AM
>>> To: dev@flex.apache.org
>>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>>> 
>>> FWIW, it was FLEX-33288
>>> 
>>> Harbs
>>> 
>>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>> 
>>>> Take the habit to prepend the issue id to your commit message, it is useful
>>>> if someone wants to see the modified code from the source tab of the Jira
>>>> issue.
>>>> 
>>>> -Fred
>>>> 
>>>> -----Message d'origine----- From: harbs@apache.org
>>>> Sent: Sunday, April 07, 2013 9:02 AM
>>>> To: commits@flex.apache.org
>>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>>> 
>>>> Updated Branches:
>>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>> 
>>>> 
>>>> Added override to set value to ensure it is not set to NaN
>>>> 
>>>> 
>>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>> 
>>>> Branch: refs/heads/develop
>>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>>> Parents: 9ec4d17
>>>> Author: Harbs <ha...@in-tools.com>
>>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>>> Committer: Harbs <ha...@in-tools.com>
>>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>> 
>>>> ----------------------------------------------------------------------
>>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>>> ----------------------------------------------------------------------
>>>> 
>>>> 
>>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> ----------------------------------------------------------------------
>>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> index 36a1982..0848245 100644
>>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>> /**
>>>>  *  @private
>>>>  */
>>>> +    override public function set value(newValue:Number):void
>>>> +    {
>>>> +    if(isNaN(newValue))
>>>> +    newValue = 0;
>>>> +
>>>> +    super.value = newValue;
>>>> +    }
>>>> +
>>>> +    /**
>>>> +     *  @private
>>>> +     */
>>>> override protected function setValue(newValue:Number):void
>>>> {
>>>>     super.setValue(newValue);
>>>> 
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Yeah, Range allows to incr/decr in changeValueByStep, so nearestValidValue 
is the good place, I haven't seen before because the source code where FB 
took me wasn't the good function, I have to fix that, that's a pain.

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 1:21 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Yes. nearestValidValue looks like a good place to fix it. The question is, 
should it be in Range, Spinner (what a funny name for a base class…) or 
NumericStepper?

I'm thinking Range make the most sense because NaN is not a valid value…

On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:

> Sorry my bad, you are right, I was looking at another function, I don't 
> use usually FB and it sent me elsewhere.
>
> well, nearestValidValue looks to be the place.
>
> -Fred
>
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 1:00 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, 
> so,
> it is valid to set it to a NaN value to say that's a meaningless value but
> the incr/decr have currently no code to manage that situation, that's the
> reason why I thing it could be the place to do it.
>
> What do you think ?
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 12:36 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set
> to NaN
>
> If 0 is out of range, 0 will be converted to minimum automatically.
>
> But you are probably right. I see no reason to not set it straight to
> minimium.
>
> It should probably also be fixed in Range set value(). Any reason you can
> think of why it should not be fixed there?
>
> If you agree, I'll revert NumericStepper and make the change in Range.as…
>
> Harbs
>
> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
>
>> Hi Harbs,
>>
>> I guess you will have the opportunity to do it again.
>>
>> What if 0 is out of the Range ?
>>
>> I guess the right fix is:
>>
>> if(isNaN(newValue))
>>  newValue = minimum;
>>
>> -Fred
>>
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 11:38 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not 
>> set to NaN
>>
>> I thought it was automatically prepended because I created a branch for 
>> it. I see that when I deleted the branch, the JIRA number disappeared. 
>> Still learning git… ;-)
>>
>> FWIW, it was FLEX-33288
>>
>> Harbs
>>
>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>>
>>> Take the habit to prepend the issue id to your commit message, it is 
>>> useful
>>> if someone wants to see the modified code from the source tab of the 
>>> Jira
>>> issue.
>>>
>>> -Fred
>>>
>>> -----Message d'origine----- From: harbs@apache.org
>>> Sent: Sunday, April 07, 2013 9:02 AM
>>> To: commits@flex.apache.org
>>> Subject: git commit: Added override to set value to ensure it is not set 
>>> to NaN
>>>
>>> Updated Branches:
>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>>
>>>
>>> Added override to set value to ensure it is not set to NaN
>>>
>>>
>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>>
>>> Branch: refs/heads/develop
>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>> Parents: 9ec4d17
>>> Author: Harbs <ha...@in-tools.com>
>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>> Committer: Harbs <ha...@in-tools.com>
>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>>
>>> ----------------------------------------------------------------------
>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>> ----------------------------------------------------------------------
>>>
>>>
>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> ----------------------------------------------------------------------
>>> diff --git 
>>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> index 36a1982..0848245 100644
>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>  /**
>>>   *  @private
>>>   */
>>> +    override public function set value(newValue:Number):void
>>> +    {
>>> +    if(isNaN(newValue))
>>> +    newValue = 0;
>>> +
>>> +    super.value = newValue;
>>> +    }
>>> +
>>> +    /**
>>> +     *  @private
>>> +     */
>>>  override protected function setValue(newValue:Number):void
>>>  {
>>>      super.setValue(newValue);
>>>
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Yes. nearestValidValue looks like a good place to fix it. The question is, should it be in Range, Spinner (what a funny name for a base class…) or NumericStepper?

I'm thinking Range make the most sense because NaN is not a valid value…

On Apr 7, 2013, at 2:08 PM, Frédéric THOMAS wrote:

> Sorry my bad, you are right, I was looking at another function, I don't use usually FB and it sent me elsewhere.
> 
> well, nearestValidValue looks to be the place.
> 
> -Fred
> 
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 1:00 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
> it is valid to set it to a NaN value to say that's a meaningless value but
> the incr/decr have currently no code to manage that situation, that's the
> reason why I thing it could be the place to do it.
> 
> What do you think ?
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 12:36 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set
> to NaN
> 
> If 0 is out of range, 0 will be converted to minimum automatically.
> 
> But you are probably right. I see no reason to not set it straight to
> minimium.
> 
> It should probably also be fixed in Range set value(). Any reason you can
> think of why it should not be fixed there?
> 
> If you agree, I'll revert NumericStepper and make the change in Range.as…
> 
> Harbs
> 
> On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:
> 
>> Hi Harbs,
>> 
>> I guess you will have the opportunity to do it again.
>> 
>> What if 0 is out of the Range ?
>> 
>> I guess the right fix is:
>> 
>> if(isNaN(newValue))
>>  newValue = minimum;
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 11:38 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
>> 
>> FWIW, it was FLEX-33288
>> 
>> Harbs
>> 
>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>> 
>>> Take the habit to prepend the issue id to your commit message, it is useful
>>> if someone wants to see the modified code from the source tab of the Jira
>>> issue.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: harbs@apache.org
>>> Sent: Sunday, April 07, 2013 9:02 AM
>>> To: commits@flex.apache.org
>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Updated Branches:
>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>> 
>>> 
>>> Added override to set value to ensure it is not set to NaN
>>> 
>>> 
>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>> 
>>> Branch: refs/heads/develop
>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>> Parents: 9ec4d17
>>> Author: Harbs <ha...@in-tools.com>
>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>> Committer: Harbs <ha...@in-tools.com>
>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>> 
>>> ----------------------------------------------------------------------
>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>> ----------------------------------------------------------------------
>>> 
>>> 
>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> ----------------------------------------------------------------------
>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> index 36a1982..0848245 100644
>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>  /**
>>>   *  @private
>>>   */
>>> +    override public function set value(newValue:Number):void
>>> +    {
>>> +    if(isNaN(newValue))
>>> +    newValue = 0;
>>> +
>>> +    super.value = newValue;
>>> +    }
>>> +
>>> +    /**
>>> +     *  @private
>>> +     */
>>>  override protected function setValue(newValue:Number):void
>>>  {
>>>      super.setValue(newValue);
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Sorry my bad, you are right, I was looking at another function, I don't use 
usually FB and it sent me elsewhere.

well, nearestValidValue looks to be the place.

-Fred

-----Message d'origine----- 
From: Frédéric THOMAS
Sent: Sunday, April 07, 2013 1:00 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so,
it is valid to set it to a NaN value to say that's a meaningless value but
the incr/decr have currently no code to manage that situation, that's the
reason why I thing it could be the place to do it.

What do you think ?

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 12:36 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set
to NaN

If 0 is out of range, 0 will be converted to minimum automatically.

But you are probably right. I see no reason to not set it straight to
minimium.

It should probably also be fixed in Range set value(). Any reason you can
think of why it should not be fixed there?

If you agree, I'll revert NumericStepper and make the change in Range.as…

Harbs

On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:

> Hi Harbs,
>
> I guess you will have the opportunity to do it again.
>
> What if 0 is out of the Range ?
>
> I guess the right fix is:
>
> if(isNaN(newValue))
>   newValue = minimum;
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 11:38 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> I thought it was automatically prepended because I created a branch for 
> it. I see that when I deleted the branch, the JIRA number disappeared. 
> Still learning git… ;-)
>
> FWIW, it was FLEX-33288
>
> Harbs
>
> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>
>> Take the habit to prepend the issue id to your commit message, it is 
>> useful
>> if someone wants to see the modified code from the source tab of the Jira
>> issue.
>>
>> -Fred
>>
>> -----Message d'origine----- From: harbs@apache.org
>> Sent: Sunday, April 07, 2013 9:02 AM
>> To: commits@flex.apache.org
>> Subject: git commit: Added override to set value to ensure it is not set 
>> to NaN
>>
>> Updated Branches:
>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>
>>
>> Added override to set value to ensure it is not set to NaN
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>
>> Branch: refs/heads/develop
>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>> Parents: 9ec4d17
>> Author: Harbs <ha...@in-tools.com>
>> Authored: Sun Apr 7 09:58:20 2013 +0300
>> Committer: Harbs <ha...@in-tools.com>
>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>
>> ----------------------------------------------------------------------
>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>> 1 files changed, 11 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> ----------------------------------------------------------------------
>> diff --git 
>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> index 36a1982..0848245 100644
>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>   /**
>>    *  @private
>>    */
>> +    override public function set value(newValue:Number):void
>> +    {
>> +    if(isNaN(newValue))
>> +    newValue = 0;
>> +
>> +    super.value = newValue;
>> +    }
>> +
>> +    /**
>> +     *  @private
>> +     */
>>   override protected function setValue(newValue:Number):void
>>   {
>>       super.setValue(newValue);
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
IMHO, it is more a Spinner thing as the Range doesn’t incr/decr values, so, 
it is valid to set it to a NaN value to say that's a meaningless value but 
the incr/decr have currently no code to manage that situation, that's the 
reason why I thing it could be the place to do it.

What do you think ?

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 12:36 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

If 0 is out of range, 0 will be converted to minimum automatically.

But you are probably right. I see no reason to not set it straight to 
minimium.

It should probably also be fixed in Range set value(). Any reason you can 
think of why it should not be fixed there?

If you agree, I'll revert NumericStepper and make the change in Range.as…

Harbs

On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:

> Hi Harbs,
>
> I guess you will have the opportunity to do it again.
>
> What if 0 is out of the Range ?
>
> I guess the right fix is:
>
> if(isNaN(newValue))
>   newValue = minimum;
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 11:38 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> I thought it was automatically prepended because I created a branch for 
> it. I see that when I deleted the branch, the JIRA number disappeared. 
> Still learning git… ;-)
>
> FWIW, it was FLEX-33288
>
> Harbs
>
> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>
>> Take the habit to prepend the issue id to your commit message, it is 
>> useful
>> if someone wants to see the modified code from the source tab of the Jira
>> issue.
>>
>> -Fred
>>
>> -----Message d'origine----- From: harbs@apache.org
>> Sent: Sunday, April 07, 2013 9:02 AM
>> To: commits@flex.apache.org
>> Subject: git commit: Added override to set value to ensure it is not set 
>> to NaN
>>
>> Updated Branches:
>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>
>>
>> Added override to set value to ensure it is not set to NaN
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>
>> Branch: refs/heads/develop
>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>> Parents: 9ec4d17
>> Author: Harbs <ha...@in-tools.com>
>> Authored: Sun Apr 7 09:58:20 2013 +0300
>> Committer: Harbs <ha...@in-tools.com>
>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>
>> ----------------------------------------------------------------------
>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>> 1 files changed, 11 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> ----------------------------------------------------------------------
>> diff --git 
>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> index 36a1982..0848245 100644
>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>   /**
>>    *  @private
>>    */
>> +    override public function set value(newValue:Number):void
>> +    {
>> +    if(isNaN(newValue))
>> +    newValue = 0;
>> +
>> +    super.value = newValue;
>> +    }
>> +
>> +    /**
>> +     *  @private
>> +     */
>>   override protected function setValue(newValue:Number):void
>>   {
>>       super.setValue(newValue);
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
If 0 is out of range, 0 will be converted to minimum automatically.

But you are probably right. I see no reason to not set it straight to minimium.

It should probably also be fixed in Range set value(). Any reason you can think of why it should not be fixed there?

If you agree, I'll revert NumericStepper and make the change in Range.as…

Harbs

On Apr 7, 2013, at 12:43 PM, Frédéric THOMAS wrote:

> Hi Harbs,
> 
> I guess you will have the opportunity to do it again.
> 
> What if 0 is out of the Range ?
> 
> I guess the right fix is:
> 
> if(isNaN(newValue))
>   newValue = minimum;
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 11:38 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)
> 
> FWIW, it was FLEX-33288
> 
> Harbs
> 
> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
> 
>> Take the habit to prepend the issue id to your commit message, it is useful
>> if someone wants to see the modified code from the source tab of the Jira
>> issue.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: harbs@apache.org
>> Sent: Sunday, April 07, 2013 9:02 AM
>> To: commits@flex.apache.org
>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Updated Branches:
>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>> 
>> 
>> Added override to set value to ensure it is not set to NaN
>> 
>> 
>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>> 
>> Branch: refs/heads/develop
>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>> Parents: 9ec4d17
>> Author: Harbs <ha...@in-tools.com>
>> Authored: Sun Apr 7 09:58:20 2013 +0300
>> Committer: Harbs <ha...@in-tools.com>
>> Committed: Sun Apr 7 09:58:20 2013 +0300
>> 
>> ----------------------------------------------------------------------
>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>> 1 files changed, 11 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> ----------------------------------------------------------------------
>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> index 36a1982..0848245 100644
>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>   /**
>>    *  @private
>>    */
>> +    override public function set value(newValue:Number):void
>> +    {
>> +    if(isNaN(newValue))
>> +    newValue = 0;
>> +
>> +    super.value = newValue;
>> +    }
>> +
>> +    /**
>> +     *  @private
>> +     */
>>   override protected function setValue(newValue:Number):void
>>   {
>>       super.setValue(newValue);
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Okay. Thanks. I'll need to find the time to go through the wiki properly…

On Apr 7, 2013, at 2:01 PM, Frédéric THOMAS wrote:

> I personally do it on the same one, the wiki explains how to run tests, Om did the tool called OneClickMustella to simplify your life.
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 12:39 PM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> Okay. But I'll have to set up another machine to run Mustella on, and I'll probably need some hand-holding on it…
> 
> On Apr 7, 2013, at 12:53 PM, Frédéric THOMAS wrote:
> 
>> And sorry again but now you are committer, I guess it is your duty to run the Mustella tests to ensure the fix doesn't break them (or eventually you'll need to adapt the tests too).
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 11:46 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> And maybe it can be fixed directly in the Sinner at override public function
>> changeValueByStep(increase:Boolean = true):void
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Frédéric THOMAS
>> Sent: Sunday, April 07, 2013 11:43 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set
>> to NaN
>> 
>> Hi Harbs,
>> 
>> I guess you will have the opportunity to do it again.
>> 
>> What if 0 is out of the Range ?
>> 
>> I guess the right fix is:
>> 
>> if(isNaN(newValue))
>>  newValue = minimum;
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: Harbs
>> Sent: Sunday, April 07, 2013 11:38 AM
>> To: dev@flex.apache.org
>> Subject: Re: git commit: Added override to set value to ensure it is not set
>> to NaN
>> 
>> I thought it was automatically prepended because I created a branch for it.
>> I see that when I deleted the branch, the JIRA number disappeared. Still
>> learning git… ;-)
>> 
>> FWIW, it was FLEX-33288
>> 
>> Harbs
>> 
>> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>> 
>>> Take the habit to prepend the issue id to your commit message, it is useful
>>> if someone wants to see the modified code from the source tab of the Jira
>>> issue.
>>> 
>>> -Fred
>>> 
>>> -----Message d'origine----- From: harbs@apache.org
>>> Sent: Sunday, April 07, 2013 9:02 AM
>>> To: commits@flex.apache.org
>>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>>> 
>>> Updated Branches:
>>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>> 
>>> 
>>> Added override to set value to ensure it is not set to NaN
>>> 
>>> 
>>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>> 
>>> Branch: refs/heads/develop
>>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>>> Parents: 9ec4d17
>>> Author: Harbs <ha...@in-tools.com>
>>> Authored: Sun Apr 7 09:58:20 2013 +0300
>>> Committer: Harbs <ha...@in-tools.com>
>>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>> 
>>> ----------------------------------------------------------------------
>>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>>> 1 files changed, 11 insertions(+), 0 deletions(-)
>>> ----------------------------------------------------------------------
>>> 
>>> 
>>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> ----------------------------------------------------------------------
>>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> index 36a1982..0848245 100644
>>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>>  /**
>>>   *  @private
>>>   */
>>> +    override public function set value(newValue:Number):void
>>> +    {
>>> +    if(isNaN(newValue))
>>> +    newValue = 0;
>>> +
>>> +    super.value = newValue;
>>> +    }
>>> +
>>> +    /**
>>> +     *  @private
>>> +     */
>>>  override protected function setValue(newValue:Number):void
>>>  {
>>>      super.setValue(newValue);
>>> 
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
I personally do it on the same one, the wiki explains how to run tests, Om 
did the tool called OneClickMustella to simplify your life.

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 12:39 PM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Okay. But I'll have to set up another machine to run Mustella on, and I'll 
probably need some hand-holding on it…

On Apr 7, 2013, at 12:53 PM, Frédéric THOMAS wrote:

> And sorry again but now you are committer, I guess it is your duty to run 
> the Mustella tests to ensure the fix doesn't break them (or eventually 
> you'll need to adapt the tests too).
>
> -Fred
>
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 11:46 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set to NaN
>
> And maybe it can be fixed directly in the Sinner at override public 
> function
> changeValueByStep(increase:Boolean = true):void
>
> -Fred
>
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 11:43 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set
> to NaN
>
> Hi Harbs,
>
> I guess you will have the opportunity to do it again.
>
> What if 0 is out of the Range ?
>
> I guess the right fix is:
>
> if(isNaN(newValue))
>   newValue = minimum;
>
> -Fred
>
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 11:38 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not 
> set
> to NaN
>
> I thought it was automatically prepended because I created a branch for 
> it.
> I see that when I deleted the branch, the JIRA number disappeared. Still
> learning git… ;-)
>
> FWIW, it was FLEX-33288
>
> Harbs
>
> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
>
>> Take the habit to prepend the issue id to your commit message, it is 
>> useful
>> if someone wants to see the modified code from the source tab of the Jira
>> issue.
>>
>> -Fred
>>
>> -----Message d'origine----- From: harbs@apache.org
>> Sent: Sunday, April 07, 2013 9:02 AM
>> To: commits@flex.apache.org
>> Subject: git commit: Added override to set value to ensure it is not set 
>> to NaN
>>
>> Updated Branches:
>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>>
>>
>> Added override to set value to ensure it is not set to NaN
>>
>>
>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>>
>> Branch: refs/heads/develop
>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>> Parents: 9ec4d17
>> Author: Harbs <ha...@in-tools.com>
>> Authored: Sun Apr 7 09:58:20 2013 +0300
>> Committer: Harbs <ha...@in-tools.com>
>> Committed: Sun Apr 7 09:58:20 2013 +0300
>>
>> ----------------------------------------------------------------------
>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>> 1 files changed, 11 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>>
>>
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> ----------------------------------------------------------------------
>> diff --git 
>> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
>> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> index 36a1982..0848245 100644
>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>   /**
>>    *  @private
>>    */
>> +    override public function set value(newValue:Number):void
>> +    {
>> +    if(isNaN(newValue))
>> +    newValue = 0;
>> +
>> +    super.value = newValue;
>> +    }
>> +
>> +    /**
>> +     *  @private
>> +     */
>>   override protected function setValue(newValue:Number):void
>>   {
>>       super.setValue(newValue);
>>
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
Okay. But I'll have to set up another machine to run Mustella on, and I'll probably need some hand-holding on it…

On Apr 7, 2013, at 12:53 PM, Frédéric THOMAS wrote:

> And sorry again but now you are committer, I guess it is your duty to run the Mustella tests to ensure the fix doesn't break them (or eventually you'll need to adapt the tests too).
> 
> -Fred
> 
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 11:46 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set to NaN
> 
> And maybe it can be fixed directly in the Sinner at override public function
> changeValueByStep(increase:Boolean = true):void
> 
> -Fred
> 
> -----Message d'origine----- From: Frédéric THOMAS
> Sent: Sunday, April 07, 2013 11:43 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set
> to NaN
> 
> Hi Harbs,
> 
> I guess you will have the opportunity to do it again.
> 
> What if 0 is out of the Range ?
> 
> I guess the right fix is:
> 
> if(isNaN(newValue))
>   newValue = minimum;
> 
> -Fred
> 
> -----Message d'origine----- From: Harbs
> Sent: Sunday, April 07, 2013 11:38 AM
> To: dev@flex.apache.org
> Subject: Re: git commit: Added override to set value to ensure it is not set
> to NaN
> 
> I thought it was automatically prepended because I created a branch for it.
> I see that when I deleted the branch, the JIRA number disappeared. Still
> learning git… ;-)
> 
> FWIW, it was FLEX-33288
> 
> Harbs
> 
> On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:
> 
>> Take the habit to prepend the issue id to your commit message, it is useful
>> if someone wants to see the modified code from the source tab of the Jira
>> issue.
>> 
>> -Fred
>> 
>> -----Message d'origine----- From: harbs@apache.org
>> Sent: Sunday, April 07, 2013 9:02 AM
>> To: commits@flex.apache.org
>> Subject: git commit: Added override to set value to ensure it is not set to NaN
>> 
>> Updated Branches:
>> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>> 
>> 
>> Added override to set value to ensure it is not set to NaN
>> 
>> 
>> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
>> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
>> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
>> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>> 
>> Branch: refs/heads/develop
>> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
>> Parents: 9ec4d17
>> Author: Harbs <ha...@in-tools.com>
>> Authored: Sun Apr 7 09:58:20 2013 +0300
>> Committer: Harbs <ha...@in-tools.com>
>> Committed: Sun Apr 7 09:58:20 2013 +0300
>> 
>> ----------------------------------------------------------------------
>> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
>> 1 files changed, 11 insertions(+), 0 deletions(-)
>> ----------------------------------------------------------------------
>> 
>> 
>> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> ----------------------------------------------------------------------
>> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> index 36a1982..0848245 100644
>> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
>> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>>   /**
>>    *  @private
>>    */
>> +    override public function set value(newValue:Number):void
>> +    {
>> +    if(isNaN(newValue))
>> +    newValue = 0;
>> +
>> +    super.value = newValue;
>> +    }
>> +
>> +    /**
>> +     *  @private
>> +     */
>>   override protected function setValue(newValue:Number):void
>>   {
>>       super.setValue(newValue);
>> 
> 


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
And sorry again but now you are committer, I guess it is your duty to run 
the Mustella tests to ensure the fix doesn't break them (or eventually 
you'll need to adapt the tests too).

-Fred

-----Message d'origine----- 
From: Frédéric THOMAS
Sent: Sunday, April 07, 2013 11:46 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

And maybe it can be fixed directly in the Sinner at override public function
changeValueByStep(increase:Boolean = true):void

-Fred

-----Message d'origine----- 
From: Frédéric THOMAS
Sent: Sunday, April 07, 2013 11:43 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set
to NaN

Hi Harbs,

I guess you will have the opportunity to do it again.

What if 0 is out of the Range ?

I guess the right fix is:

if(isNaN(newValue))
    newValue = minimum;

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 11:38 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set
to NaN

I thought it was automatically prepended because I created a branch for it.
I see that when I deleted the branch, the JIRA number disappeared. Still
learning git… ;-)

FWIW, it was FLEX-33288

Harbs

On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:

> Take the habit to prepend the issue id to your commit message, it is 
> useful
> if someone wants to see the modified code from the source tab of the Jira
> issue.
>
> -Fred
>
> -----Message d'origine----- From: harbs@apache.org
> Sent: Sunday, April 07, 2013 9:02 AM
> To: commits@flex.apache.org
> Subject: git commit: Added override to set value to ensure it is not set 
> to NaN
>
> Updated Branches:
> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>
>
> Added override to set value to ensure it is not set to NaN
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>
> Branch: refs/heads/develop
> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
> Parents: 9ec4d17
> Author: Harbs <ha...@in-tools.com>
> Authored: Sun Apr 7 09:58:20 2013 +0300
> Committer: Harbs <ha...@in-tools.com>
> Committed: Sun Apr 7 09:58:20 2013 +0300
>
> ----------------------------------------------------------------------
> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
> ----------------------------------------------------------------------
> diff --git 
> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> index 36a1982..0848245 100644
> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>    /**
>     *  @private
>     */
> +    override public function set value(newValue:Number):void
> +    {
> +    if(isNaN(newValue))
> +    newValue = 0;
> +
> +    super.value = newValue;
> +    }
> +
> +    /**
> +     *  @private
> +     */
>    override protected function setValue(newValue:Number):void
>    {
>        super.setValue(newValue);
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
And maybe it can be fixed directly in the Sinner at override public function 
changeValueByStep(increase:Boolean = true):void

-Fred

-----Message d'origine----- 
From: Frédéric THOMAS
Sent: Sunday, April 07, 2013 11:43 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

Hi Harbs,

I guess you will have the opportunity to do it again.

What if 0 is out of the Range ?

I guess the right fix is:

if(isNaN(newValue))
    newValue = minimum;

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 11:38 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set
to NaN

I thought it was automatically prepended because I created a branch for it.
I see that when I deleted the branch, the JIRA number disappeared. Still
learning git… ;-)

FWIW, it was FLEX-33288

Harbs

On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:

> Take the habit to prepend the issue id to your commit message, it is 
> useful
> if someone wants to see the modified code from the source tab of the Jira
> issue.
>
> -Fred
>
> -----Message d'origine----- From: harbs@apache.org
> Sent: Sunday, April 07, 2013 9:02 AM
> To: commits@flex.apache.org
> Subject: git commit: Added override to set value to ensure it is not set 
> to NaN
>
> Updated Branches:
> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>
>
> Added override to set value to ensure it is not set to NaN
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>
> Branch: refs/heads/develop
> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
> Parents: 9ec4d17
> Author: Harbs <ha...@in-tools.com>
> Authored: Sun Apr 7 09:58:20 2013 +0300
> Committer: Harbs <ha...@in-tools.com>
> Committed: Sun Apr 7 09:58:20 2013 +0300
>
> ----------------------------------------------------------------------
> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
> ----------------------------------------------------------------------
> diff --git 
> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> index 36a1982..0848245 100644
> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>    /**
>     *  @private
>     */
> +    override public function set value(newValue:Number):void
> +    {
> +    if(isNaN(newValue))
> +    newValue = 0;
> +
> +    super.value = newValue;
> +    }
> +
> +    /**
> +     *  @private
> +     */
>    override protected function setValue(newValue:Number):void
>    {
>        super.setValue(newValue);
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Frédéric THOMAS <we...@hotmail.com>.
Hi Harbs,

I guess you will have the opportunity to do it again.

What if 0 is out of the Range ?

I guess the right fix is:

if(isNaN(newValue))
    newValue = minimum;

-Fred

-----Message d'origine----- 
From: Harbs
Sent: Sunday, April 07, 2013 11:38 AM
To: dev@flex.apache.org
Subject: Re: git commit: Added override to set value to ensure it is not set 
to NaN

I thought it was automatically prepended because I created a branch for it. 
I see that when I deleted the branch, the JIRA number disappeared. Still 
learning git… ;-)

FWIW, it was FLEX-33288

Harbs

On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:

> Take the habit to prepend the issue id to your commit message, it is 
> useful
> if someone wants to see the modified code from the source tab of the Jira
> issue.
>
> -Fred
>
> -----Message d'origine----- From: harbs@apache.org
> Sent: Sunday, April 07, 2013 9:02 AM
> To: commits@flex.apache.org
> Subject: git commit: Added override to set value to ensure it is not set 
> to NaN
>
> Updated Branches:
> refs/heads/develop 9ec4d1780 -> 53ad8aa03
>
>
> Added override to set value to ensure it is not set to NaN
>
>
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
>
> Branch: refs/heads/develop
> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
> Parents: 9ec4d17
> Author: Harbs <ha...@in-tools.com>
> Authored: Sun Apr 7 09:58:20 2013 +0300
> Committer: Harbs <ha...@in-tools.com>
> Committed: Sun Apr 7 09:58:20 2013 +0300
>
> ----------------------------------------------------------------------
> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
> ----------------------------------------------------------------------
> diff --git 
> a/frameworks/projects/spark/src/spark/components/NumericStepper.as 
> b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> index 36a1982..0848245 100644
> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>    /**
>     *  @private
>     */
> +    override public function set value(newValue:Number):void
> +    {
> +    if(isNaN(newValue))
> +    newValue = 0;
> +
> +    super.value = newValue;
> +    }
> +
> +    /**
> +     *  @private
> +     */
>    override protected function setValue(newValue:Number):void
>    {
>        super.setValue(newValue);
>


Re: git commit: Added override to set value to ensure it is not set to NaN

Posted by Harbs <ha...@gmail.com>.
I thought it was automatically prepended because I created a branch for it. I see that when I deleted the branch, the JIRA number disappeared. Still learning git… ;-)

FWIW, it was FLEX-33288

Harbs

On Apr 7, 2013, at 11:57 AM, Frédéric THOMAS wrote:

> Take the habit to prepend the issue id to your commit message, it is useful
> if someone wants to see the modified code from the source tab of the Jira
> issue.
> 
> -Fred
> 
> -----Message d'origine----- From: harbs@apache.org
> Sent: Sunday, April 07, 2013 9:02 AM
> To: commits@flex.apache.org
> Subject: git commit: Added override to set value to ensure it is not set to NaN
> 
> Updated Branches:
> refs/heads/develop 9ec4d1780 -> 53ad8aa03
> 
> 
> Added override to set value to ensure it is not set to NaN
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
> Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/53ad8aa0
> Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/53ad8aa0
> Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/53ad8aa0
> 
> Branch: refs/heads/develop
> Commit: 53ad8aa037d29e1055ec6b532513fa50df730c81
> Parents: 9ec4d17
> Author: Harbs <ha...@in-tools.com>
> Authored: Sun Apr 7 09:58:20 2013 +0300
> Committer: Harbs <ha...@in-tools.com>
> Committed: Sun Apr 7 09:58:20 2013 +0300
> 
> ----------------------------------------------------------------------
> .../spark/src/spark/components/NumericStepper.as   |   11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/53ad8aa0/frameworks/projects/spark/src/spark/components/NumericStepper.as
> ----------------------------------------------------------------------
> diff --git a/frameworks/projects/spark/src/spark/components/NumericStepper.as b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> index 36a1982..0848245 100644
> --- a/frameworks/projects/spark/src/spark/components/NumericStepper.as
> +++ b/frameworks/projects/spark/src/spark/components/NumericStepper.as
> @@ -740,6 +740,17 @@ public class NumericStepper extends Spinner
>    /**
>     *  @private
>     */
> +    override public function set value(newValue:Number):void
> +    {
> +    if(isNaN(newValue))
> +    newValue = 0;
> +
> +    super.value = newValue;
> +    }
> +
> +    /**
> +     *  @private
> +     */
>    override protected function setValue(newValue:Number):void
>    {
>        super.setValue(newValue);
>