Buggy code:
public class InternalValidatorInstance { private static final String POSTNUMMER_FORMAT = "\\d{3}\\s?\\d{2}" ; private static Logger LOG = LoggerFactory . getLogger ( InternalValidatorInstance . class ) ; private ValidateDraftResponseHolder validationResponse ; protected ValidationContext context ; public InternalValidatorInstance ( ) { } public ValidateDraftResponseHolder validate ( Utlatande utlatande ) { } private void validateHypoglykemi ( Hypoglykemier hypoglykemier ) { if ( hypoglykemier == null ) { addValidationError ( "hypoglykemier" , "ts.validation.hypoglykemier.missing" ) ; return ; } if ( ( hypoglykemier . getKunskapOmAtgarder ( ) ) == null ) { addValidationError ( "hypoglykemier.kunskapOmAtgarder" , "ts.validation.hypoglykemier.kunskap-om-atgarder.missing" ) ; } if ( ( hypoglykemier . getTeckenNedsattHjarnfunktion ( ) ) == null ) { addValidationError ( "hypoglykemier.teckenNedsattHjarnfunktion" , "ts.validation.hypoglykemier.tecken-nedsatt-hjarnfunktion.missing" ) ; } if ( isTrue ( hypoglykemier . getTeckenNedsattHjarnfunktion ( ) ) ) { if ( ( hypoglykemier . getSaknarFormagaKannaVarningstecken ( ) ) == null ) { addValidationError ( "hypoglykemier.saknarFormagaKannaVarningstecken" , "ts.validation.hypoglykemier.saknar-formaga-kanna-varningstecken.missing" ) ; } if ( ( hypoglykemier . getAllvarligForekomst ( ) ) == null ) { <START_BUG> addValidationError ( "hypoglykemier.allvarligForekomst" , "ts.validation.hypoglykemier.allvarligForekomst.missing" ) ; <END_BUG> } if ( ( hypoglykemier . getAllvarligForekomstTrafiken ( ) ) == null ) { addValidationError ( "hypoglykemier.allvarligForekomstTrafiken" , "ts.validation.hypoglykemier.allvarlig-forekomst-trafiken.missing" ) ; } } if ( isTrue ( hypoglykemier . getAllvarligForekomst ( ) ) ) { if ( hypoglykemier . getAllvarligForekomst ( ) ) { assertDescriptionNotEmpty ( hypoglykemier . getAllvarligForekomstBeskrivning ( ) , "hypoglykemier.allvarligForekomstBeskrivning" , "ts.validation.hypoglykemier.allvarlig-forekomst.beskrivning.missing" ) ; } } if ( isTrue ( hypoglykemier . getAllvarligForekomstTrafiken ( ) ) ) { if ( hypoglykemier . getAllvarligForekomstTrafiken ( ) ) { assertDescriptionNotEmpty ( hypoglykemier . getAllvarligForekomstTrafikBeskrivning ( ) , "hypoglykemier.allvarligForekomstTrafikBeskrivning" , "ts.validation.hypoglykemier.allvarlig-forekomst-trafiken.beskrivning.missing" ) ; } } if ( isTrue ( hypoglykemier . getAllvarligForekomstVakenTid ( ) ) ) { if ( hypoglykemier . getAllvarligForekomstVakenTid ( ) ) { if ( ( hypoglykemier . getAllvarligForekomstVakenTidObservationstid ( ) ) == null ) { addValidationError ( "hypoglykemier.allvarligForekomstVakenTidObservationstid" , "ts.validation.hypoglykemier.allvarlig-forekomst-vaken-tid.observationstid.missing" ) ; } else if ( ! ( isValidDate ( hypoglykemier . getAllvarligForekomstVakenTidObservationstid ( ) , "yyyy-mm-dd" ) ) ) { addValidationError ( "hypoglykemier.allvarligForekomstVakenTidObservationstid" , "ts.validation.hypoglykemier.allvarlig-forekomst-vaken-tid.observationstid.incorrect-date" ) ; } } } if ( context . isHogreBehorighetContext ( ) ) { if ( ( hypoglykemier . getEgenkontrollBlodsocker ( ) ) == null ) { addValidationError ( "hypoglykemier.egenkontrollBlodsocker" , "ts.validation.hypoglykemier.egenkontroll-blodsocker.missing" ) ; } if ( ( hypoglykemier . getAllvarligForekomstVakenTid ( ) ) == null ) { addValidationError ( "hypoglykemier.allvarligForekomstVakenTid" , "ts.validation.hypoglykemier.allvarlig-forekomst-vaken-tid.missing" ) ; } } } private void validateIdentitetStyrkt ( Vardkontakt vardkontakt ) { } private void validateBedomning ( final Bedomning bedomning ) { } private void validateDiabetes ( final Diabetes diabetes ) { } private void validateHoSPersonal ( final HoSPersonal skapadAv ) { } private void validateIntygAvser ( final IntygAvser intygAvser ) { } private void validateSyn ( final Syn syn ) { } private boolean isValidDate ( String dateString , String dateFormat ) { } private boolean isTrue ( Boolean bool ) { } private boolean isFalse ( Boolean bool ) { } private InternalValidatorInstance . AssertionResult assertDescriptionNotEmpty ( String beskrivning , String field , String errorCode ) { } private ValidationStatus getValidationStatus ( ) { } private void addValidationError ( String field , String msg ) { } protected static enum AssertionResult { SUCCESS ( true ) , FAILURE ( false ) ; private AssertionResult ( boolean assertSuccessfull ) { } private final boolean assertSuccessful ; public boolean failed ( ) { } public boolean success ( ) { } } }

Fix:
addValidationError ( "hypoglykemier.allvarligForekomst" , "ts.validation.hypoglykemier.allvarlig-forekomst.missing" ) ;