Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321409 - [Refactoring] Cannot refactor package names
Summary: [Refactoring] Cannot refactor package names
Status: VERIFIED FIXED
Alias: None
Product: Tigerstripe
Classification: Technology
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P2 major (vote)
Target Milestone: 0.5M0   Edit
Assignee: Navid Mehregani CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-30 18:06 EDT by Navid Mehregani CLA
Modified: 2010-11-30 17:58 EST (History)
6 users (show)

See Also:


Attachments
Unable to rename the package (114.96 KB, image/png)
2010-09-28 10:17 EDT, Valentin Yerastov CLA
no flags Details
Fixed Comment 4 (1.16 KB, patch)
2010-09-30 06:15 EDT, Valentin Yerastov CLA
no flags Details | Diff
Fixes for the problems described in the comments 11 and 4 (37.25 KB, patch)
2010-09-30 11:48 EDT, Valentin Yerastov CLA
no flags Details | Diff
Patch for Comment 20 (4.94 KB, patch)
2010-10-26 07:06 EDT, Valentin Yerastov CLA
no flags Details | Diff
Patch for comment 16 (12.15 KB, patch)
2010-11-03 09:55 EDT, Anton Salnik CLA
no flags Details | Diff
Patch for comment 29 (1.21 KB, patch)
2010-11-15 06:01 EST, Anton Salnik CLA
no flags Details | Diff
321409_32 (5.91 KB, patch)
2010-11-19 06:25 EST, Anton Salnik CLA
no flags Details | Diff
321409_36 (6.77 KB, patch)
2010-11-29 09:28 EST, Anton Salnik CLA
no flags Details | Diff
Snapshot (73.87 KB, image/png)
2010-11-29 10:46 EST, Navid Mehregani CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Navid Mehregani CLA 2010-07-30 18:06:48 EDT
Build Identifier: 

Refactoring package names results in the following IllegalArgumentException:

java.lang.IllegalArgumentException: Unexpected java changes. Old elements: [java:/foo/src/com/mycompany/Entity1.java/com.mycompany.Entity1, java:/foo/src/com/mycompany/Entity2.java/com.mycompany.Entity2, java:/foo/src/com/mycompany/MyEntitiy.java/com.mycompany.MyEntitiy]. New elements: [Entity1.java [in com.mycompany.blah [in src [in foo]]]
package com.mycompany.blah
class Entity1, Entity2.java [in com.mycompany.blah [in src [in foo]]]
package com.mycompany.blah
class Entity2]
at org.eclipse.tigerstripe.annotation.java.ui.refactoring.JavaChanges.collectChanges(JavaChanges.java:105)
at org.eclipse.tigerstripe.annotation.java.ui.refactoring.JavaChanges.getChanges(JavaChanges.java:50)
at org.eclipse.tigerstripe.annotation.java.ui.refactoring.JavaRefactoringSupport.changed(JavaRefactoringSupport.java:60)
at org.eclipse.tigerstripe.annotation.internal.core.AnnotationManager.fireChanged(AnnotationManager.java:726)
at org.eclipse.tigerstripe.workbench.internal.refactor.ModelChangeDeltaProcessor.processIAbstractArtifactChange(ModelChangeDeltaProcessor.java:146)
at org.eclipse.tigerstripe.workbench.internal.refactor.ModelChangeDeltaProcessor.processModelChangeDelta(ModelChangeDeltaProcessor.java:75)
at org.eclipse.tigerstripe.workbench.internal.core.model.ModelChangeDelta.apply(ModelChangeDelta.java:169)
at org.eclipse.tigerstripe.workbench.internal.refactor.BaseRefactorCommand.applyAllDeltas(BaseRefactorCommand.java:336)
at org.eclipse.tigerstripe.workbench.internal.refactor.BaseRefactorCommand.execute(BaseRefactorCommand.java:103)
at org.eclipse.tigerstripe.workbench.ui.internal.wizards.refactoring.RenameModelArtifactWizard$RefactorRunnable.run(RenameModelArtifactWizard.java:121)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:944)
at org.eclipse.tigerstripe.workbench.ui.internal.wizards.refactoring.RenameModelArtifactWizard.performFinish(RenameModelArtifactWizard.java:179)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:752)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.tigerstripe.workbench.ui.internal.handlers.RefactoringRenameHandler.execute(RefactoringRenameHandler.java:23)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:770)
at org.eclipse.ui.menus.CommandContributionItem.access$10(CommandContributionItem.java:756)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:746)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3543)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1250)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1273)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1079)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3441)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3100)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)


Chris also has reported the following NPE: 

