| Issue 95: | Validation on numeric textfields stops long numbers being allowed | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Set up a textfield that can handle 10 numbers 2. Try to enter ten 9s, thats 999999999 3. Observe how it will only allow 9 and not 10 What is the expected output? What do you see instead? Expected output is that the textfield will allow ten number 9 digits and not only 9. What version of the product are you using? On what operating system? Microemu revision 2450 on Win7 Please provide any additional information below. The fix is very simple, in: org.microemu.device.InputMethod.java in the method validate() around line 110 swap Integer.parseInt(text); for Long.parseLong(text); this allows large numbers to parse and retains functionality. fixed code is: case TextField.NUMERIC : if (text != null && text.length() > 0 && !text.equals("-")) { try { //Integer.parseInt(text); Long.parseLong(text);// parse a long since nfe can be thrown with some ints! } catch (NumberFormatException e) { return false; } } break;
Jan 25, 2011
(No comment was entered for this change.)
Status:
Fixed
|
Labels: Milestone-3.0