Buggy code:
public class StandardInputRenderer extends InputRenderer { private String rowClasses ; private String columnClasses ; private String validatorClasses ; private boolean hideValidators ; private String labelTerminator ; private boolean displayLabel = Boolean . TRUE ; private boolean requiredMessageShown = true ; private boolean optionalMarkShown = false ; private String helpNoJavascriptClasses ; private String helpClosedClasses ; private String helpOpenClasses ; private String helpTextClasses ; private String helpImageIcon ; public boolean isDisplayLabel ( ) { } public void setDisplayLabel ( boolean displayLabel ) { } public StandardInputRenderer ( ) { } public String getColumnClasses ( ) { } public void setColumnClasses ( String columnClasses ) { } public String getRowClasses ( ) { } public void setRowClasses ( String rowClasses ) { } public boolean isHideValidators ( ) { } public void setHideValidators ( boolean hideValidators ) { } public String getValidatorClasses ( ) { } public void setValidatorClasses ( String validatorClasses ) { } public String getLabelTerminator ( ) { } public void setLabelTerminator ( String labelTerminator ) { } @ Override protected Layout getLayout ( Object object , Class type ) { } class ObjectInputFormLayout extends FormLayout { private final MetaObject object ; private final Map < Integer , Validatable > inputComponents ; public ObjectInputFormLayout ( MetaObject object ) { } @ Override public int getNumberOfRows ( ) { } @ Override public String getLabelText ( int rowIndex ) { } @ Override public HtmlComponent getRenderedSlot ( int rowIndex ) { } @ Override public Supplier < Optional < String > > getValidationError ( int rowIndex ) { if ( isHideValidators ( ) ) { return Optional :: empty ; } Validatable inputComponent = inputComponents . get ( rowIndex ) ; if ( inputComponent != null ) { HtmlChainValidator chainValidator = getChainValidator ( inputComponent , this . object . getSlots ( ) . get ( rowIndex ) ) ; if ( ( chainValidator != null ) && ( ! ( chainValidator . isEmpty ( ) ) ) ) { return ( ) -> { if ( chainValidator . isValid ( ) ) { return Optional . empty ( ) ; } else { <START_BUG> return Optional . of ( chainValidator . getErrorMessage ( ) ) ; <END_BUG> } } ; } } return Optional :: empty ; } @ Override public Optional < String > getHelpLabel ( int rowIndex ) { } @ Override public boolean displayLabel ( ) { } } class ObjectInputTabularLayout { public ObjectInputTabularLayout ( MetaObject object ) { } protected HtmlComponent renderHelpOnComponent ( HtmlComponent renderedSlot , String bundle , String helpLabel , String slotName ) { } protected String getScript ( String id , String classes ) { } } public boolean isOptionalMarkShown ( ) { } public void setOptionalMarkShown ( boolean optionalMarkShown ) { } public boolean isRequiredMessageShown ( ) { } public void setRequiredMessageShown ( boolean requiredMessageShown ) { } public String getHelpImageIcon ( ) { } public void setHelpImageIcon ( String helpImageIcon ) { } public String getHelpNoJavascriptClasses ( ) { } public void setHelpNoJavascriptClasses ( String helpNoJavascript ) { } public String getHelpClosedClasses ( ) { } public void setHelpClosedClasses ( String helpClosed ) { } public String getHelpOpenClasses ( ) { } public void setHelpOpenClasses ( String helpOpen ) { } public String getHelpTextClasses ( ) { } public void setHelpTextClasses ( String helpTextClasses ) { } }

Fix:
return Optional . ofNullable ( chainValidator . getErrorMessage ( ) ) ;