ical4j icon indicating copy to clipboard operation
ical4j copied to clipboard

CalendarValidatorImpl is still validating components even when validiate recursive is false

Open fizzyfuzzle opened this issue 6 years ago • 0 comments

Describe the bug When validating the icalendar object with recursive set to FALSE (calendar.validate(false)), it's still validating the components.

public void validate(boolean recurse) throws ValidationException {
    this.validator.validate(this);
    if (recurse) {
        this.validateProperties();
        this.validateComponents();
    }
}

This is caused by the following code inside the CalendarValidatorImpl.java validator:

// perform ITIP validation on components..
if (method != null) {
  for (CalendarComponent component : target.getComponents()) {
    component.validate(method);
  }
}

Expected behavior Don't validate the components of the icalendar object if recursive validation is set to FALSE.

Environment (please complete the following information):

  • OS: Linux
  • Java Version 8
  • ical4j v3.0.11

fizzyfuzzle avatar Oct 11 '19 07:10 fizzyfuzzle