Skip to content

Root cause for failing test for testMangledIntsBytes() in ParserErrorHandlingTest #1035

@harsha-99

Description

@harsha-99

I was looking at the failing tests directory and was trying to debug the failing tests in ParseErrorHandling105Test.java file, I realised there was a similar test commented out in ParserErrorHandlingTest.java under package com.fasterxml.jackson.core.read in line 29 i.e. _testMangledNumbersInt(MODE_DATA_INPUT);
I saw a comment wondering how _testMangledNumbersFloat(MODE_DATA_INPUT); was working.

With my investigation I found out that during _testMangledNumbersIn() execution, _verifyRootSpace() in line 1088 of UTF8DataInputJsonParser.java gets called with _nextByte = -1 and hence satisfies the condition in line 1278 i.e. if (ch <= INT_SPACE) hence doesn't throw a missing WS error. Where as for _testMangledNumbersFloat we set the value as _nextByte = c; in line 1257 and hence it would throw the exception.

I hope this explains the root cause of the issue, happy to receive any feedback or suggestions. Apologies for my verbose explanation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions