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 40108 - Exception occurs when pasting class to the package
Summary: Exception occurs when pasting class to the package
Status: RESOLVED INVALID
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2004-02-14 17:14 UTC by Jiri Mzourek
Modified: 2007-09-26 09:14 UTC (History)
1 user (show)

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 Jiri Mzourek 2004-02-14 17:14:11 UTC
Steps to reproduce:
  - create a package;
  - create java class in the package;
  - select java class node and expand it;
  - select child node;
  - select copy from context menu;
  - select package node and paste class there;
  - an exception occurs:
Annotation: File Class.java already exists in E:\b_10.
java.io.SyncFailedException: File Class.java
already exists in E:\b_10.
        at
org.openide.filesystems.LocalFileSystem.createData(LocalFileSystem.java:211)
        at
org.openide.filesystems.LocalFileSystem$Impl.createData(LocalFileSystem.java:458)
        at
org.openide.filesystems.AbstractFileObject.createData(AbstractFileObject.java:388)
        at
org.openide.src.nodes.SourceEditSupport.createJavaFile(SourceEditSupport.java:397)
        at
org.openide.src.nodes.SourceEditSupport$PackagePaste$Type.paste(SourceEditSupport.java:495)
        at
org.openide.actions.PasteAction.executePasteType(PasteAction.java:183)
        at
org.openide.actions.PasteAction.access$100(PasteAction.java:60)
        at
org.openide.actions.PasteAction$ActionPT.actionPerformed(PasteAction.java:777)
        at
org.netbeans.core.ModuleActions$1.run(ModuleActions.java:97)
        at org.openide.util.Task.run(Task.java:136)
        at
org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:328)
[catch] at
org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:670)
Comment 1 Jiri Mzourek 2004-02-15 16:30:27 UTC
Since this bug is there for a long time and has been discovered just
recently, I would consider this use case as an edge case. 
I would propose this "correct" behavior, if possible: I would keep it
consistent with the behavior on files level -- automatically add
numbered suffix (like _1, _2, etc.). 
Comment 2 Jan Pokorsky 2004-03-03 15:28:10 UTC
Yeah, there is a typo in SourceEditSupport.createJavaFile. The new
name is generated but the original one is used in spite of that.

If you like to see this fixed in nb 3.6 raise the priority to P2.
Otherwise it will be fixed in the next release.
Comment 3 Jan Becicka 2004-07-13 15:45:57 UTC
Cannot reproduce in promo-D