Skip to content

Commit 5cbfb5a

Browse files
committed
ST6RI-984 Updated FeatureAdapter and some Utils to not add/cache proxies
1 parent d4d1441 commit 5cbfb5a

5 files changed

Lines changed: 14 additions & 3 deletions

File tree

Binary file not shown.

‎org.omg.sysml.logic/src/main/java/org/omg/sysml/adapter/FeatureAdapter.java‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* SysML 2 Pilot Implementation
33
* Copyright (c) 2021-2026 Model Driven Solutions, Inc.
44
* Copyright (c) 2026 Obeo
5+
* Copyright (c) 2026 Budapest University of Technology and Economics
56
*
67
* This program is free software: you can redistribute it and/or modify
78
* it under the terms of the Eclipse Public License as published by
@@ -477,6 +478,13 @@ public Set<Feature> getAllRedefinedFeatures() {
477478
forceComputeRedefinitions();
478479

479480
addAllRedefinedFeaturesTo(allRedefinedFeatures);
481+
482+
// Do not cache the result while a redefined feature is unresolved.
483+
if (allRedefinedFeatures.stream().anyMatch(Feature::eIsProxy)) {
484+
Set<Feature> redefinedFeatures = allRedefinedFeatures;
485+
allRedefinedFeatures = null;
486+
return redefinedFeatures;
487+
}
480488
}
481489
return allRedefinedFeatures;
482490
}

‎org.omg.sysml.logic/src/main/java/org/omg/sysml/util/ConnectorUtil.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* SysML 2 Pilot Implementation
33
* Copyright (c) 2021-2022 Model Driven Solutions, Inc.
44
* Copyright (c) 2023 Mgnite Inc.
5+
* Copyright (c) 2026 Budapest University of Technology and Economics
56
*
67
* This program is free software: you can redistribute it and/or modify
78
* it under the terms of the Eclipse Public License as published by
@@ -66,7 +67,7 @@ public static Feature addConnectorEndTo(Connector connector, Feature relatedFeat
6667
Feature endFeature = SysMLFactory.eINSTANCE.createFeature();
6768
if (relatedFeature != null) {
6869
ReferenceSubsetting subsetting = SysMLFactory.eINSTANCE.createReferenceSubsetting();
69-
if (relatedFeature.getOwner() == null) {
70+
if (relatedFeature.getOwner() == null && !relatedFeature.eIsProxy()) {
7071
subsetting.getOwnedRelatedElement().add(relatedFeature);
7172
}
7273
subsetting.setReferencedFeature(relatedFeature);

‎org.omg.sysml.logic/src/main/java/org/omg/sysml/util/FeatureUtil.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
33
* Copyright (c) 2021-2025 Model Driven Solutions, Inc.
4+
* Copyright (c) 2026 Budapest University of Technology and Economics
45
*
56
* This program is free software: you can redistribute it and/or modify
67
* it under the terms of the Eclipse Public License as published by
@@ -349,7 +350,7 @@ public static void insertImplicitTypeFeaturings(Feature feature) {
349350
featuring.setIsImplied(true);
350351
featuring.setFeaturingType(type);
351352
featuring.setFeatureOfType(feature);
352-
if (type.getOwningRelationship() == null) {
353+
if (type.getOwningRelationship() == null && !type.eIsProxy()) {
353354
featuring.getOwnedRelatedElement().add(type);
354355
}
355356
feature.getOwnedRelationship().add(featuring);

‎org.omg.sysml.logic/src/main/java/org/omg/sysml/util/TypeUtil.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* SysML 2 Pilot Implementation
33
* Copyright (c) 2021-2022, 2024-2026 Model Driven Solutions, Inc.
44
* Copyright (c) 2026 Obeo
5+
* Copyright (c) 2026 Budapest University of Technology and Economics
56
*
67
* This program is free software: you can redistribute it and/or modify
78
* it under the terms of the Eclipse Public License as published by
@@ -477,7 +478,7 @@ public static void insertImplicitSpecializations(Type type) {
477478
newSpecialization.setIsImplied(true);
478479
newSpecialization.setGeneral(general);
479480
newSpecialization.setSpecific(type);
480-
if (general.getOwningRelationship() == null) {
481+
if (general.getOwningRelationship() == null && !general.eIsProxy()) {
481482
newSpecialization.getOwnedRelatedElement().add(general);
482483
}
483484
type.getOwnedRelationship().add(newSpecialization);

0 commit comments

Comments
 (0)