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.
This issue existed also in v6.5 as well in latest 6.5.1 In "Desing View" while editing a swing form, whenever I rename a variable e.g. a JButton jButton1 to myButton, the ide automatically reformats any hibernate *.hbm.xml file wherever they exist in my project. All spaces, tabs are gone in the xml files, as well the order of tag properties changes. Needless to say this is really annoying. Luckily I use subversion and I find myself all day "reverting" all *.hbm.xml files.
please note that in nb 6.0 there was no such problem.
GUI builder has no reason to touch hibernate files. When renaming a variable, a rename refactoring is invoked (and all files saved). Maybe the hibernate support is somewhat hooked into that. Should be evaluated by hibernate plugin owners.
ok, I tried next with latest nb, most likely should be the same in 6.7/ create web application with hibernate framework create packag add jpanel form add a button rename button name in navigator hibernate.cfg.xml stay unaffected. if the issue is reproducible, please provide more steps starting from project creation, and may be attach sample project.
I cannot say if this issue exists in nb 6.7 as we only use 6.5.1 for active development. Try to create a simple SWING app (not a web application) and a couple of db tables in different *.hbm.xml files, e.g. customer.hbm.xml, order.hbm.xml, etc. Create a simple panel with a couple of buttons/labels and save it. Format by hand the *.hbm.xml files to make them pleasing to your eyes, save. Try to rename a button in "Desing View" from e.g. jButton1 to myButton. All *.hbm.xml are reformatted!
thanks, will reevaluate with new information
tried ith 6.7 and I'm not able to reproduce the issue. if it's possible to save project open, rename button and god reformat it may be good to attach sucnh project. may be the issue is fixed in 6.7+. or some important steps are still missed. may be it was refactoring issue in 6.5. can you try 6.7?
I tried upgrading to 6.7.1 and it seems the problem is no more! Please feel free to close this one!
thanks, resolved as working
I am sorry to say that after last weeks Netbean update, this has happened AGAIN! I did a refactor/rename on a JInternalFrame and all my hibernate xml files were altered as well! Product Version: NetBeans IDE 6.9.1 (Build 201011082200) Java: 1.6.0_22; Java HotSpot(TM) Client VM 17.1-b03 System: Windows XP version 5.1 running on x86; Cp1253; el_GR (nb)
Is it always reproducible? Can you attach message.log? I'm not sure but there may be some information
Created attachment 103228 [details] NetBeans project file
Comment on attachment 103228 [details] NetBeans project file We are lucky this time. It happens always. Check the attachment project.
ok, tried to refactor (rename) frame class and it removes empty lines, some newlines etc, it's good I can revert from local history, you can do the same instead of svn. Can be considered as "nice" undocumented feature for free space optimization but anyway it's an issue.
org.netbeans.modules.hibernate.refactoring.JavaClassRenameTransaction::doChanges rewrite files for no visible reasons. Not sure yet how fast it can be fixed, but it's starting point for later investigation.
When i was just a young and new software engineer, i remember senior teammates to call this behavior as application's "hidden features" instead of "bugs" ;) Anyway, it's good we managed to verify this, even after more than 1.5 years and almost 6 netbean's releases! Right now, i can easily revert using SVN. But you have to wonder to what other file types this happens as well. We only use hibernate xml files, but i guess this happens for other xml files too.
*** Bug 174044 has been marked as a duplicate of this bug. ***
http://hg.netbeans.org/web-main/rev/4c814d32a513 should rewrite only if there are any changes now
I guess this didn't make it into 7.0, because I'm still seeing *.hbm.xml files being reformatted when I rename a class. I wouldn't mind so much if it reformatted them using the rules I have defined under Tools > Options > Editor > Formatting.
yes. should go to 7.0.1, even if reformat is not so bad itself anyway fix should speed up refactoring as unnecessary file rewrite is skipped.