Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #475: (v3) Fixing NPE when displaying ConnectorDef properties #506

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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