Skip to content

readValues(null) causes infinite loop #122

@andyeko

Description

@andyeko
@Test
public void testEmptyStream() throws InterruptedException {
    log.info("Start");
    SimpleModule module = new SimpleModule();
    CsvMapper csvMapper = new CsvMapper();
    csvMapper.registerModule(module);
    try {
        InputStreamReader reader = null;
        CsvSchema columns = CsvSchema.emptySchema().withHeader().withColumnSeparator(';');
        csvMapper.readerFor(Map.class).with(columns).readValues(reader);
    } catch (IOException e) {
        log.warn("Can't read data from csv file {}", e);
    }
    log.info("finish");
}

provided code can freeze execution of the thread completely
tested with: 2.9.8 version

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions