JavaWebStack / JavaWebStack/abstract-data

Numbers are not correctly detected resulting in a NumberFormatException

Open
#31 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
1
Forks
1
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at AbstractElement.fromJson("--") and trace the numeric detection and parsing path. Reproduce the failure on Java 8, then verify that invalid numeric syntax fails fast with the library's proper exception rather than NumberFormatException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.