Issue 11986 - cannot rename or edit java file in Netbeans
Summary: cannot rename or edit java file in Netbeans
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 644
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: tomaisoc
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-03 11:47 UTC by robert.kinsella
Modified: 2003-06-16 18:44 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description robert.kinsella 2003-03-03 11:47:43 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.
Comment 1 Unknown 2003-03-03 11:52:53 UTC
Assign to Tom to investigate and see if we can support the rename.
Comment 2 tomaisoc 2003-03-04 12:56:19 UTC
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.
Comment 3 tomaisoc 2003-03-04 17:44:07 UTC
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.
Comment 4 robert.kinsella 2003-03-10 13:11:13 UTC
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.
Comment 5 tomaisoc 2003-03-18 16:31:30 UTC
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.
Comment 6 robert.kinsella 2003-06-16 17:52:02 UTC
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.
Comment 7 robert.kinsella 2003-06-16 17:56:33 UTC
changing summary description
Comment 8 tomaisoc 2003-06-16 18:34:46 UTC
Should keep the FileLock returned by FileObject.lock() before
and call releaseLock on it after the package declaration has been
removed from the file. 
Comment 9 robert.kinsella 2003-06-16 18:44:33 UTC
issue has been verified as fixed on Sol9 u4 with respin of ed-0.3 rc5.
closing issue as verified fixed.