Hi Chris,

You are correct, the check should be done in the checkValue() function.
I think the code remained there back from the days when there was no 
checkValue() function.
I committed a fix now.

I also added the configurable range (0-100% is default).

Cheers,

Tomas

 
On Dec 2, 2011, at 12:10 PM, Pudney Chris (ext) GBJH wrote:

> G'day,
> 
> I noticed that if you enter an invalid value for a PercentParameter an 
> IllegalArgumentException is raised, whereas I'd expect a warning message 
> to be displayed in the GUI as when invalid values are provided for other 
> types of parameter.
> 
> I traced the IllegalArgumentException to this line in 
> PercentParameter.setValueFromComponent()
> 
>         if ((componentValue < 0) || (componentValue > 100))
>             throw new IllegalArgumentException("Invalid percentage value");
> 
> Should this bounds check instead be put into PercentParameter.checkValue()?
> 
> Additionally, should the check be softened such that percentages > 100% 
> are considered valid?
> 
> Or, perhaps 0% .. 100% might be the default range with configurable min 
> and max made possible as with other numeric parameters?
> 
> Please let me know your thoughts - then I'll open an item in the tracker.
> 
> Thanks,
> Chris.
> 
> This message may contain confidential information. If you are not the 
> designated recipient, please notify the sender immediately, and delete the 
> original and any copies. Any use of the message by you is prohibited. 
> 
> 
> 
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure 
> contains a definitive record of customers, application performance, 
> security threats, fraudulent activity, and more. Splunk takes this 
> data and makes sense of it. IT sense. And common sense.
> http://p.sf.net/sfu/splunk-novd2d
> _______________________________________________
> Mzmine-devel mailing list
> Mzmine-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mzmine-devel
> 

===============================================
Tomas Pluskal
G0 Cell Unit, Okinawa Institute of Science and Technology Graduate University
1919-1 Tancha, Onna-son, Okinawa 904-0495, Japan
TEL:  +81-98-966-8684

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Mzmine-devel mailing list
Mzmine-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mzmine-devel

Reply via email to