Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-08-30 17:40:28 +0000
committerRyan D. Brooks2011-08-30 17:40:28 +0000
commit040f08378e0c33d022a8041c3f3e8dff3a659f93 (patch)
tree3b07519a63868115fa8bf3e9976bb7be42fdde5a
parent2f806b6b6cc6b11f178e8c6fc2e06491dee321a5 (diff)
downloadorg.eclipse.osee-040f08378e0c33d022a8041c3f3e8dff3a659f93.tar.gz
org.eclipse.osee-040f08378e0c33d022a8041c3f3e8dff3a659f93.tar.xz
org.eclipse.osee-040f08378e0c33d022a8041c3f3e8dff3a659f93.zip
feature[ats_M1Y56]: Clean-up unused service reference and commented out code
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java49
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java26
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceRegHandler.java12
3 files changed, 25 insertions, 62 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
index 5647c1f288d..7f7b3fc9b95 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/XTextToOseeTypeOperation.java
@@ -45,10 +45,8 @@ import org.eclipse.osee.framework.core.model.cache.BranchCache;
import org.eclipse.osee.framework.core.model.type.ArtifactType;
import org.eclipse.osee.framework.core.model.type.AttributeType;
import org.eclipse.osee.framework.core.model.type.OseeEnumType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
import org.eclipse.osee.framework.core.operation.AbstractOperation;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.database.core.RemoteIdManager;
import org.eclipse.osee.framework.jdk.core.util.Strings;
/**
@@ -60,11 +58,9 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
private final OseeDsl model;
private final OseeTypeCache typeCache;
private final BranchCache branchCache;
- private final RemoteIdManager idManager;
- public XTextToOseeTypeOperation(RemoteIdManager idManager, IOseeModelFactoryService provider, OseeTypeCache typeCache, BranchCache branchCache, OseeDsl model) {
+ public XTextToOseeTypeOperation(IOseeModelFactoryService provider, OseeTypeCache typeCache, BranchCache branchCache, OseeDsl model) {
super("OSEE Text Model to OSEE", Activator.PLUGIN_ID);
- this.idManager = idManager;
this.provider = provider;
this.typeCache = typeCache;
this.branchCache = branchCache;
@@ -118,7 +114,7 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
private void handleXArtifactTypeCrossRef(XArtifactType xArtifactType) throws OseeCoreException {
ArtifactType targetArtifactType =
- typeCache.getArtifactTypeCache().getByGuid(convertHexToLong(xArtifactType.getUuid()));
+ typeCache.getArtifactTypeCache().getByGuid(HexUtil.toLong(xArtifactType.getUuid()));
translateSuperTypes(targetArtifactType, xArtifactType);
Map<IOseeBranch, Collection<AttributeType>> validAttributesPerBranch = getOseeAttributes(xArtifactType);
targetArtifactType.setAllAttributeTypes(validAttributesPerBranch);
@@ -144,7 +140,7 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
XAttributeType xAttributeType = xAttributeTypeRef.getValidAttributeType();
IOseeBranch branch = getAttributeBranch(xAttributeTypeRef);
AttributeType oseeAttributeType =
- typeCache.getAttributeTypeCache().getByGuid(convertHexToLong(xAttributeType.getUuid()));
+ typeCache.getAttributeTypeCache().getByGuid(HexUtil.toLong(xAttributeType.getUuid()));
if (oseeAttributeType != null) {
Collection<AttributeType> listOfAllowedAttributes = validAttributes.get(branch);
if (listOfAllowedAttributes == null) {
@@ -175,10 +171,8 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
private void translateXArtifactType(XArtifactType xArtifactType) throws OseeCoreException {
String artifactTypeName = xArtifactType.getName();
- // ArtifactType oseeArtifactType =
provider.getArtifactTypeFactory().createOrUpdate(typeCache.getArtifactTypeCache(),
- convertHexToLong(xArtifactType.getUuid()), xArtifactType.isAbstract(), artifactTypeName);
- // xArtifactType.setUuid(String.valueOf(oseeArtifactType.getGuid()));
+ HexUtil.toLong(xArtifactType.getUuid()), xArtifactType.isAbstract(), artifactTypeName);
}
private void translateXEnumType(XOseeEnumType xEnumType) throws OseeCoreException {
@@ -236,12 +230,12 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
XOseeEnumType xEnumType = xAttributeType.getEnumType();
OseeEnumType oseeEnumType = null;
if (xEnumType != null) {
- oseeEnumType = typeCache.getEnumTypeCache().getByGuid(convertHexToLong(xEnumType.getUuid()));
+ oseeEnumType = typeCache.getEnumTypeCache().getByGuid(HexUtil.toLong(xEnumType.getUuid()));
}
AttributeTypeCache cache = typeCache.getAttributeTypeCache();
- AttributeType oseeAttributeType = provider.getAttributeTypeFactory().createOrUpdate(cache, //
- convertHexToLong(xAttributeType.getUuid()), //
+ provider.getAttributeTypeFactory().createOrUpdate(cache, //
+ HexUtil.toLong(xAttributeType.getUuid()), //
xAttributeType.getName(), //
getQualifiedTypeName(xAttributeType.getBaseAttributeType()), //
getQualifiedTypeName(xAttributeType.getDataProvider()), //
@@ -253,7 +247,6 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
xAttributeType.getDescription(), //
xAttributeType.getTaggerId()//
);
- // xAttributeType.setUuid(String.valueOf(oseeAttributeType.getGuid()));
}
private String getQualifiedTypeName(String id) {
@@ -274,23 +267,15 @@ public class XTextToOseeTypeOperation extends AbstractOperation {
ArtifactType sideAType = typeCache.getArtifactTypeCache().getUniqueByName(sideATypeName);
ArtifactType sideBType = typeCache.getArtifactTypeCache().getUniqueByName(sideBTypeName);
- RelationType oseeRelationType =
- provider.getRelationTypeFactory().createOrUpdate(typeCache.getRelationTypeCache(), //
- convertHexToLong(xRelationType.getUuid()), //
- xRelationType.getName(), //
- xRelationType.getSideAName(), //
- xRelationType.getSideBName(), //
- sideAType, //
- sideBType, //
- multiplicity, //
- OseeUtil.orderTypeNameToGuid(xRelationType.getDefaultOrderType()) //
- );
-
- // xRelationType.setUuid(String.valueOf(oseeRelationType.getGuid()));
- }
-
- private long convertHexToLong(String hexString) throws OseeCoreException {
- return HexUtil.toLong(hexString);
+ provider.getRelationTypeFactory().createOrUpdate(typeCache.getRelationTypeCache(), //
+ HexUtil.toLong(xRelationType.getUuid()), //
+ xRelationType.getName(), //
+ xRelationType.getSideAName(), //
+ xRelationType.getSideBName(), //
+ sideAType, //
+ sideBType, //
+ multiplicity, //
+ OseeUtil.orderTypeNameToGuid(xRelationType.getDefaultOrderType()) //
+ );
}
-
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java
index a4ae6a15621..131004efaf3 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceImpl.java
@@ -38,7 +38,6 @@ import org.eclipse.osee.framework.core.operation.Operations;
import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.eclipse.osee.framework.jdk.core.util.Lib;
/**
@@ -50,10 +49,8 @@ public class OseeModelingServiceImpl implements IOseeModelingService {
private final IOseeCachingService systemCachingService;
private final IOseeCachingServiceFactory cachingFactoryService;
private final OseeDslFactory modelFactory;
- private final IOseeDatabaseService dbService;
- public OseeModelingServiceImpl(IOseeDatabaseService dbService, IOseeModelFactoryService modelFactoryService, IOseeCachingService systemCachingService, IOseeCachingServiceFactory cachingFactoryService, OseeDslFactory dslFactory) {
- this.dbService = dbService;
+ public OseeModelingServiceImpl(IOseeModelFactoryService modelFactoryService, IOseeCachingService systemCachingService, IOseeCachingServiceFactory cachingFactoryService, OseeDslFactory dslFactory) {
this.modelFactoryService = modelFactoryService;
this.systemCachingService = systemCachingService;
this.cachingFactoryService = cachingFactoryService;
@@ -101,8 +98,8 @@ public class OseeModelingServiceImpl implements IOseeModelingService {
ops.add(new OseeToXtextOperation(tempCache, modelFactory, baseModel));
}
- ops.add(new XTextToOseeTypeOperation(dbService.getRemoteIdManager(), modelFactoryService, tempCache,
- tempCacheService.getBranchCache(), inputModel));
+ ops.add(new XTextToOseeTypeOperation(modelFactoryService, tempCache, tempCacheService.getBranchCache(),
+ inputModel));
if (request.isCreateTypeChangeReport()) {
ops.add(new CreateOseeTypeChangesReportOperation(tempCache, reportData));
}
@@ -139,21 +136,4 @@ public class OseeModelingServiceImpl implements IOseeModelingService {
response.setComparisonSnapshotModel(modelString);
}
}
-
- // Map<String, OseeTypeModel> changedModels = new HashMap<String, OseeTypeModel>();
- // doSubWork(new OseeToXtextOperation(modifiedCache, changedModels), monitor, 0.20);
- //
- // OseeTypeCache storeCache = createEmptyCache();
- // storeCache.ensurePopulated();
- // Map<String, OseeTypeModel> baseModels = new HashMap<String, OseeTypeModel>();
- // doSubWork(new OseeToXtextOperation(storeCache, baseModels), monitor, 0.20);
- //
- // OseeTypeModel changedModel = null;
- // OseeTypeModel baseModel = null;
- // for (String key : changedModels.keySet()) {
- // changedModel = changedModels.get(key);
- // baseModel = baseModels.get(key);
- // }
- // }
-
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceRegHandler.java b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceRegHandler.java
index 55847cab428..662caee2626 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceRegHandler.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.integration/src/org/eclipse/osee/framework/core/dsl/integration/internal/OseeModelingServiceRegHandler.java
@@ -17,7 +17,6 @@ import org.eclipse.osee.framework.core.services.IOseeCachingService;
import org.eclipse.osee.framework.core.services.IOseeCachingServiceFactory;
import org.eclipse.osee.framework.core.services.IOseeModelFactoryService;
import org.eclipse.osee.framework.core.util.AbstractTrackingHandler;
-import org.eclipse.osee.framework.database.IOseeDatabaseService;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -26,13 +25,13 @@ import org.osgi.framework.ServiceRegistration;
*/
public class OseeModelingServiceRegHandler extends AbstractTrackingHandler {
- private static final Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {IOseeDatabaseService.class,//
+ private static final Class<?>[] SERVICE_DEPENDENCIES = new Class<?>[] {//
IOseeCachingService.class, //
- IOseeModelFactoryService.class, //
- IOseeCachingServiceFactory.class //
+ IOseeModelFactoryService.class, //
+ IOseeCachingServiceFactory.class //
};
- private ServiceRegistration registration;
+ private ServiceRegistration<?> registration;
@Override
public Class<?>[] getDependencies() {
@@ -44,10 +43,9 @@ public class OseeModelingServiceRegHandler extends AbstractTrackingHandler {
IOseeModelFactoryService modelFactoryService = getService(IOseeModelFactoryService.class, services);
IOseeCachingService cachingService = getService(IOseeCachingService.class, services);
IOseeCachingServiceFactory cachingFactoryService = getService(IOseeCachingServiceFactory.class, services);
- IOseeDatabaseService dbService = getService(IOseeDatabaseService.class, services);
IOseeModelingService service =
- new OseeModelingServiceImpl(dbService, modelFactoryService, cachingService, cachingFactoryService,
+ new OseeModelingServiceImpl(modelFactoryService, cachingService, cachingFactoryService,
OseeDslFactory.eINSTANCE);
registration = context.registerService(IOseeModelingService.class.getName(), service, null);
}

Back to the top