Buggy code:
public class PropertiesIntegrityEvent extends AbstractIntegrityEvent { private static Log logger = LogFactory . getLog ( PropertiesIntegrityEvent . class ) ; protected PropertiesIntegrityEvent ( NodeService nodeService , DictionaryService dictionaryService , NodeRef nodeRef ) { } public void checkIntegrity ( List < IntegrityRecord > eventResults ) { } private void checkAllProperties ( NodeRef nodeRef , List < IntegrityRecord > eventResults ) { } private void checkAllProperties ( NodeRef nodeRef , QName typeQName , Collection < PropertyDefinition > propertyDefs , Map < QName , Serializable > nodeProperties , Collection < IntegrityRecord > eventResults ) { if ( ( propertyDefs == null ) || ( propertyDefs . isEmpty ( ) ) ) { return ; } for ( PropertyDefinition propertyDef : propertyDefs ) { QName propertyQName = propertyDef . getName ( ) ; <START_BUG> if ( ( ( propertyDef . isMandatory ( ) ) && ( propertyDef . isMandatoryEnforced ( ) ) ) && ( ! ( nodeProperties . containsKey ( propertyQName ) ) ) ) { <END_BUG> String nameProp = ( ( String ) ( nodeService . getProperty ( nodeRef , PROP_NAME ) ) ) ; IntegrityRecord result = new IntegrityRecord ( ( ( ( ( ( ( ( ( ( "Mandatory<seq2seq4repair_space>property<seq2seq4repair_space>not<seq2seq4repair_space>set:<seq2seq4repair_space>\n" + "<seq2seq4repair_space>Node:<seq2seq4repair_space>" ) + nodeRef ) + "\n" ) + ( nameProp != null ? ( "<seq2seq4repair_space>Name:<seq2seq4repair_space>" + nameProp ) + "\n" : "" ) ) + "<seq2seq4repair_space>Type:<seq2seq4repair_space>" ) + typeQName ) + "\n" ) + "<seq2seq4repair_space>Property:<seq2seq4repair_space>" ) + propertyQName ) ) ; eventResults . add ( result ) ; continue ; } Serializable propertyValue = nodeProperties . get ( propertyQName ) ; if ( propertyDef . getDataType ( ) . getName ( ) . equals ( ENCRYPTED ) ) { if ( ( propertyValue != null ) && ( ! ( propertyValue instanceof SealedObject ) ) ) { String nameProp = ( ( String ) ( nodeService . getProperty ( nodeRef , PROP_NAME ) ) ) ; IntegrityRecord result = new IntegrityRecord ( ( ( ( ( ( ( ( ( ( "Property<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>encrypted:<seq2seq4repair_space>\n" + "<seq2seq4repair_space>Node:<seq2seq4repair_space>" ) + nodeRef ) + "\n" ) + ( nameProp != null ? ( "<seq2seq4repair_space>Name:<seq2seq4repair_space>" + nameProp ) + "\n" : "" ) ) + "<seq2seq4repair_space>Type:<seq2seq4repair_space>" ) + typeQName ) + "\n" ) + "<seq2seq4repair_space>Property:<seq2seq4repair_space>" ) + propertyQName ) ) ; eventResults . add ( result ) ; } } List < ConstraintDefinition > constraintDefs = propertyDef . getConstraints ( ) ; for ( ConstraintDefinition constraintDef : constraintDefs ) { Constraint constraint = constraintDef . getConstraint ( ) ; try { constraint . evaluate ( propertyValue ) ; } catch ( ConstraintException e ) { String nameProp = ( ( String ) ( nodeService . getProperty ( nodeRef , PROP_NAME ) ) ) ; IntegrityRecord result = new IntegrityRecord ( ( ( ( ( ( ( ( ( ( ( ( ( "Invalid<seq2seq4repair_space>property<seq2seq4repair_space>value:<seq2seq4repair_space>\n" + "<seq2seq4repair_space>Node:<seq2seq4repair_space>" ) + nodeRef ) + "\n" ) + ( nameProp != null ? ( "<seq2seq4repair_space>Name:<seq2seq4repair_space>" + nameProp ) + "\n" : "" ) ) + "<seq2seq4repair_space>Type:<seq2seq4repair_space>" ) + typeQName ) + "\n" ) + "<seq2seq4repair_space>Property:<seq2seq4repair_space>" ) + propertyQName ) + "\n" ) + "<seq2seq4repair_space>Constraint:<seq2seq4repair_space>" ) + ( e . getMessage ( ) ) ) ) ; eventResults . add ( result ) ; continue ; } } } } }

Fix:
if ( ( ( propertyDef . isMandatory ( ) ) && ( propertyDef . isMandatoryEnforced ( ) ) ) && ( ( ! ( nodeProperties . containsKey ( propertyQName ) ) ) || ( null == ( nodeProperties . get ( propertyQName ) ) ) ) ) {