PR# 11884 Configuration error error

Problem Report Summary
Submitter: saunders
Category: EiffelStudio
Priority: Medium
Date: 2007/01/19
Class: Bug
Severity: Serious
Number: 11884
Release: EiffelStudio 6 (6.0.6.5740 GPL Edition)
Confidential: No
Status: Analyzed
Responsible:
Environment: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; MathPlayer 2.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; InfoPath.1; .NET CLR 3.0.04506.30)
Synopsis: Configuration error error

Description
I added a cluster to my project using the icon in the Clusters window and added a class to this new cluster.  The class I added is named INTEGER_PAIR.  When I tried to compile I got this error message:

-------------------------------------------------------------------------------

Error code: VSCN
Configuration error: cluster has two classes with the same name.
What to do: if both classes are needed, change name of one of them.

Cluster name: root_cluster
First class: INTEGER_PAIR
First file: "c:\documents and settings\chris saunders\my documents\eiffel projects\library\opencv\support\integer_pair.e"
Second class: INTEGER_PAIR
Second file: "c:\documents and settings\chris saunders\my documents\eiffel projects\library\opencv\support\integer_pair.e"

As you can see there is only one file called "integer_pair.e" - I did a search using Windows Explorer to confirm that there is only one such file - there is.
To Reproduce
I haven't used 6.0 very much but believe that I have done similar before without a problem.
Problem Report Interactions
From:saunders    Date:2007/01/23    Status: Analyzed    Download   
Manu wrote: "If your cluster was recursive why did you add a new cluster? I think that I now understand what you wanted to do, you simply wanted a subdirectory which is not yet possible from within the environment."

I was attempting to add a sub-cluster to an existing one, that this is implemented as directories and sub-directories is of no concern to me.  If I use Windows Explorer to add a sub-directory and then recompile EiffelStudio does the right thing.  I wanted to add a sub-cluster because I wanted to add a related set of classes.  So, while I expected that a subdirectory would be created, that is only related to my understanding of how EiffelStudio actually implements this sort of thing.

Still think this is a bug.

From:manus_eiffel    Date:2007/01/23    Status: Closed    Download   
If your cluster was recursive why did you add a new cluster? I think that I now understand what you wanted to do, you simply wanted a subdirectory which is not yet possible from within the environment.

From:saunders    Date:2007/01/23    Status: Analyzed    Download   
I'm responding to this message from Manu:

"I'm not sure what the right thing to do, from our point of view they are 2different clusters with their own classes. Are you suggesting that when youhave 2 different clusters with the same class name, we should ignore theduplication when one is a subcluster of the other? At the moment, we prefer togenerate an error and let the user fix its configuration file as it is easy todo so and by making things more explicit the user can exactly control thebehavior he wants."

I'm not certain that my bug  report has been understood correctly so I'll try again.

I had started a project and used the Project Settings to add a cluster and set that cluster as recursive.  I later added a new cluster using the Cluster tool that appears to the left of the editor.  I then added a class to the new cluster.  I then got a compiler error stating that there were two copies of the newly added class.  There was only one copy but the Cluster tool did not take into account the recursive s
....
Output truncated, Click download to get the full message

From:manus_eiffel    Date:2007/01/23    Status: Closed    Download   
I'm not sure what the right thing to do, from our point of view they are 2 different clusters with their own classes. Are you suggesting that when you have 2 different clusters with the same class name, we should ignore the duplication when one is a subcluster of the other? At the moment, we prefer to generate an error and let the user fix its configuration file as it is easy to do so and by making things more explicit the user can exactly control the behavior he wants.

From:saunders    Date:2007/01/23    Status: Analyzed    Download   
I was sent this message:

"We had discussed this in the past and decided that subcluster is an abstract representation of classes, but in practice it is as if you had 2 clusters. Sowhen you include twice the same cluster, you end up with the same classincluded twice, thus the error."

I still believe that this represents a bug in the tool (the "Clusters" tool).  If I add a cluster then the tool should be aware that recursive has been set for the parent cluster and do the "right" thing in the ecf file.  Note that the tool is clearly doing something that is clearly wrong and should not require that one remembers that recursive has been set and therefore the tool can't cope.

From:manus_eiffel    Date:2007/01/22    Status: Closed    Download   
We had discussed this in the past and decided that subcluster is an abstract representation of classes, but in practice it is as if you had 2 clusters. So when you include twice the same cluster, you end up with the same class included twice, thus the error.

Hope this helps.

From:saunders    Date:2007/01/22    Status: Analyzed    Download   
I'm responding to this from Manu:

"I'm not sure to understand what do you mean by not supporting by the clusterstool. As far as I can tell, the clusters tool will show you subdirectories oncethe project has been compiled once."

In my report I said nothing about "not supporting by the clusterstool" so I don't know how to respond to this, hopefully the following will make my report more clear.

I solved this problem myself but still consider it a bug.  In my project I had recursive set to true for a top level cluster.  I then added a cluster to this top level cluster by pressing on the button that looks like a folder icon in the cluster tool to the left of the edit window.  The cluster tool added a line to the ecf file for this new cluster.  Since the top level cluster was set to recursive EiffelStudio was reporting that it was finding two versions of the file when there was only one.

From:manus_eiffel    Date:2007/01/22    Status: Closed    Download   
I'm not sure to understand what do you mean by not supporting by the clusters tool. As far as I can tell, the clusters tool will show you subdirectories once the project has been compiled once.

From:saunders    Date:2007/01/19    Download   
I examined the ecf file for this project and found that the base folder for the library is: <cluster name="opencv" location="C:\Documents and Settings\Chris Saunders\My Documents\Eiffel Projects\library\OpenCV\" recursive="true">

Later when I added the new subcluster this was added: <cluster name="support" location="c:\documents and settings\chris saunders\my documents\eiffel projects\library\opencv\support\"/>

Apparently the recursive was not taken into account by the Cluster tool.