-
Bug
-
Resolution: Won't Fix
-
Major
-
4.5
at least what the code here looks like (AreaElement):
this.isAreaDefinitionEnabled = areaDefinition != null && (areaDefinition.isEnabled() == null || areaDefinition.isEnabled()); if (!this.isAreaDefinitionEnabled) { return; } // set the values based on the area definition if not passed this.name = resolveName(); this.dialog = resolveDialog(); this.type = resolveType(); this.label = resolveLabel(); this.availableComponents = resolveAvailableComponents(); this.inherit = isInheritanceEnabled(); this.optional = resolveOptional(); this.editable = resolveEditable(); this.description = templateDefinition.getDescription(); // build an adhoc area definition if no area definition can be resolved if(this.areaDefinition == null){ buildAdHocAreaDefinition(); }
When areaDefinition is null, whole condition will be evaluated as false and will return on the next line never reaching code below that would actually create it ad-hoc.
Either it should be created in which case whole code should be refactored, or it should not in which case second if clause should be removed.
While we are at it, what is the reason for AreaDefinition#isEnabled() returning boolean object rather then primitive?
Acceptance criteria