@Override
  public Optional<ReadError> read(DbFileSources.Line.Builder lineBuilder) {
    if (readError == null) {
      try {
        processSymbols(lineBuilder);
      } catch (RangeOffsetConverter.RangeOffsetConverterException e) {
        readError = new ReadError(Data.SYMBOLS, lineBuilder.getLine());
        LOG.warn(format("Inconsistency detected in Symbols data. Symbols will be ignored for file '%s'", file.getKey()), e);
      }
    }
    return Optional.ofNullable(readError);
  }
@Test
  public void read_symbols_defined_on_many_lines() {
    TextRange declaration = newTextRange(LINE_1, LINE_2, OFFSET_1, OFFSET_3);
    when(rangeOffsetConverter.offsetToString(declaration, LINE_1, DEFAULT_LINE_LENGTH)).thenReturn(RANGE_LABEL_1);
    when(rangeOffsetConverter.offsetToString(declaration, LINE_2, DEFAULT_LINE_LENGTH)).thenReturn(RANGE_LABEL_2);

    TextRange reference = newTextRange(LINE_3, LINE_4, OFFSET_1, OFFSET_3);
    when(rangeOffsetConverter.offsetToString(reference, LINE_3, DEFAULT_LINE_LENGTH)).thenReturn(RANGE_LABEL_1);
    when(rangeOffsetConverter.offsetToString(reference, LINE_4, DEFAULT_LINE_LENGTH)).thenReturn(RANGE_LABEL_2);

    SymbolsLineReader symbolsLineReader = newReader(newSymbol(declaration, reference));

    assertThat(symbolsLineReader.read(line1)).isEmpty();
    assertThat(symbolsLineReader.read(line2)).isEmpty();
    assertThat(symbolsLineReader.read(line3)).isEmpty();
    assertThat(symbolsLineReader.read(line4)).isEmpty();

    assertThat(line1.getSymbols()).isEqualTo(RANGE_LABEL_1 + ",1");
    assertThat(line2.getSymbols()).isEqualTo(RANGE_LABEL_2 + ",1");
    assertThat(line3.getSymbols()).isEqualTo(RANGE_LABEL_1 + ",1");
    assertThat(line4.getSymbols()).isEqualTo(RANGE_LABEL_2 + ",1");
  }