Skip to content

Numbers are not correctly detected resulting in a NumberFormatException #31

Open
@JanHolger

Description

@JanHolger

Describe the Bug
We detected numbers based on certain characters but we don't validate that they actually match the syntax of a number. Instead of throwing a proper exception we hand the value to parseLong/parseDouble resulting in a NumberFormatException being thrown

To Reproduce
Steps to reproduce the behavior:

AbstractElement.fromJson("--")

Expected behavior
It should fail fast and throw a proper exception

Screenshots / Logs
If applicable, add screenshots and/or logs to help explain your problem. You can use pastefy.ga to upload large text snippets.

Environment Information:

  • Java Language Level 8
  • Version 1.0.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions