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 7.4 (Build 201310111528) Operating System = Linux version 3.2.0-38-generic running on amd64 Java; VM; Vendor = 1.7.0_45 Runtime = Java HotSpot(TM) 64-Bit Server VM 24.45-b08 Hi, I am Luigi Usai, from Verona University, Italy. Procedure for recreating the bug: 1) I have a project, let's suppose Mediathek View https://sourceforge.net/projects/zdfmediathk/?source=navbar 2) I want to refactor the projct calling it MultimediaOnline instead of Mediathek 3) While refactoring the project, Netbeans 7.4 create a new directory and moves the .java files inside, but not the other subdirectories. 4) this way, the project stops compiling, signalling there are missing res files (from the /res/ directory, which still is on the previous place) Copying 1 file to /home/studente/src/MultimediaOnline/build/classes compile: run: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:205) at mediathekview.MediathekGui.initComponents(MediathekGui.java:1231) at mediathekview.MediathekGui.<init>(MediathekGui.java:211) at mediathekview.Main$1.run(Main.java:94) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) BUILD SUCCESSFUL (total time: 2 seconds)
Created attachment 142946 [details] IDE log
Sorry but I cannot reproduce the wrong behavior with the sources downloaded from source forge. Can you provide your project?
Hi. Yes, I can provide 2 things: 1) my sources: at this page: https://sourceforge.net/projects/learngermanwithmovies/files/latest/download the version 0.0.0.3.zip. 2) the screenshot of the bug: http://sourceforge.net/projects/learngermanwithmovies/files/screenshotOfTheBug.zip/download Let me know if you need more specifications about it. Best regards Luigi
Created attachment 143070 [details] Screenshots of the bug I add you the screenshots of how to replicate the bug.
Thanks, I can see the problem now Summary: When renaming package "mediathek" all references to resources in package "mediathek.res" generated by from editor are also changed although the subpackage was not renamed e.g.: getClass().getResource("/mediathek/res/film_rec_16.png") is changed to getClass().getResource("/mediathekRenamed/res/film_rec_16.png")
Maybe I do not understand it, but it seems to me the reporter actually wants to rename the whole tree, complaining that NB creates a new directory "and moves the .java files inside, but not the other subdirectories". In this sense the GUI builder renamed the resources well (as what was expected), the problem is that the rest of refactoring did not rename everything. Can you advise how to do the whole dir rename?
Tomas Pavek, you are right. Let's suppose I have: com.mathemathics.geometry.cirle; com.mathemathics.geometry.square; the node "geometry" is a directory containing java classes. If NB renames only one package, software stops compiling. This behaviour is an error. IMHO, NB should rename each node "geometry". Thank you.
In java there is no notion of subpackages. Renaming a folder is done through the files view.
I'm sorry if I must reopen this bug. I'm going to explain why. Source of information is this book: Ken Arnold, James Gosling, David Holmes, The Java Programming Language, Fourth Edition, Addison-Wesley Professional, 2005, ISBN 0-321-34980-6; James ... James Gosling invented Java, so I think you'll trust him. ;) In the Italian third edition of this book, chapter 20.9, they teach the Java Subpackages. Please I ask you to reconsider this bug for the sake of Netbeans.
If this can be useful, you can look here for detailed info: https://www.google.it/search?tbm=bks&hl=it&q=java+manuale+ufficiale+subpackage#hl=it&q=java+subpackage&tbm=bks I searched over the internet for your sentence: "in java there's no notion of subpackage" I got about 473.000 results (0,59 seconds) It's very sad, because it means that online there's lot of people talking without knowledge. Sometimes internet is not trustable, unless you do a deeper search. Thank you all, programmers.
(In reply to luigiusai from comment #9) > I'm sorry if I must reopen this bug. I'm going to explain why. You are right. We can add an option to rename subpackages when renaming a package.
Tested on NetBeans IDE 8.0.2 Windows 8 version, 64 bit the problem still exists in the last Netbeans version. Let's make a simple example: create a new project with the Netbeans from samples: Samples --> JavaFX --> BrickBreaker Now refactor the main program name refactor BrickBreaker --> newProgramName; this command should rename both the main program AND all the subpackages. This first bug generate a second bug: if you try to restore the original name, Netbeans says "The package already exists" and user get stuck. There are two bugs in one. More info and screenshots here: https://plus.google.com/+LuigiUsai/posts/CvsAoDg1fHh Best regards and thank you all for your efforts to build a better tool. Luigi, Verona www.luigiusai.it