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 61318 - project.properties not updated when project deleted
Summary: project.properties not updated when project deleted
Status: VERIFIED FIXED
Alias: None
Product: apisupport
Classification: Unclassified
Component: Project (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Martin Krauskopf
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-22 23:45 UTC by rrochat
Modified: 2005-10-21 11:33 UTC (History)
0 users

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 rrochat 2005-07-22 23:45:46 UTC
NetBeans IDE Dev (Build 200507181000)

Steps to reproduce:
- select project inside a Module Suite Project
- right click "delete"

The project will be deleted from the IDE and disk, but 
the suite's project.properties must be edited manually
to remove the project name.
Comment 1 rrochat 2005-07-23 02:43:30 UTC
I *thought* the project was deleted, but it later re-appeared in the project list.
Don't know why the zombie was revived.
Comment 2 Martin Krauskopf 2005-07-23 04:16:10 UTC
So how did you actaully delete a submodule from a suite? You delete it from
inside of IDE, i.e. from "Files" explorer? Since the Delete project action,
callable from module's popup menu in Projects panel, is not supported yet.
Or did you delete the submodule in an OS's file explorer and than go back to the
IDE.
Anyway currently supported scenario is to go to a suite's properties -->
Libraries panel -> Remove submodule from modules list.
Comment 3 rrochat 2005-07-23 04:42:47 UTC
I selected the project node under the suite node in the IDE's Projects panel.
Sorry to bother you with this if it's not supported yet; 
Where would I find a list of what is supported and what is not? 
Comment 4 Martin Krauskopf 2005-07-23 07:45:20 UTC
I see. Sorry, I forgot that there is no logical view for suite project type
(will be). Anyway for me it throws exception. All such cases must be handled
until 4.2.
Comment 5 rrochat 2005-08-01 18:38:35 UTC
I tried to remove a new module with your 
"suite's properties -->
Libraries panel -> Remove submodule from modules list."
and it did indeed remove the project name from the 
project.properties, but it also removed the colons
that separated the module names, which made further
work impossible until I manually restored the colons:
modules=\
    ${project.chimera}\
    ${project.branding}\
...
It should be:
modules=\
    ${project.chimera}:\
    ${project.branding}:\
Comment 6 Jesse Glick 2005-08-01 19:20:19 UTC
SuiteUtils.removeSubModule seems to have some problems.

1. As rrochat found,

projectProps.setProperty(MODULES_PROPERTY, (String[]) pieces.toArray(newPieces));

is not correct because it needs to append ':' to all but the last piece.

2. This:

if (module.matches(ANT_PROPERTY_REGEXP)) {
    String key = module.substring(2, module.length() - 1);
    String value = projectProps.getProperty(key);

is not correct. What about

  modules=${moddir}/one:${moddir}/two

which is a valid module list? And you should not use projectProps and
privateProps in this way. (Consider that ${moddir} could be defined in either
one, even with the above line in project.properties!) Use the PropertyEvaluator
from the SuiteProject properly: with evaluate(String text), which will also
handle the case that there are no property substs.

3. new File(module) is not correct. Use AntPropertyHelper.resolveFile(module)
instead, so the basedir is set correctly.

I think all three problems should be unit-testable.
Comment 7 Martin Krauskopf 2005-09-01 05:28:44 UTC
Actually the first (and main) problem was fixed and tested (issue 63307). I'll
write tests for 2) and 3) and probably clean and rewrite SuiteUtils to
non-static methods (and may be rename it). Current code is not easily managed. I
didn't know everything I should when I wrote it first time.
Comment 8 Martin Krauskopf 2005-09-01 16:41:26 UTC
Fixed, test, enhanced :) Thanks for tips.

Checking in ui/customizer/SuiteUtils.java; 1.6 --> 1.7
Checking in ui/customizer/SuiteProperties.java; 1.10 --> 1.11
Checking in test/project/ui/customizer/SuitePropertiesTest.java; 1.9 --> 1.10
Comment 9 pzajac 2005-10-21 11:33:09 UTC
verified