Skip to content

ST6RI-964 The operation Type.getOwnedDisjoining() always returns the empty list - #791

Open
seidewitz wants to merge 2 commits into
masterfrom
ST6RI-964
Open

ST6RI-964 The operation Type.getOwnedDisjoining() always returns the empty list#791
seidewitz wants to merge 2 commits into
masterfrom
ST6RI-964

Conversation

@seidewitz

@seidewitz seidewitz commented Aug 25, 2026

Copy link
Copy Markdown
Member

This PR fixes a bug causing Type.getOwnedDisjoining() to always return the empty list and, so, also resolves Issue #790.

Background

In the following KerML model:

package Disjoining {
	private import SequenceFunctions::size;
	
    classifier A;
    classifier B disjoint from A;
    classifier C disjoint from A, B;
    
    feature b = size((B meta KerML::Classifier).ownedDisjoining);
    feature c = size((C meta KerML::Classifier).ownedDisjoining);
}

features b and c should evaluate to 1 and 2, respectively. Instead, they both previously evaluated to 0.

Change

The root cause was an error in Type_ownedDisjoining_SettingDelegate.basicGet():

	@Override
	protected EList<?> basicGet(InternalEObject owner) {
		EList<Disjoining> disjoinings = new NonNotifyingEObjectEList<>(Disjoining.class, owner, eStructuralFeature.getFeatureID());
		((Type)owner).getOwnedRelationship().stream().
			filter(Disjoining.class::isInstance).
			map(Disjoining.class::cast).
			filter(gen->gen.getTypeDisjoined() == this).
			forEachOrdered(disjoinings::add);
		return disjoinings;
	}

Changing this to owner in line 7 fixes the bug.

@seidewitz seidewitz added this to the 2026-08 milestone Aug 25, 2026
@seidewitz seidewitz self-assigned this Aug 25, 2026
@seidewitz seidewitz added the bug Something isn't working label Aug 25, 2026
@seidewitz
seidewitz requested a review from himi August 25, 2026 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Every disjoint from clause in a type declaration reports an unpaired bidirectional reference

1 participant