Buggy code:
public class ValidationReport implements HasPropertyChangeSupport { public static final String DELETED_PROPERTY = "deleted" ; public static final String REPORT_MODE_PROPERTY = "reportMode" ; public static final String VALIDATION_START = "validationStart" ; public static final String VALIDATION_END = "validationEnd" ; public static final String VALIDATION_OBJECT = "validateObject" ; public static final String OBJECT_VALIDATION_START = "objectValidation" ; public static final String VALIDATE_WITH_RULE = "validateWithRule" ; public enum ReportMode { ALL , ERRORS , WARNINGS ; public String getLocalizedName ( ) { } } @ SuppressWarnings ( "unused" ) private static final Logger logger = Logger . getLogger ( ValidationReport . class . getPackage ( ) . getName ( ) ) ; private final Validable rootObject ; private final PropertyChangeSupport pcSupport ; private final List < ValidationIssue < ? , ? > > allIssues ; private final List < InformationIssue < ? , ? > > infoIssues ; private final List < ValidationError < ? , ? > > errors ; private final List < ValidationWarning < ? , ? > > warnings ; private final Map < Validable , List < InformationIssue < ? , ? > > > infoIssuesMap ; private final Map < Validable , List < ValidationError < ? , ? > > > errorsMap ; private final Map < Validable , List < ValidationWarning < ? , ? > > > warningsMap ; private final ValidationModel validationModel ; protected ValidationReport . ReportMode mode = ValidationReport . ReportMode . ALL ; @ SuppressWarnings ( "unchecked" ) protected ValidationReport ( ValidationModel validationModel , Validable rootObject ) throws InterruptedException { } @ Override public PropertyChangeSupport getPropertyChangeSupport ( ) { } @ Override public String getDeletedProperty ( ) { } public ValidationReport . ReportMode getReportMode ( ) { } public void setReportMode ( ValidationReport . ReportMode mode ) { } private List < ValidationIssue < ? , ? > > performDeepValidation ( Validable rootObject ) throws InterruptedException { } private < V extends Validable > List < ValidationIssue < ? , ? > > performValidation ( V validable ) { } private < R extends ValidationRule < R , V > , V extends Validable > ValidationIssue < R , V > performRuleValidation ( R rule , V next ) { } public void revalidate ( Validable validable ) { } public Collection < Validable > retrieveAllEmbeddedValidableObjects ( Validable o ) { } private void appendAllEmbeddedValidableObjects ( Validable o , Collection < Validable > c ) { <START_BUG> if ( o != null ) { <END_BUG> c . add ( o ) ; Collection < ? extends Validable > embeddedObjects = o . getEmbeddedValidableObjects ( ) ; if ( embeddedObjects != null ) { for ( Validable o2 : embeddedObjects ) { appendAllEmbeddedValidableObjects ( o2 , c ) ; } } } } public List < ? extends ValidationIssue < ? , ? > > getFilteredIssues ( ) { } public int getIssuesCount ( ) { } public int getInfosCount ( ) { } public int getWarningsCount ( ) { } public int getErrorsCount ( ) { } public List < ValidationIssue < ? , ? > > getAllIssues ( ) { } public List < ValidationError < ? , ? > > getErrors ( ) { } public List < ValidationWarning < ? , ? > > getWarnings ( ) { } public List < InformationIssue < ? , ? > > getInfoIssues ( ) { } protected void addToValidationIssues ( ValidationIssue < ? , ? > issue ) { } protected void removeFromValidationIssues ( ValidationIssue < ? , ? > issue ) { } public ValidationModel getValidationModel ( ) { } public Validable getRootObject ( ) { } public Collection < ValidationIssue < ? , ? > > issuesRegarding ( Validable object ) { } public List < ValidationIssue < ? , ? > > issuesRegarding ( ValidationRule < ? , ? > rule ) { } public String reportAsString ( ) { } public void delete ( ) { } }

Fix:
if ( ( o != null ) && ( ! ( c . contains ( o ) ) ) ) {