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.

Bug 154143 - renaming a package confuses netbeans, leaves all the tedious work for the programmer to do
Summary: renaming a package confuses netbeans, leaves all the tedious work for the pro...
Status: NEW
Alias: None
Product: contrib
Classification: Unclassified
Component: Scala (show other bugs)
Version: 6.x
Hardware: PC Linux
: P4 blocker (vote)
Assignee: _ dcaoyuan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-29 16:06 UTC by fhars
Modified: 2008-11-29 16:06 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fhars 2008-11-29 16:06:47 UTC
If i use Refactor > Rename... on a package in a scala project, netbeans renames the package and the folder, but I still
have to change all the package declarations in the source files and the class names in the run configurations by hand.
In addition, it may add red exclamation marks to the package and project, complaining that the package contains files
with errors. This doesn't happen every time I rename a package (it takes three or four consecutive renames to trigger
that behaviour), but if it happens the exclamation mark wont go away if I select "Clean and Build" or close and reopen
the project (after fixing all package names, of course, so that the project contains just one error-free file).

Steps to reproduce:
1. Add a new scala project named Foo, this gives you a Main object in package foo
2. Add the line "class Baz {}" to Main.scala (this seems to be essential)
3. Rename the package to bar. Main.scala will still contain the line "package foo", red marks appear (correctly)
4. Rename the package back to foo. Red marks stay (erroneously)
5. Clean and Build the project. Red marks stay (erroneously)
6. Delete the project, also delete sources.
7. Just to be sure: Exit netbeans, rm -r ~/NetBeansProjects/Foo/ (why is that still there?)
8. Start netbeans
9. Add a new scala project named Foo. The red marks are still there.
10. ...
11. Huh?

There is a suspicious file still left: 
.netbeans/6.5/var/cache/index/0.11/s104/classes/foo/Baz.class

If I rm -r .netbeans/6.5/var/cache/index the red marks go away