Skip to content

Commit

Permalink
AdapterFBs where not correctly updated in CFBs
Browse files Browse the repository at this point in the history
When changing the adapter type of an adapter of a CFB interface the FB
shown in the network was using the wrong type during update.
  • Loading branch information
azoitl authored and oberlehner committed Aug 12, 2024
1 parent fa45310 commit c8c3cf0
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2008, 2023 Profactor GmbH, fortiss GmbH,
* Copyright (c) 2008, 2024 Profactor GmbH, fortiss GmbH,
* Johannes Kepler University Linz
* Martin Erich Jobst
*
Expand All @@ -26,7 +26,6 @@ public final class ChangeAdapterFBCommand extends UpdateFBTypeCommand {

public ChangeAdapterFBCommand(final AdapterDeclaration adpDecl) {
super(adpDecl.getAdapterNetworkFB(), null);
setEntry(adpDecl.getType().getTypeEntry());
}

@Override
Expand All @@ -43,6 +42,8 @@ protected FBNetworkElement createCopiedFBEntry(final FBNetworkElement srcElement

@Override
public void execute() {
// use the type of the adapterDecl for changing the adapterfbs type
setEntry(getOldElement().getAdapterDecl().getType().getTypeEntry());
super.execute();
setAdapterNetworkFB((AdapterFB) newElement);
}
Expand All @@ -62,4 +63,9 @@ public void redo() {
private static void setAdapterNetworkFB(final AdapterFB fb) {
fb.getAdapterDecl().setAdapterNetworkFB(fb);
}

@Override
public AdapterFB getOldElement() {
return (AdapterFB) super.getOldElement();
}
}

0 comments on commit c8c3cf0

Please sign in to comment.