java.lang.NullPointerException
at org.eclipse.tigerstripe.workbench.internal.refactor.ModelRefactorCommandFactory.buildDerivedRequests(ModelRefactorCommandFactory.java:310)
at org.eclipse.tigerstripe.workbench.internal.refactor.ModelRefactorCommandFactory.getCommand(ModelRefactorCommandFactory.java:123)
at org.eclipse.tigerstripe.workbench.refactor.ModelRefactorRequest.getCommand(ModelRefactorRequest.java:133)
at org.eclipse.tigerstripe.workbench.ui.internal.wizards.refactoring.RenameModelArtifactWizard$RefactorRunnable.run(RenameModelArtifactWizard.java:66)
at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:944)
at org.eclipse.tigerstripe.workbench.ui.internal.wizards.refactoring.RenameModelArtifactWizard.performFinish(RenameModelArtifactWizard.java:179)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:752)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
at org.eclipse.jface.window.Window.open(Window.java:801)
at org.eclipse.tigerstripe.workbench.ui.internal.handlers.RefactoringRenameHandler.execute(RefactoringRenameHandler.java:23)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:294)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:770)
at org.eclipse.ui.menus.CommandContributionItem.access$10(CommandContributionItem.java:756)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:746)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)
 

Reproducible: Always

Steps to Reproduce:
1. Create a new TS Project
2. Create a new entity in a package 
3. Right click on package > refactor model > rename > give it a new name.
Comment 1 Chris Hartley CLA 2010-08-02 22:53:28 EDT
Need to test on a package containing both model artifacts and diagrams.
Comment 2 Eric Dillon CLA 2010-08-09 22:08:31 EDT
It looks like the annotation framework is causing the problem here?
Comment 3 Yuri Strot CLA 2010-09-24 09:26:15 EDT
The problem was not in the Annotation Framework, but the mechanism of Tigerstripe refactoring which made an incorrect project state. We found two refactoring problems: 

1. Invalid order of refactoring operations. Must first be processed elements of the lower level in the project tree (classes, subpackages) and then the top-level (packages).
We've added sorting operations by level in tree to fix it before the refactoring operation to be launched.

2. Parent references wasn't updated correctly during refactoring and next refactoring operations works wrong.

To fix these two issues we've fixed BaseRefactorCommand and ModelRefactorCommandFactory classes in the org.eclipse.tigerstripe.workbench.base plugin.
Comment 4 Navid Mehregani CLA 2010-09-24 11:04:34 EDT
The logged error message is fixed, but refactoring package names is still not working as expected.  The point of this defect was to get this functionality working.  Fixing just the error messages won't do any good for users unless the feature is actually functional.

After checking out the latest changes, I no longer get any error messages logged in Error Log view.  Refactoring the package name sometimes works for the first time.  However, refactoring the same package for the second time, gets rid of everything under that package and only displays the first segment of the package in TS explorer.  For example, renaming 'com.mycompany' to 'com.mycompany.blah' will only display 'com' in TS Explorer!!
Comment 5 Valentin Yerastov CLA 2010-09-27 04:39:18 EDT
Hi Navid,

Sorry for misunderstanding. As I firstly understood you already mentioned all refactoring problems and that’s why we did not test other scenarios and fix only two mentioned issues.

