HuaweiTech/eclipse-integration-cloudfoundry — pull request #3 by bluebreezecf (2014-08-21 07:35:22+00:00)
Title: Fix a bug related to the drog-and-drop 

*Existing Bug:
Dragging and dropping a project which has no relation with the cloud application to the applicationViewer will cause the existing cloud application with the same name to be deleted.

*Bug cause:
After the new project dragged and dropped to the applicationViewer, the calling of ApplicationViewersDropAdapter.super.performDrop(data) will cause a new Module instance with the project name be generated in the Server.
Later CloudFoundryServer.updateModules() will be called to refresh the applicationViewr. In this method, server.getModules() will return all the list of existing modules (the new generated module with the name test for example will be the first element), so the loop of 'for (IModule module : server.getModules()) ' will finally make the CloudFoundryApplicationModule with the same name 'test' to be added to 'deletedModules'. The modules in it will be deleted from the server, as well as the related Cloud Application in CF.
The detailed process can be figured out through debugging, but the general process is just like the descriptions shown above.

*Fix comment:
Just like the descriptions above, the existing process is quite complex, so the fix is much easier to make in the original drog-and-drop operation.
So this PR is aimed to check whether there is existing CloudFoundryApplicationModule with the the same name with the drag-and-drop project. If does exist, then show a message dialog to present current project can't be drag to the applicationViewer.