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 245766 - Renaming full remote project folder is enabled if the folder with the same name already exists
Summary: Renaming full remote project folder is enabled if the folder with the same na...
Status: RESOLVED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: Remote (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-17 18:45 UTC by Vladimir Kvashin
Modified: 2014-09-17 12:13 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
possible fix (60.85 KB, patch)
2014-07-17 22:57 UTC, Vladimir Kvashin
Details | Diff
Correct fix. (329.57 KB, patch)
2014-08-23 12:04 UTC, Vladimir Kvashin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2014-07-17 18:45:54 UTC
Steps to reproduce:
- create a full remote project (project1)
- create a full remote project (project2)
- call Rename from Projects context menu for project1
- enter a new project name (project2) and check "Also Rename Project Folder"
checkbox
Result: Rename button is enabled whereas it should be disabled as the folder
with the same name (project2) already exists. It seems that the functionality
for checking project location is not implemented properly as the "Project
Folder" field shows some local path.
Comment 1 Vladimir Kvashin 2014-07-17 22:52:59 UTC
I'm afraid this can not be solved in common NB projectui module: we need to know whether the project is local or remote - for example, for correct file separators...
Comment 2 Vladimir Kvashin 2014-07-17 22:57:42 UTC
Created attachment 148120 [details]
possible fix
Comment 4 Vladimir Kvashin 2014-07-22 10:17:38 UTC
additional fix:
http://hg.netbeans.org/cnd-main/rev/c7ca734b6e40
Comment 5 Quality Engineering 2014-07-23 02:08:11 UTC
Integrated into 'main-silver', will be available in build *201407230001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6515014065b2
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: Own (borrowed from projectuiapi) implementation for rename, copy, move, delete project operations (fixing #245766 - Renaming full remote project folder is enabled if the folder with the same name already exists)
Comment 6 Alexander Simon 2014-08-21 12:35:21 UTC
see bug #246608
Comment 7 Vladimir Kvashin 2014-08-23 12:04:49 UTC
Created attachment 148853 [details]
Correct fix.

Alexander, please review the fix.
Comment 8 Alexander Simon 2014-08-25 09:59:54 UTC
(In reply to Vladimir Kvashin from comment #7)
> Created attachment 148853 [details]
> Correct fix.
> 
> Alexander, please review the fix.
Vladimir,

The fix has a some minor defects:
1. Your fix replaced DefaultProjectOperations by DefaultProjectOperationsImplementation. The DefaultProjectOperationsImplementation allows to control all steps of the project deleting. So the hack in the class MakeActionProvider.invokeAction:
if (COMMAND_DELETE.equals(command)) {
  try {
    project.setDeleting(true);
    DefaultProjectOperationsImplementation.deleteProject(project);
  } finally {
    project.setDeleting(false);                 
  }
  return;
}
should be removed. The state "project.setDeleting(true)" should be switched on just before actual deleting in the method DefaultProjectOperationsImplementation.deleteProject().execute().
2. What about other places of using DefaultProjectOperations? I see 9 such places in studio.
3. Please cleanup unused imports
Comment 9 Vladimir Kvashin 2014-08-26 14:03:45 UTC
We finally agreed with the reviewer (Alexander Simon) that the fix suites as is.
Comment 10 Vladimir Kvashin 2014-08-26 14:13:35 UTC
fixed in cnd-main:
http://hg.netbeans.org/cnd-main/rev/65e2a64ed4bb

transplanted to release801@enum:
bc04e3d927b4
Comment 11 Quality Engineering 2014-08-27 02:38:24 UTC
Integrated into 'main-silver', will be available in build *201408270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/65e2a64ed4bb
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: re-fixed #245766 - Renaming full remote project folder is enabled if the folder with the same name already exists
Comment 12 Quality Engineering 2014-09-17 12:13:20 UTC
Integrated into 'releases/release801', will be available in build *201409171118* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/b0c77b6e28c5
User: Vladimir Kvashin <vkvashin@netbeans.org>
Log: re-fixed #245766 - Renaming full remote project folder is enabled if the folder with the same name already exists
(transplanted from 65e2a64ed4bbae3b3184693c7c2e066e4dbc0479)