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.
When refactoring an import statement, the new "refactored" line is inserted into the middle of the old line without deleting the old line, resulting in a completely useless/nonsensical import statement. for example, lets say I have a line: "import com.test.hello.Greeting;" Now lets say I changed the package of the "Greeting" class to be in "com.test.hello.sir". This sounds contrived, but it happens (for example I am working with generated code and changed the packages I generate it to). So in netbeans it will highlight the bad import statement and offer to change it to the correct import statement (the suggestion in the context menu appears correct). However when I click to have it do this, it puts the new package name in the middle of the old one for some reason. So the result is: "import com.test.hello.sir.Greeting.test.hello.Greeting;" The old import statement piece that is tacked on at the end will consistently contain everything except the beginning package in the statement, regardless of carat position at the time of refactoring.
Already reported as bug #200742, thanks for the report anyway. *** This bug has been marked as a duplicate of bug 200742 ***