Hi Michaël,

Thanks for your answer and your correction (sorry for the line number, I
checked it a little bit too fast).

There are two problems with the null values and the NPE:
- if some values of an attribute are null, and click the OK button, then a
NPE appears,
- if the layer doesn't contain any attributes and click the OK button, then
a NPE appears.

In the first case, you proposed three different options. What do you think
about the option to add a check box
or a combo box to ask users how they want to consider null values, either
"ignore it" or "interpret as 0"?
Therefore, users could have the choice and they could know how all values,
even the null ones, are processed.

In the second case, OJ developers don't have the possibility to disable the
OK button. Sometimes it could be
useful. There is also another possibility: to improve the LayerManager by
adding a new getter which allows to
get only the layers with at least one attribute (except the FID one). We can
also imagine to have these two possibilities.

I don't know what the best option is. What do you think about it?

Cheers,
Eric

2010/11/2 Michaël Michaud <michael.mich...@free.fr>

>  Hi Eric,
>
> Thanks for the bug report.
> It's fixed and will be available in the next NB
> (acually, the bug was in the Layer ComboBox listener, near line 235)
>
> As it seems that you are using statistic plugins, I submit to you and
> others a question about how to handle null values in this plugin.
> Currently, it throws NPE :-( .
> Different options are :
> - interpret null values as 0 for integers or 0.0 for double (not so good
> but easy)
> - catch the exception (or check for null/NaN values before) and throw a
> better message than NPE
> - do the statistics ignoring every feature having a null value
>
> Michaël
>
> Le 02/11/2010 19:41, Eric Grosso a écrit :
>
> Hi all,
>
> I found a very little bug to correct in the ClassifyAttributes Plugin:
> org.openjump.core.ui.plugin.tools.statistics.ClassifyAttributesPlugin
>
> If we select a layer without any attributes, the GUI dialog doesn't allow
> to select an attribute:
> it is logical. But after that, if we select another layer which contains
> some attributes, the attribute
> selection is still disabled.
>
> To correct this bug, the line 218:
> if (listNumAttributes.size() == 0) jcb_attribute.setEnabled(false);
>
> should be replaced with:
>
> if (listNumAttributes.size() == 0) {
>              jcb_attribute.setEnabled(false);
> } else {
>              jcb_attribute.setEnabled(true);
> }
>
> Moreover, as it is allowed to click on the OK button even if there is no
> attribute to deal with.
> Indeed, it is impossible to disable this button due to the fact that the
> OKCancelPanel is not
> "gettable" from a MultiInputDialog. Therefore, an information or error
> message should be
> provided to users to ask them to choose/process a layer which contains at
> least one attribute
> (test in the run method ). If not, it provides a message error with a "null
> exception" error.
>
> Cheers,
> Eric
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
> http://p.sf.net/sfu/nokia-dev2dev
>
>
> _______________________________________________
> Jump-pilot-devel mailing 
> listjump-pilot-de...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Nokia and AT&T present the 2010 Calling All Innovators-North America
> contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in
> marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>
>
------------------------------------------------------------------------------
Achieve Improved Network Security with IP and DNS Reputation.
Defend against bad network traffic, including botnets, malware, 
phishing sites, and compromised hosts - saving your company time, 
money, and embarrassment.   Learn More! 
http://p.sf.net/sfu/hpdev2dev-nov
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to