Apache OpenOffice (AOO) Bugzilla – Issue 11986
cannot rename or edit java file in Netbeans
Last modified: 2003-06-16 18:44:33 UTC
SFrameworkINstall.jar.27.02.2003, Solaris and windows Netbeans3.4. Start NetBeans, mount an examples directory. Right click on the examples directory and select New, Office Scripting, Parcel Recipe. Enter the parcel's name e.g. java1, select language java, select finish. In the netbeans explorer window a java1 parcel is created with a script named 'empty'. RIght click on the empty script and select rename, rename the script to java2.Select ok BUG --> the script does not get renamed. If the user selects to rename the script again, the entry in the rename dialog when launched is java2. Selecting ok on the rename dialog second time around generally renames the script successfully. A simple workaround for this bug is to rename the public class in the actual 'empty' file from 'empty' to java2 and select save.
Assign to Tom to investigate and see if we can support the rename.
This problem seems to be occuring because of the code that removes the package declaration from the java source file when creating the parcel. If I comment out that code then the rename works every time. I am guessing that the package removal code causes the node for the java file to become out of sync with the actual file thus causing this problem. This is why it works when you change the class declaration inside of the file then save it. After this the rename will work fine also, it is only after the parcel is initially created that the rename does not work properly. I will investigate further how to ensure that the node is in sync after the removal of the package declaration, but we may have to release note this for the next release.
This is fixed by calling rename on the FileObject after removing the package declaration, this forces the JavaNode to be in sync with the underlying file.
On Solaris, when user attempts to rename a java source file which is not opened in the editor, it fails reporting that it cannot be renamed. Once the user opens the document (or any other java source document) it can be renamed, setting to a lower priority.
This bug is only reproducible on Solaris 9. Adding the requires_documentation flag. I have added a release note for this issue and am marking it as resolved later.
SFrameworkInstall, OO.org and So ed0.3 rc5. Solaris 9 update4. After creating a new parcel recipe, java - the user cannot edit OR rename the resulting Empty.java file. The error has been reproduced with both the OO.org and SO office.jar files. Reopening bug and setting to a higher priority, the only real workaround to this problem is to use the command line interface. This error cannot be reproduced on windows.
changing summary description
Should keep the FileLock returned by FileObject.lock() before and call releaseLock on it after the package declaration has been removed from the file.
issue has been verified as fixed on Sol9 u4 with respin of ed-0.3 rc5. closing issue as verified fixed.