Skip to content

Conversation

@Jagdish-Singh-Bisht
Copy link

This PR addresses LANG-1806 as a small follow-up to LANG-1695.

NumberUtils.isParsable currently rejects strings such as "1.f" and "1.d", even though Float.parseFloat("1.f") and Double.parseDouble(1.d") succeed.

The test suite already contained TODOs for these cases, this change uncomments those assertions and updates the parsing logic to allow floating-point suffixes (f/F/d/D) only when they appear as the final character.

The change is intentionally minimal and doesn not affect other numeric formats.

Copy link
Member

@garydgregory garydgregory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Jagdish-Singh-Bisht

This PR doesn't handle:

  • 1.2e-5d
  • 1.2e-5f

You did not follow the instructions in the PR template:

  • Run mvn
  • Fix all errors
  • Also remove the extra blank lines.

Rebase on git master where I added test TODOs for the above.

@Jagdish-Singh-Bisht
Copy link
Author

Thanks for the review.

Understood regarding the scientific notation cases (1.2e-5d / 1.2e-5f).
I'll rebase on current master, address those cases, clean-up formatting, and confirm mvn test before updating the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants