openGeeksLab / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

on new iOS vm String.equalsIgnoreCase(null) throws NullPointerException #1386

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please clearly state whether the issue relates to a device/the simulator or
the tools.
If related to a device be sure to specify exactly which device with as much
details as possible.

The new iOS vm String.equalsIgnoreCase throwsn NullPointerException for null, 
but in pure Java it should just return false.

What steps will reproduce the problem?
1. Run this code:
        try {
            System.out.println("a".equalsIgnoreCase(null));
        } catch (Exception ex) {
            System.out.println("test ex: " + ex);
            ex.printStackTrace();
        }

What is the expected output? What do you see instead?

On CN1 simulator it prints:

false

but on iOS it prints:

test ex: java.lang.NullPointerException: null
java.lang.NullPointerException
    at java_lang_String.equalsIgnoreCase:246
    at userclasses_StateMachine.onMainThirdCommand:313

What version of the product are you using? On what operating system?

The latest buildserver build

Original issue reported on code.google.com by jaanus.h...@gmail.com on 5 Mar 2015 at 12:15

GoogleCodeExporter commented 8 years ago
Thanks, its fixed now.

Original comment by shai.almog on 8 Mar 2015 at 6:56