Open mykmelez opened 9 years ago
The other place where I see a similar error, which I suspect has the same cause, is in Display.getDisplay, on startup, when _DEBUG_PRINT_ALLEXCEPTIONS is enabled:
"java/lang/NullPointerException: object is null
- java/lang/RuntimeException.
(Ljava/lang/String;)V, pc=undefined - java/lang/NullPointerException.
(Ljava/lang/String;)V, pc=undefined - javax/microedition/lcdui/Display.getDisplay(Ljava/lang/Object;)Ljavax/microedition/lcdui/Display;, pc=undefined
- javax/microedition/lcdui/Display.getDisplay(Ljavax/microedition/midlet/MIDlet;)Ljavax/microedition/lcdui/Display;, pc=undefined
- com/sun/midp/lcdui/DisplayEventHandlerFactory.getDisplayEventHandler(Lcom/sun/midp/security/SecurityToken;)Lcom/sun/midp/lcdui/DisplayEventHandler;, pc=undefined
- com/sun/midp/lcdui/LCDUIEnvironment.
(Lcom/sun/midp/security/SecurityToken;Lcom/sun/midp/events/EventQueue;ILcom/sun/midp/lcdui/ForegroundController;)V, pc=undefined - com/sun/midp/main/CldcMIDletSuiteLoader.createSuiteEnvironment()V, pc=undefined
- com/sun/midp/main/MIDletSuiteLoader.createSuiteEnvironment()V, pc=undefined
- com/sun/midp/main/CldcMIDletSuiteLoader.runMIDletSuite()V, pc=undefined
- com/sun/midp/main/MIDletSuiteLoader.main([Ljava/lang/String;)V, pc=undefined
- javax/microedition/lcdui/Display.getDisplay(Ljava/lang/Object;)Ljavax/microedition/lcdui/Display;, pc=9
- javax/microedition/lcdui/Display.getDisplay(Ljavax/microedition/midlet/MIDlet;)Ljavax/microedition/lcdui/Display;, pc=4
- com/sun/midp/lcdui/DisplayEventHandlerFactory.getDisplayEventHandler(Lcom/sun/midp/security/SecurityToken;)Lcom/sun/midp/lcdui/DisplayEventHandler;, pc=19
The NullPointerException in getDisplay is expected: https://github.com/mozilla/j2me.js/blob/6a72486408186172eca0d40bfac15e200a2fdfa3/java/midp/com/sun/midp/lcdui/DisplayEventHandlerFactory.java#L82
Ugh. I suppose it isn't worth a custom just to fix that, although it's distracting. Perhaps the other exception is similarly intentional.
I sometimes see "java.lang.NullPointerException: object is null" in DisplayEventConsumerImpl.handleVirtualKeyboardEvent when using a midlet on device, although I'm unsure exactly what triggers it:
It seems related to text editor fields that cause the virtual keyboard to appear, and it have something to do with tapping the Home button to return to the homescreen while the keyboard is visible.