eclipse / nebula

Nebula Project
https://eclipse.org/nebula
Eclipse Public License 2.0
84 stars 98 forks source link

PWIntegerText exception when delete content #521

Closed vicenrico closed 10 months ago

vicenrico commented 1 year ago

If I movie to a PWIntegerText control, delete the content and because there is an empty string, it raises an exception. Exception in thread "main" java.lang.NumberFormatException: For input string: ""

wimjongman commented 1 year ago

Dude, read this bug report and tell us how we should help you with this information.

vicenrico commented 1 year ago

Dude, read this bug report and tell us how we should help you with this information.

Well I mean. Pwintegertext control doesn't check for empty strings and when it occurs, it raises an exception. Could you fix it? Thx

jantje commented 1 year ago

IMHO an empty string is not a valid integer text so an exception seems what should happen.

vicenrico commented 1 year ago

IMHO an empty string is not a valid integer text so an exception seems what should happen.

Well, I don't think so, because I entered number 10. I realized the mistake and wanted to enter another number. In order to do that, I deleted the previous value 10, so I got an exception. How do I correct a mistake if I'm not able to delete the previous value?. Maybe would be good do the checking in a focusOut listener?

wimjongman commented 11 months ago

@vicenrico I see. Thanks for reporting. Can you supply a patch? I guess the empty string should be 0.