Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320659 - [TS Explorer] Creating an artifact with the same name as an inner package confuses TS Explorer
Summary: [TS Explorer] Creating an artifact with the same name as an inner package con...
Status: VERIFIED FIXED
Alias: None
Product: Tigerstripe
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 0.5M0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-22 15:28 EDT by Navid Mehregani CLA
Modified: 2011-01-17 09:44 EST (History)
2 users (show)

See Also:


Attachments
Screenshot (19.20 KB, image/png)
2010-07-22 15:29 EDT, Navid Mehregani CLA
no flags Details
320659 patch (3.28 KB, patch)
2011-01-12 07:53 EST, Anton Salnik CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Navid Mehregani CLA 2010-07-22 15:28:59 EDT
Build Identifier: 

Follow the instructions below to reproduce this issue:

- Create a new TS Project
- Create a package called com.mycompany.foo
- Create a new Entity under com.mycompany called 'foo'

This will cause the icon for the 'foo' package to change to an Entity package (see attached screenshot).  You can still drag and drop the Entity into foo package, but the icon changes to a package icon used in the Package Explorer!!

Reproducible: Always
Comment 1 Navid Mehregani CLA 2010-07-22 15:29:37 EDT
Created attachment 175014 [details]
Screenshot
Comment 2 Anton Salnik CLA 2010-12-30 04:09:19 EST
Internally Tigerstripe manages each artifact by it's FQN, where FQN is string representation of package name + artifact name. And internally there are only one artifact associated with a FQN. Therefore the existence of two artifacts with the same FQNs causes problems discribed above (ArtifactManager returns entity artifact instead of corresponding package artifact).

I see two possible solutions to solve the problem:

1. Now you can't create a package if an artifact with the FQN is already exists. You receive "Type already exists" warning. So we can show the similar warning to prevent an artifact creation if a package with the FQN is already exists;
2. Change FQN structure, i.e. add additional information about element type.

The 1. is more easy solution, when 2. is more correct but a lot of core parts will need to be refactored.

What do you think about it?
Comment 3 Navid Mehregani CLA 2011-01-03 09:52:51 EST
Hey Anton,

Solution #1 is sufficient.  I don't think a lot of users will run into this case so we shouldn't spend all the efforts involved for #2.  Instead we should prevent them from falling into the trap.
Comment 4 Anton Salnik CLA 2011-01-12 07:53:34 EST
Created attachment 186618 [details]
320659 patch
Comment 5 Yuri Strot CLA 2011-01-13 00:55:12 EST
Anton's patch applied.
Comment 6 Navid Mehregani CLA 2011-01-17 09:44:10 EST
Verified. Thanks!