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

Bug 105333

Summary: [dnd][reorg] moving source files excluded from build path [refactoring]
Product: [Eclipse Project] JDT Reporter: Tibor Sulyán <sulyan.tibor>
Component: UIAssignee: JDT-UI-Inbox <jdt-ui-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: dirk_baeumer
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard: stalebug

Description Tibor Sulyán CLA 2005-07-27 11:59:03 EDT
Steps to reproduce:

1. create class A in package 'a'
2. exclude A.java from build path
3. drag A.java to package 'b' -> bug: A.java is re-included into build path

(4. drag A.java back to package 'a' -> Exception is thrown because A.java is not
on its project's build path
 5. click Undo or Abort on the Refactoring error dialog (Details shows nothing)
-> A.java is returned to package 'a' and excluded again from build path.)
Comment 1 Dirk Baeumer CLA 2005-08-02 06:04:29 EDT
Tobias,

what API are we using to move the CU. If this is core API then I would agrue
that core keeps the two data structures in sync. If we use native resource API
we have to do it.

Can you please investigate the failure when moving the file back ?
Comment 2 Tobias Widmer CLA 2005-08-10 06:34:53 EDT
Since the compilation unit to be moved is not on the build path (in package 
a), the reorg policy uses a MoveResourceChange to move the compilation unit to 
the other package. The policy factory receives an IFile from 
DelegatingDropAdapter. This explains why it reappears on the build path after 
the move.

The failure when moving the file back to package a is actually due to 
MoveResourceElementsOperation which tries to acquire a document for the cu 
A.java in package a to store the moved back content.

If the build path status is correctly set on moves (eg. exclude A.java in both 
packages from the build path, the core API works as exspected for both moves)

We should therefore fix d'n'd to return a compilation unit even if the cu is 
not on the build path.
Comment 3 Eclipse Genie CLA 2019-09-30 17:07:41 EDT
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.

--
The automated Eclipse Genie.