Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 363060

Summary: [Annotation] Proxies are not handled properly when artifacts are retrieved from ArtifactManager
Product: [Technology] Tigerstripe Reporter: Navid Mehregani <nmehrega>
Component: AnnotationsAssignee: Project Inbox <tigerstripe.annotations-inbox>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: unspecified   
Target Milestone: 0.5M0   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Navid Mehregani CLA 2011-11-07 11:12:56 EST
Build Identifier: 

This defect has already been resolved.  The bugzilla is being filed for the purpose of code review.  Here are the modified files:

plugins/org.eclipse.tigerstripe.workbench.ui.visualeditor.diagram/src/org/eclipse/tigerstripe/workbench/ui/visualeditor/diagram/part/TSRemoveFromModelAction.java
	1.44	plugins/org.eclipse.tigerstripe.annotation.core/src/org/eclipse/tigerstripe/annotation/internal/core/AnnotationManager.java
	1.1	plugins/org.eclipse.tigerstripe.annotation.core/src/org/eclipse/tigerstripe/annotation/internal/core/SimpleLock.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/Contextual.java
	1.24	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/api/impl/ArtifactManagerSessionImpl.java
	1.32	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/api/impl/TigerstripeProjectHandle.java
	1.58	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ArtifactManager.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ArtifactManagerImpl.java
	1.11	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ContextProjectAwareProxy.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/ContextualArtifactManager.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/model/WrapHelper.java
	1.8	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/internal/core/module/ModuleArtifactManager.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/model/deprecated_/ContextualManagerSession.java
	1.13	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/model/deprecated_/IModelComponent.java
	1.1	plugins/org.eclipse.tigerstripe.workbench.base/src/java/org/eclipse/tigerstripe/workbench/project/ContextualModelProject.java

Reproducible: Always
Comment 1 Navid Mehregani CLA 2011-11-09 10:51:02 EST
Code review was completed on November 9 2011.  Major changes are noted below:

 ArtifactManager has been split between an interface and implementation classes. ArtifactManager is now an interface with the following implementations: ArtifactManagerImpl (Same as what ArtifactManager looked like before) and ContextualArtifactManager (New class, which wraps all objects into proxy objects).

  ContextualModelProject is new and implements ITigerstripeModelProject.  It's used to return a "proxy-aware" version of artifact manager (i.e. ContextualArtifactManager).

  WrapHelper class is used by ContextualArtifactManager to wrap objects in ContextProjectAwareProxy objects

  ContextualModelProject and ContextualArtifactManager objects are returned by "invoke" method of ContextProjectAwareProxy.  There is a Contextual annotation added to indicate which methods should return these objects.  The annotation is read by ContextProjectAwareProxy.