Now I can test refactoring completely, report all problems I’ll found and fix it.
Also If you know any other problems please report it to this issue.
Comment 6 Valentin Yerastov CLA 2010-09-28 10:17:15 EDT
Created attachment 179744 [details]
Unable to rename the package
Comment 7 Valentin Yerastov CLA 2010-09-28 10:18:52 EDT
Unable to rename the package after restart the eclipse(see screenshot)
Comment 8 Navid Mehregani CLA 2010-09-28 13:24:15 EDT
(In reply to comment #7)
> Unable to rename the package after restart the eclipse(see screenshot)

Can you try this in Tigerstripe explorer instead?
Comment 9 Valentin Yerastov CLA 2010-09-29 13:25:00 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > Unable to rename the package after restart the eclipse(see screenshot)
> 
> Can you try this in Tigerstripe explorer instead?

Yes, I can. This is actually Tigerstripe issue, but I attached ambiguous screenshot.
Comment 10 Valentin Yerastov CLA 2010-09-30 06:15:31 EDT
Created attachment 179938 [details]
Fixed Comment 4
Comment 11 Valentin Yerastov CLA 2010-09-30 06:24:33 EDT
Another problem:
When you rename a package, resources(facets, profile...) are lost.
Steps to reproduce:
1. Create facet in package com.mycompany
2. Create artifact and class diagram in package com.mycompany
3. Rename package com.mycompany to com.mycompany2

Package successfully renamed with contained artifacts and diagrams, but the facet we have lost.
Comment 12 Navid Mehregani CLA 2010-09-30 10:17:59 EDT
(In reply to comment #11)
> Another problem:
> When you rename a package, resources(facets, profile...) are lost.
> Steps to reproduce:
> 1. Create facet in package com.mycompany
> 2. Create artifact and class diagram in package com.mycompany
> 3. Rename package com.mycompany to com.mycompany2
> 
> Package successfully renamed with contained artifacts and diagrams, but the
> facet we have lost.

Thanks Valentin.  Let's keep this bug open until all corresponding problems with package renaming are resolved.  If you don't think you have enough time to address comment#11 in this iteration, we can mark its corresponding JIRA as fixed and recreate another JIRA in I25 to address the rest of the problems.
Comment 13 Valentin Yerastov CLA 2010-09-30 11:48:17 EDT
Created attachment 179975 [details]
Fixes for the problems described in the comments 11 and 4
Comment 14 Valentin Yerastov CLA 2010-09-30 11:52:40 EDT
I fixed the problem described in the comment 11.
I extended the mechanism of refactoring and added there a new concept "resources refactoring"(to the existing "model refactoring" and "diagram refactoring")
Comment 15 Yuri Strot CLA 2010-10-01 02:30:52 EDT
Verified that all mentioned issues fixed and applied patch.
Comment 16 Navid Mehregani CLA 2010-10-07 16:40:48 EDT
The following use case breaks with this fix:

Consider a project with the following three packages:

MyProject
   com.mycompany
        Entity1
   com.mycompany.foo
        Entity2
   com.mycompany.fee
        Entity3

Now rename 'com.mycompany' package to 'com.mycompany.blah'.  This causes a change in the other packages as well.  It results in the following:

MyProject
   com.mycompany.blah     *CORRECT*
        Entity1
   com.mycompany.blah.foo   *INCORRECT*
        Entity2
   com.mycompany.blah.fee   *INCORRECT*
        Entity3
Comment 17 Valentin Yerastov CLA 2010-10-15 08:53:56 EDT
Hi Navid,

Both behaviors are correct. In JDN is responsible for this option check-button "Rename Subpackages". I suggest we do likewise.
Comment 18 Valentin Yerastov CLA 2010-10-15 08:57:34 EDT
In other words, I propose to make a button that would switch between different behaviors described by you.
Comment 19 Navid Mehregani CLA 2010-10-18 10:16:48 EDT
Reopening per discussion with Xored.
Comment 20 Maria Kolchinskaja CLA 2010-10-26 06:29:29 EDT
Cannot rename package in following case: 
1. Create package 'com.mycompany' 
2. Rename package to 'com.mycompany.z1.z2.z3' 
3. Rename package back to 'com.mycompany' 

Error message "type already exists" is displayed and package cannot be renamed back.
Comment 21 Valentin Yerastov CLA 2010-10-26 07:06:29 EDT
Created attachment 181708 [details]
Patch for Comment 20

Problem described in comment 20 fixed.
Comment 22 Maria Kolchinskaja CLA 2010-10-26 08:04:14 EDT
1. Create a package with class diagram, entity and session facade. 
2. Create implements link with entity and session facade 
3. Rename package com.mycompany to com.mycompany.test with Refactor Model -> Rename 
4. View Entity artifact editor. "Implements" link is not renamed from "com.mycompany" to "com.mycompany.test". Error message "Implemented artifact is not a valid ISessionArtifact" is displayed
Comment 23 Anton Salnik CLA 2010-10-27 00:15:04 EDT
(In reply to comment #22)
> 1. Create a package with class diagram, entity and session facade. 
> 2. Create implements link with entity and session facade 
> 3. Rename package com.mycompany to com.mycompany.test with Refactor Model ->
> Rename 
> 4. View Entity artifact editor. "Implements" link is not renamed from
> "com.mycompany" to "com.mycompany.test". Error message "Implemented artifact is
> not a valid ISessionArtifact" is displayed
The problem isn't reproducible in current trunk.
Comment 24 Navid Mehregani CLA 2010-10-27 00:23:26 EDT
> (In reply to comment #22)
> > 1. Create a package with class diagram, entity and session facade. 
> > 2. Create implements link with entity and session facade 
> > 3. Rename package com.mycompany to com.mycompany.test with Refactor Model ->
> > Rename 
> > 4. View Entity artifact editor. "Implements" link is not renamed from
> > "com.mycompany" to "com.mycompany.test". Error message "Implemented artifact is
> > not a valid ISessionArtifact" is displayed
> The problem isn't reproducible in current trunk.

I wasn't able to reproduce this either.  The implements field is updated as expected.  Maria, can you please try reproducing this again?
Comment 25 Maria Kolchinskaja CLA 2010-11-01 08:45:20 EDT
(In reply to comment #24)
> > (In reply to comment #22)
> > > 1. Create a package with class diagram, entity and session facade. 
> > > 2. Create implements link with entity and session facade 
> > > 3. Rename package com.mycompany to com.mycompany.test with Refactor Model ->
> > > Rename 
> > > 4. View Entity artifact editor. "Implements" link is not renamed from
> > > "com.mycompany" to "com.mycompany.test". Error message "Implemented artifact is
> > > not a valid ISessionArtifact" is displayed
> > The problem isn't reproducible in current trunk.
> I wasn't able to reproduce this either.  The implements field is updated as
> expected.  Maria, can you please try reproducing this again?

I've tried to reproduce this case again on the latest version from the HEAD. Now it works correctly.
Comment 26 Navid Mehregani CLA 2010-11-01 09:43:21 EDT
(In reply to comment #25)
> I've tried to reproduce this case again on the latest version from the HEAD.
> Now it works correctly.

Thanks Maria.  Anton/Yuri, if all the problems reported in this bug have been resolved, please mark it as Fixed and I'll proceed with verifying it.
Comment 27 Anton Salnik CLA 2010-11-03 09:55:04 EDT
Created attachment 182295 [details]
Patch for comment 16
Comment 28 Yuri Strot CLA 2010-11-03 11:18:42 EDT
Applied patch from Anton which fix issue in the comment #16. So mark this issue as resolved.
Comment 29 Navid Mehregani CLA 2010-11-12 13:23:24 EST
Try the following:

- Create two TS projects called One and Two
- Open tigerstripe.xml file of project One > Switch to dependencies tab > under 'referenced tigerstripe projects' click on Add > add project Two.
- Under project One create an entity artifact called Ent1 under package com.mycompany
- Under project Two create an entity artifact called Ent2 under package com.mycompany
- Rename package com.mycompany under project Two to 'foo'.  

Result:
  'com.mycompany' under project ONE changes to foo and Ent1 under project One disappears!!

Expected Result:
  Package under project Two should change without effecting project One.
Comment 30 Anton Salnik CLA 2010-11-15 06:01:27 EST
Created attachment 183113 [details]
Patch for comment 29
Comment 31 Yuri Strot CLA 2010-11-15 07:04:12 EST
Patch applied.
Comment 32 Maria Kolchinskaja CLA 2010-11-17 00:17:44 EST
Another issue:
Create a project with package with contained Entity artifacts with Dependency on Diagram. 
MyProject 
   com.mycompany 
        Dependency1 
        Entity1 
        Entity2 
        DefaultDiagram 
Open diagram. Dependency1 is displayed. 
Rename "com.mycompany" to "com.mycompany.test" with checked "rename subpackage". Dependency1 is displayed in Tigerstripe Explorer but is not displayed on the diagram
Comment 33 Navid Mehregani CLA 2010-11-17 00:20:13 EST
Reopened per comment#32
Comment 34 Anton Salnik CLA 2010-11-19 06:25:07 EST
Created attachment 183462 [details]
321409_32

Patch to comment 32 added.
Comment 35 Yuri Strot CLA 2010-11-19 07:19:41 EST
I applied Anton's patch.
Comment 36 Navid Mehregani CLA 2010-11-19 11:57:44 EST
Great job Anton! Most of the issues have been resolved.  I only found one issue.  I think we can put this bug to rest when this is resolved.  

- Create two project: One and Two
- Open tigerstripe.xml file of project One and add project Two under dependencies tab (in the 'Referenced Tigerstripe Projects' list).
- Create an entity under package com.mycompany of project One called Entity1 
- Create an entity under package com.mycompany of project Two called Entity2
- Create a class diagram under com.mycompany of project One
- Drag and drop Entity1 and Entity2 from TS Explorer to class diagram
- Create an association between Entity1 and Entity2
- Rename package 'com.mycompany' from project Two to 'foo'
- Notice that the association artifact under project One now has an error, since the appropriate reference is not updated after a package rename: 'com.mycompandy.Entity2 cannot be resolve to a type'.
Comment 37 Anton Salnik CLA 2010-11-29 09:28:35 EST
Created attachment 184039 [details]
321409_36

Patch to comment #36 added.
Comment 38 Yuri Strot CLA 2010-11-29 09:36:55 EST
I've applied the last patch. Navid, could you please verify it and resolve this issue if everything is OK?
Comment 39 Navid Mehregani CLA 2010-11-29 10:46:46 EST
Created attachment 184044 [details]
Snapshot

Something is wrong here.  When I follow the instructions under comment#36 and create an association between Entity1 and Entity2, I get an error in the Association indicating that 'com.mycompany.Entity2' cannot be resolved.  This shouldn't happen, since project One has declared a dependency on project Two.
This wasn't happening in the past.
Comment 40 Yuri Strot CLA 2010-11-30 06:12:28 EST
Related issue 331413 was fixed. So I guess this issue can be resolved as well.
Comment 41 Navid Mehregani CLA 2010-11-30 17:58:43 EST
Looks good. Thanks guys!