| Issue 12: | MIDlet.getAppProperty throws exception for missing JAD prop | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Running the August 18 2009 v3.0.0 SNAPSHOT emulator locally on the apps/microemu-demo.jad "java -jar microemulator.jar -Xautotest:http://localhost:8000/microemu-demo.jad with JRE 1.6.0_13 where the JAD is modified to point "MIDlet-Jar-URL: http://localhost:8000/microemu-demo.jar and using a local web server on Mac OSX 10.5 "python -m SimpleHTTPServer" in the apps/ folder the emulator throws: java.lang.IllegalArgumentException: microemu.accessible.host at java.util.jar.Attributes$Name.<init>(Attributes.java:447) at java.util.jar.Attributes.getValue(Attributes.java:99) at org.microemu.util.JadProperties.getProperty(JadProperties.java:118) at org.microemu.util.JadProperties.getProperty(JadProperties.java:127) at org.microemu.app.Common.getAppProperty(Common.java:169) at org.microemu.MIDletBridge.getAppProperty(MIDletBridge.java:127) at javax.microedition.midlet.MIDlet.getAppProperty(MIDlet.java:84) at org.microemu.midp.examples.simpledemo.HTTPPanel.<init>(HTTPPanel.java:65) at org.microemu.midp.examples.simpledemo.SimpleDemoMIDlet.startApp(SimpleDemoM IDlet.java:67) at javax.microedition.midlet.MIDlet$MIDletAccessor.startApp(MIDlet.java:49) at org.microemu.app.Common.startMidlet(Common.java:428) at org.microemu.app.Common.access$200(Common.java:94) at org.microemu.app.Common$1.run(Common.java:301) This exception should not be thrown by getAppProperty. http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/midlet/ MIDlet.html#getAppProperty%28java.lang.String%29 A missing JAD property, in this case "microemu.accessible.host", should result in getAppProperty returning a null String. Further, Sun says a NullPointerException will be thrown by getAppProperty when the parameter passed into the method is null. I believe Sun should have thrown an IllegalArgumentException here. MicroEmulator's getAppProperty should return a null String.
Jan 12, 2010
Fixed for 2.0.4 too
Labels:
Milestone-2.0.4
|
Labels: Milestone-3.0