Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355345

Summary: [IDE][Undo] Protect code in CopyFilesAndFoldersOperation against malformed copy buffer
Product: [Eclipse Project] Platform Reporter: Udo Walker <Udo.Walker>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard: stalebug
Attachments:
Description Flags
Error dialog: Copy Problems, Internal error: 0 none

Description Udo Walker CLA 2011-08-22 03:44:03 EDT
Build Identifier: 20110218-0911

When I copy a Java file in a Netbeans Java project (with CTRL+C) and then goto a Java project in Eclipse I get an error. See the attached screen shot.

Reproducible: Always

Steps to Reproduce:
1.Copy Java file in Netbeans 7
2.Paste in Java project in Eclipse
3.Error dialog is shown
Comment 1 Udo Walker CLA 2011-08-22 03:45:14 EDT
Created attachment 201896 [details]
Error dialog: Copy Problems, Internal error: 0
Comment 2 Dani Megert CLA 2011-08-22 03:54:26 EDT
Where exactly to you paste it, and what is selected in the target?
Is there anything in the .log (see Error Log view)?
What happens if you paste in the Windows Explorer?
Comment 3 Udo Walker CLA 2011-08-22 04:03:18 EDT
I get this log entry:


!ENTRY org.eclipse.ui.ide 4 4 2011-08-22 10:01:36.530
!MESSAGE Exception in org.eclipse.ui.actions.CopyFilesAndFoldersOperation.performCopy(): java.lang.ArrayIndexOutOfBoundsException: 0


I selected a Java package in my Java project in Eclipse and used the popup menu "Paste" to paste the file. In Netbeans I selected the Java file and used the popup menu "Copy" to copy the file into the clipboard.
Comment 4 Udo Walker CLA 2011-08-22 04:04:55 EDT
Nothing happens in the Windows Explorer. Maybe the file is not copied to the global clipboard?
Comment 5 Dani Megert CLA 2011-08-22 04:19:00 EDT
> Nothing happens in the Windows Explorer. Maybe the file is not copied to the
> global clipboard?
Right. I suspect that Netbeans copies the file incorrectly or only adds some internal information into the clipboard. Netbeans should fix this. On the Eclipse side we should be more graceful in such situations (e.g. protect stores[0] on line 1412) and also improve the logging (e.g. log stack trace) in CopyFilesAndFoldersOperation.display(InvocationTargetException).
Comment 6 Lars Vogel CLA 2019-11-14 03:51:22 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

If the bug is still relevant, please remove the "stalebug" whiteboard tag.