Skip to content

8360122: Fix java.sql\Connection.java indentation #25925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gustavosimon
Copy link
Contributor

@gustavosimon gustavosimon commented Jun 22, 2025

8360122: Refine formatting of Connection.java interface


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8360122: Fix java.sql\Connection.java indentation (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25925/head:pull/25925
$ git checkout pull/25925

Update a local copy of the PR:
$ git checkout pull/25925
$ git pull https://git.openjdk.org/jdk.git pull/25925/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25925

View PR using the GUI difftool:
$ git pr show -t 25925

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25925.diff

Using Webrev

Link to Webrev Comment


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8360122: Fix java.sql\Connection.java indentation (Bug - P4)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25925/head:pull/25925
$ git checkout pull/25925

Update a local copy of the PR:
$ git checkout pull/25925
$ git pull https://git.openjdk.org/jdk.git pull/25925/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 25925

View PR using the GUI difftool:
$ git pr show -t 25925

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25925.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 22, 2025

👋 Welcome back gustavosimon! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jun 22, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Jun 22, 2025

@gustavosimon The following label will be automatically applied to this pull request:

  • core-libs

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added core-libs [email protected] rfr Pull request is ready for review labels Jun 22, 2025
@mlbridge
Copy link

mlbridge bot commented Jun 22, 2025

Webrevs

@gustavosimon
Copy link
Contributor Author

gustavosimon commented Jun 23, 2025

@liach Can you review this PR or assign someone that might be able to review?

Copy link
Contributor

@RogerRiggs RogerRiggs left a comment

Choose a reason for hiding this comment

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

The indentation fixes look ok.
The reformatting of declarations seem unnecessary and create lines that are longer than desirable to be able to do side-by-side compares (100 char max).
Generally, avoid just asking the IDE to re-format the source, it leads to unnecessary changes.

@liach
Copy link
Member

liach commented Jun 23, 2025

FYI people don't usually review on weekends (you opened this PR in a weekend) or holidays. This PR is sent to core-libs-dev list so people will eventually see and review it.

@gustavosimon
Copy link
Contributor Author

gustavosimon commented Jun 23, 2025

The indentation fixes look ok. The reformatting of declarations seem unnecessary and create lines that are longer than desirable to be able to do side-by-side compares (100 char max). Generally, avoid just asking the IDE to re-format the source, it leads to unnecessary changes.

I'm going to undo the formatting changes where lines exceed 100 characters. Actually, I didn’t ask the IDE to reformat; I only suggested this formatting to improve readability. However, it can make comparisons in the diff view more difficult.

@RogerRiggs Thanks for the review! 😃

@gustavosimon
Copy link
Contributor Author

FYI people don't usually review on weekends (you opened this PR in a weekend) or holidays. This PR is sent to core-libs-dev list so people will eventually see and review it.

Great, @liach! Thanks for the information! 😄

@gustavosimon
Copy link
Contributor Author

@RogerRiggs I have just commited the changes to not exceed the 100 chars limit.

@gustavosimon gustavosimon requested a review from RogerRiggs June 23, 2025 17:15
Comment on lines 1596 to 1597
ShardingKey superShardingKey,
int timeout) throws SQLException {
Copy link
Contributor

Choose a reason for hiding this comment

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

I haven't quite identified your preferred formatting style.
From previous reformattings with multiple arguments, the exception was placed on a line by itself.

(Generally, we defer to the original/previous author's choice of line breaks and formatting.
Choosing only to reformat to use a consistent style within each file/class or package.)

The issue title and PR title should be a bit more general, its more than just indentation cleanup.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@RogerRiggs My preferred formatting style is like this:

    default boolean setShardingKeyIfValid(ShardingKey shardingKey,
                                          ShardingKey superShardingKey,
                                          int timeout) throws SQLException {

But as you said, there is previous reformattings that does not follow it. If you agree, I will fix them. What do you thing about it?

About the issue title and PR title, we can make it more general like:

"Improve Readability and Maintainability of Connection.java"

What your suggestion on it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would backout the changes to signatures, fixing the bad indentation and leave it at that.
Lance is one of the long time maintainers of the SQL classes and will want to take a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great! I will do that.

@LanceAndersen
Copy link
Contributor

I might not have time this week to look at this as I have some other commitments. I do think we will want to narrow the changes being proposed

Copy link
Member

@liach liach left a comment

Choose a reason for hiding this comment

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

The current version looks much better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs [email protected] rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

4 participants