Skip to content

Commit

Permalink
[#953] Operator: error on creating top-level aggregators
Browse files Browse the repository at this point in the history
  • Loading branch information
eparovyshnaya committed Feb 15, 2024
1 parent 3de39e0 commit a6cd7da
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected DomainContentAdapter<AgreementGroupDescriptor, AgreementDomainRegistry

public void registerAgreementGroup(AgreementGroupDescriptor group) {
AgreementGroupDescriptor existing = groups.put(group.getIdentifier(), group);
if (existing != null) {
if ((existing != null) && (existing != group)) {
String msg = NLS.bind(AgreementsCoreMessages.AgreementDomain_instance_duplication_message, existing, group);
Platform.getLog(getClass()).warn(msg);
}
Expand All @@ -161,7 +161,7 @@ private void brush(AgreementGroupDescriptor group) {
public void registerAgreement(AgreementDescriptor agreement) {
String identifier = agreement.getIdentifier();
AgreementDescriptor existing = agreements.put(identifier, agreement);
if (existing != null) {
if ((existing != null) && (existing != agreement)) {
String msg = NLS.bind(AgreementsCoreMessages.AgreementDomain_instance_duplication_message, existing,
agreement);
Platform.getLog(getClass()).warn(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ protected DomainContentAdapter<FeatureSetDescriptor, FeatureDomainRegistry> crea
public void registerFeatureSet(FeatureSetDescriptor featureSet) {
String identifier = featureSet.getIdentifier();
FeatureSetDescriptor existing = featureSetIndex.put(identifier, featureSet);
if (existing != null) {
if ((existing != null) && (existing != featureSet)) {
String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing,
featureSet);
Platform.getLog(getClass()).warn(msg);
Expand All @@ -198,7 +198,7 @@ public void registerFeatureSet(FeatureSetDescriptor featureSet) {
public void registerFeature(FeatureDescriptor feature) {
String identifier = feature.getIdentifier();
FeatureDescriptor existing = featureIndex.put(identifier, feature);
if (existing != null) {
if ((existing != null) && (existing != feature)) {
String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, feature);
Platform.getLog(getClass()).warn(msg);
}
Expand All @@ -216,7 +216,7 @@ public void registerFeatureVersion(FeatureDescriptor feature, FeatureVersionDesc
key -> new HashMap<>());
String version = featureVersion.getVersion();
FeatureVersionDescriptor existing = map.put(version, featureVersion);
if (existing != null) {
if ((existing != null) && (existing != featureVersion)) {
String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing,
featureVersion);
Platform.getLog(getClass()).warn(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public LicensePlanDescriptor getLicensePlan(String identifier) {
public void registerLicensePlan(LicensePlanDescriptor licensePlan) {
String identifier = licensePlan.getIdentifier();
LicensePlanDescriptor existing = licensePlanIndex.put(identifier, licensePlan);
if (existing != null) {
if ((existing != null) && (existing != licensePlan)) {
String msg = NLS.bind(LicensesCoreMessages.LicenseDomain_instance_duplication_message, existing,
licensePlan);
Platform.getLog(getClass()).warn(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ protected DomainContentAdapter<ProductLineDescriptor, ProductDomainRegistry> cre
public void registerProductLine(ProductLineDescriptor productLine) {
String identifier = productLine.getIdentifier();
ProductLineDescriptor existing = productLineIndex.put(identifier, productLine);
if (existing != null) {
if ((existing != null) && (existing != productLine)) {
String msg = NLS.bind(ProductsCoreMessages.ProductDomain_instance_duplication_message, existing,
productLine);
Platform.getLog(getClass()).warn(msg);
Expand All @@ -224,7 +224,7 @@ public void registerProductLine(ProductLineDescriptor productLine) {
public void registerProduct(ProductDescriptor product) {
String identifier = product.getIdentifier();
ProductDescriptor existing = productIndex.put(identifier, product);
if (existing != null) {
if ((existing != null) && (existing != product)) {
String msg = NLS.bind(ProductsCoreMessages.ProductDomain_instance_duplication_message, existing, product);
Platform.getLog(getClass()).warn(msg);
}
Expand All @@ -239,7 +239,7 @@ public void registerProductVersion(ProductDescriptor product, ProductVersionDesc
key -> new HashMap<>());
String version = productVersion.getVersion();
ProductVersionDescriptor existing = versions.put(version, productVersion);
if (existing != null) {
if ((existing != null) && (existing != productVersion)) {
String msg = NLS.bind(ProductsCoreMessages.ProductDomain_instance_duplication_message, existing,
productVersion);
Platform.getLog(getClass()).warn(msg);
Expand All @@ -258,7 +258,7 @@ public void registerProductVersionFeature(ProductDescriptor product, ProductVers
key -> new HashMap<>());
String featureIdentifier = productVersionFeature.getFeatureIdentifier();
ProductVersionFeatureDescriptor existing = features.put(featureIdentifier, productVersionFeature);
if (existing != null) {
if ((existing != null) && (existing != productVersionFeature)) {
String msg = NLS.bind(ProductsCoreMessages.ProductDomain_instance_duplication_message, existing,
productVersionFeature);
Platform.getLog(getClass()).warn(msg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected DomainContentAdapter<UserOriginDescriptor, UserDomainRegistry> createC
public void registerUserOrigin(UserOriginDescriptor userOrigin) {
String identifier = userOrigin.getIdentifier();
UserOriginDescriptor existing = userOriginIndex.put(identifier, userOrigin);
if (existing != null) {
if ((existing != null) && (existing != userOrigin)) {
String msg = NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, userOrigin);
Platform.getLog(getClass()).warn(msg);
}
Expand All @@ -152,7 +152,7 @@ public void registerUserOrigin(UserOriginDescriptor userOrigin) {
public void registerUser(UserDescriptor user) {
String identifier = user.getContact().getEmail();
UserDescriptor existing = userIndex.put(identifier, user);
if (existing != null) {
if ((existing != null) && (existing != user)) {
String msg = NLS.bind(UsersCoreMessages.UserDomain_instance_duplication_message, existing, user);
Platform.getLog(getClass()).warn(msg);
}
Expand Down

0 comments on commit a6cd7da

Please sign in to comment.