GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Guard Values against null/empty values by pingpingy1 · Pull Request #1965 · JSQLParser/JSqlParser

Conversation

@pingpingy1

@pingpingy1 pingpingy1 commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

This PR intends to implement suitable guards for the constructors of the classes DoubleValue, LongValue, and TimeValue.
Both null and empty strings provided to their constructors fail, but they provide very different error messages (NullPointerException and StringIndexOutOfBoundsException),
which is neither sensible nor helpful in debugging.
This PR adds a guard to throw IllegalArgumentException for both cases in order to improve coherency and usefulness of the error messages.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@pingpingy1
Guard Values against null/empty values
552b8c1
The classes modified by this commit are `DoubleValue`, `LongValue`, and
`TimeValue`. Both `null` and empty strings provided to their
constructors fail, but they provide very different error messages
(NullPointerException and StringIndexOutOfBoundsException), which is
neither sensible nor helpful in debugging.
This commit adds a guard to throw `IllegalArgumentException` for both
cases in order to improve coherency and usefulness of the error
messages.
@manticore-projects

manticore-projects commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

Looks good.
Please fix the formatting by running:

./gradlew :spotlessApply

and then I would merge.

pingpingy1 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pingpingy1
fix checkstyle issues
0bce464
@pingpingy1

pingpingy1 commented Feb 14, 2024

Copy link
Copy Markdown
Contributor Author

@manticore-projects Thank you for the swift response.
I believe that should have fixed it; PTAL.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@manticore-projects
manticore-projects merged commit b00322e into JSQLParser:master Feb 14, 2024
@manticore-projects

manticore-projects commented Feb 14, 2024

Copy link
Copy Markdown
Contributor

Thank you for your contribution, much appreciated!

pingpingy1 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@pingpingy1 @manticore-projects
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.