Source:
protected void doValidate(final String effectiveTime, IProgressMonitor monitor) { if (!effectiveTimes.contains(effectiveTime)) { return; } final Stopwatch watch = Stopwatch.createStarted(); final String effectiveTimeMessage = effectiveTime.length() == 0 ? "Unpublished" : effectiveTime; final String message = String.format("Validating %s file in '%s'...", importType.getDisplayName(), effectiveTimeMessage); monitor.beginTask(message, 1); validationContext.getLogger().trace(message); final int expectedNumberOfColumns = this.expectedHeader.length; try (final BufferedReader reader = getReleaseFileReader(effectiveTime)) { int lineNumber = 0; while (true) { final String line = reader.readLine(); if (null == line) { break; } lineNumber++; final List<String> row = TAB_SPLITTER.splitToList(line); final String incomingEffectiveTime = row.get(1); if (!Strings.isNullOrEmpty(effectiveTime) && !Strings.isNullOrEmpty(incomingEffectiveTime)) { if (!EffectiveTimes.parse(incomingEffectiveTime, DateFormats.SHORT).before(EffectiveTimes.parse(effectiveTime, DateFormats.SHORT))) { continue; } } if (row.size() != expectedNumberOfColumns) { addDefect(DefectType.INCORRECT_COLUMN_NUMBER, String.format("Expected '%s' number of columns, but got '%s' in file %s", expectedNumberOfColumns, row.size(), releaseFileName)); continue; } if (!importType.equals(ComponentImportType.CONCEPT)) { validateModuleId(row, lineNumber); } doValidate(row); } } catch (final IOException e) { throw new ImportException(MessageFormat.format("Exception when reading {0}s for validating.", importType.getDisplayName()), e); } finally { monitor.worked(1); validationContext.getLogger().trace("Validated file in '{}' [{}]", importType.getDisplayName(), effectiveTimeMessage, watch); } addDefect(DefectType.MODULE_CONCEPT_NOT_EXIST, moduleIdNotExist); addDefect(DefectType.INVALID_EFFECTIVE_TIME_FORMAT, invalidEffectiveTimeFormat); }

Target:
protected void doValidate(final String effectiveTime, IProgressMonitor monitor) { if (!effectiveTimes.contains(effectiveTime)) { return; } final Stopwatch watch = Stopwatch.createStarted(); final String effectiveTimeMessage = effectiveTime.length() == 0 ? "Unpublished" : effectiveTime; final String message = String.format("Validating %s file in '%s'...", importType.getDisplayName(), effectiveTimeMessage); monitor.beginTask(message, 1); validationContext.getLogger().trace(message); final int expectedNumberOfColumns = this.expectedHeader.length; try (final BufferedReader reader = getReleaseFileReader(effectiveTime)) { int lineNumber = 0; while (true) { final String line = reader.readLine(); if (null == line) { break; } lineNumber++; final List<String> row = TAB_SPLITTER.splitToList(line); if (!SPECIAL_EFFECTIVE_TIME_KEY.equals(effectiveTime) && !effectiveTime.equals(row.get(1))) { continue; } if (row.size() != expectedNumberOfColumns) { addDefect(DefectType.INCORRECT_COLUMN_NUMBER, String.format("Expected '%s' number of columns, but got '%s' in file %s", expectedNumberOfColumns, row.size(), releaseFileName)); continue; } if (!importType.equals(ComponentImportType.CONCEPT)) { validateModuleId(row, lineNumber); } doValidate(row); } } catch (final IOException e) { throw new ImportException(MessageFormat.format("Exception when reading {0}s for validating.", importType.getDisplayName()), e); } finally { monitor.worked(1); validationContext.getLogger().trace("Validated file in '{}' [{}]", importType.getDisplayName(), effectiveTimeMessage, watch); } addDefect(DefectType.MODULE_CONCEPT_NOT_EXIST, moduleIdNotExist); addDefect(DefectType.INVALID_EFFECTIVE_TIME_FORMAT, invalidEffectiveTimeFormat); }