This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Product Version: NetBeans IDE Dev (Build 200807300201) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13 System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb) To reproduce: - create Mobile Application without HelloMIDlet; - create SVG image and Visual MIDlet in default package; - add SVG Form to the MIDlet; - attach SVG Image to the SVG Form; - bind Started to SVG Form; - create 'abc' package in the project; - select both Image and MIDlet, 'Cut' them and perform 'Paste->Refactor Move' to 'abc'; - run the project, launch the MIDlet in emulator. Emulator throws exception as it can't find SVG Image. ... startApp threw an Exception java.lang.NullPointerException java.lang.NullPointerException at com.sun.perseus.model.SVGImageImpl.createImage(SVGImageImpl.java:467) at javax.microedition.m2g.SVGImage.createImage(SVGImage.java:221) at abc.VisualMIDlet.getSvgImage(VisualMIDlet.java:113) at abc.VisualMIDlet.getSvgForm(VisualMIDlet.java:96) at abc.VisualMIDlet.startMIDlet(VisualMIDlet.java:54) at abc.VisualMIDlet.startApp(VisualMIDlet.java:149) at javax.microedition.midlet.MIDletProxy.startApp(MIDletProxy.java:43) at com.sun.midp.midlet.Scheduler.schedule(Scheduler.java:374) at com.sun.midp.main.Main.runLocalClass(Main.java:466) at com.sun.midp.main.Main.main(Main.java:120) Refactoring is not supported for SVG Image file in a MIDP Project.
It is reproducable every time or only with some particular SVG File, it could also mean that SVG file is broken and perseus cant create image.
It doesn't depend on content of SVG file.
The problem is that after refactoring, the generated method below still tries to find the file in hello package. Changing hello to abc fixes the problem. public SVGImage getSvgImage() { if (svgImage == null) { // write pre-init user code here try { svgImage = (SVGImage) SVGImage.createImage(getClass().getResourceAsStream("/hello/newImage.svg"), null); } catch (java.io.IOException e) { e.printStackTrace(); } // write post-init user code here } return svgImage; }
Yes I have to agree this type of refactoring it is not well supported. Unfortunately to cove all cases of refactoring with images, fonts, svg files etc. would be extremely time consuming so I think we are not going to support it unless somebody will dedicate a lot of time to implement proper refactoring and cover all possible scenarios. I'm marking this as enhancement.
Tested with a maven project and a HTML5 project, would call CTRL + R to refactor a tag but nothing happens :(. Thought it will be handled as a XML file. Voted for this. I'm using NB 8.0 Nightly 20140804. Regards Chris