Project

General

Profile

Actions

Defect #1800

closed

Default contract code is hardcoded in AbstractContractSetEavTreesProcessor

Added by Vladimír Kotýnek over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Marek Klement
Target version:
Start date:
08/15/2019
Due date:
% Done:

100%

Estimated time:
Affected versions:
Owner:

Description

In current state when you change the code of the "default" EAV definition of the contract form "default" to anything else, you will get NullPointerException when createing a new identity.

2019-08-15 19:23:15.649 ERROR 21977 --- [io-8080-exec-15] e.b.i.c.a.e.AbstractEntityEventProcessor : [core:EVENT_EXECUTE_PROCESSOR_FAILED:aa7a955b-63e8-4252-9b1d-7f20611a73c2] Event [null] failed in processor [identity-save-processor]. ({eventId=null, processor=identity-save-processor})

java.lang.NullPointerException: null
    at eu.bcvsolutions.idm.extras.event.processor.contract.AbstractContractSetEavTreesProcessor.actualProcess(AbstractContractSetEavTreesProcessor.java:75)
    at eu.bcvsolutions.idm.extras.event.processor.contract.IdentityContractSetEavTreesProcessor.process(IdentityContractSetEavTreesProcessor.java:38)
    at eu.bcvsolutions.idm.core.api.event.AbstractEntityEventProcessor.onApplicationEvent(AbstractEntityEventProcessor.java:238)

The code of the definition is hardcoded as a constant in public interface IdmFormDefinitionService as String DEFAULT_DEFINITION_CODE = "default"; and used in class AbstractContractSetEavTreesProcessor in method public void actualProcess(IdmIdentityContractDto contract)
This seems like an inappropriate usage of the constant, as the comment says "Default definition name for type (if no name is given)". You should search for the main definition instead of using the default name for look up.

Actions

Also available in: Atom PDF