Skip to content

Commit

Permalink
Issue #475: (v3) Fixing NPE when displaying ConnectorDef properties
Browse files Browse the repository at this point in the history
Signed-off-by: Ernesto Posse <eposse.gmail.com>
  • Loading branch information
Ernesto Posse committed Jun 3, 2024
1 parent a1cedf0 commit b55ac8c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,14 @@ public Object[] getChildren(Object parentElement) {
.isZDLConcept(modelObject, IDL3PlusNames.CONNECTOR_DEF)) {
// get properties of the component
Component component = (Component) entry.getModelObject();
IPropertyEntry grandParent = entry.getParent();
EObject grandParentEObject = grandParent.getModelObject();
Property grandParentProperty = null;
if (grandParentEObject instanceof Property) {
grandParentProperty = (Property) grandParentEObject;
IPropertyEntry entryParent = entry.getParent();
EObject entryParentModelObject = entryParent != null ? entryParent.getModelObject() : null;
Property entryParentDeploymentProperty = null;
if (entryParentModelObject instanceof Property) {
entryParentDeploymentProperty = (Property) entryParentModelObject;
}
Iterator<Property> itor = component.getAllAttributes().iterator();
while (itor.hasNext()) {
Property property = itor.next();
if (!IDL3PlusUtil.filter(grandParentProperty, property)) {
for (Property property: component.getAllAttributes()) {
if (entryParent == null || !IDL3PlusUtil.filter(entryParentDeploymentProperty, property)) {
if (ZDLUtil.isZDLConcept(property,
CXDomainNames.CXATTRIBUTE)) {
children.add(entry.addChild(property));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,13 +559,13 @@ protected Map<EObject, EObject> getTemplateParemeterBindings(
* Determine whether the given attribute of the given port type matches the pattern specified for the
* port type in the filteredProperties extension.
*
* @param grandParent - A {@link Property}.
* @param deploymentProperty - A {@link Property} in the Deployment.
* @param port - A {@link Port} {@link Property}.
* @return A boolean.
*/
public static boolean filter(Property grandParent, Property port) {
if (grandParent != null && port != null && ZDLUtil.isZDLConcept(port, ZMLMMNames.PORT)) {
Type portType = grandParent.getType();
public static boolean filter(Property deploymentProperty, Property port) {
if (deploymentProperty != null && port != null && ZDLUtil.isZDLConcept(port, ZMLMMNames.PORT)) {
Type portType = deploymentProperty.getType();
if (portType != null && ZDLUtil.isZDLConcept(portType, ZMLMMNames.PORT_TYPE)) {
String portTypeQualifiedName = getInstantiatedPortTypeQualifiedName(portType);
FilteredPropertyConfiguration filteredPropertyConfiguration = ConnectorRegistry.getInstance()
Expand Down

0 comments on commit b55ac8c

Please sign in to comment.