Commit c2c021b5 authored by Simon Barner's avatar Simon Barner
Browse files

Avoid warning about unlikely argument

* container.getContainedElements() is of type List<IHierarchicElement>
* The (unchecked) cast of elementRef -> IHierarchicElement has already
  been present in the previous version of this method

Issue-Ref: 3539
Issue-Url: https://af3-developer.fortiss.org/issues/3539

Signed-off-by: Simon Barner's avatarSimon Barner <barner@fortiss.org>
parent 4653cf4d
ModelElementLibraryService.java ad618d79106b45f9b63856023a1df1ab65f2cec7 GREEN
ModelElementLibraryService.java aae1cda83bd706a5798169daa4a64db5be0a0588 YELLOW
......@@ -141,7 +141,8 @@ public class ModelElementLibraryService implements ILibraryService {
final ILibraryElementReference elementRef) {
IHierarchicElement wrapped = (IHierarchicElement)elementRef.getLibraryElementShadow();
IHierarchicElement container = (IHierarchicElement)elementRef.eContainer();
container.getContainedElements().remove(elementRef);
IHierarchicElement elementRefHierarchicElement = (IHierarchicElement)elementRef;
container.getContainedElements().remove(elementRefHierarchicElement);
// preserve the ID of the reference
((IIdLabeled)wrapped).setId(((IIdLabeled)elementRef).getId());
......@@ -151,7 +152,7 @@ public class ModelElementLibraryService implements ILibraryService {
wrappedConnectorsList.addAll(wrapped.getConnectors());
wrapped.getConnectors().clear();
EList<IConnector> elementRefConnectorsList = new BasicEList<IConnector>();
elementRefConnectorsList.addAll(((IHierarchicElement)elementRef).getConnectors());
elementRefConnectorsList.addAll(elementRefHierarchicElement.getConnectors());
for(IConnector elemRefConnector : elementRefConnectorsList) {
wrapped.getConnectors().add(elemRefConnector);
String elementRefConnectorName = ((INamedElement)elemRefConnector).getName();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment