Skip to content

docs: Update SpannerSample.java to align with best practices #3625

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 11 commits into
base: main
Choose a base branch
from

Conversation

adhiggs
Copy link

@adhiggs adhiggs commented Feb 1, 2025

docs: update SpannerSample.java to align with best practices

Encapsulates both ResultSet statements in try-with-resources statements to align with best practices.

Fixes #3623 ☕️

Encapsulates both statements in a try-with-resources statement
@adhiggs adhiggs requested review from a team as code owners February 1, 2025 02:29
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/java-spanner API. labels Feb 1, 2025
@adhiggs adhiggs changed the title Update SpannerSample.java fix: Update SpannerSample.java to align with best practices Feb 1, 2025
@adhiggs adhiggs changed the title fix: Update SpannerSample.java to align with best practices fix:Update SpannerSample.java to align with best practices Feb 1, 2025
@adhiggs adhiggs changed the title fix:Update SpannerSample.java to align with best practices docs: Update SpannerSample.java to align with best practices Feb 1, 2025
@adhiggs
Copy link
Author

adhiggs commented Feb 1, 2025

I don't work with github very often, so if I can get a hand in getting the tests passed, I would greatly appreciate it.

@sakthivelmanii
Copy link
Collaborator

@adhiggs please update your commit message to follow the convention. https://www.conventionalcommits.org/en/v1.0.0/

@adhiggs
Copy link
Author

adhiggs commented Feb 10, 2025

@adhiggs please update your commit message to follow the convention. https://www.conventionalcommits.org/en/v1.0.0/

@sakthivelmanii - I think I got it? PTAL.

@adhiggs
Copy link
Author

adhiggs commented May 13, 2025

@sakthivelmanii - Could you take a look at this request?

sakthivelmanii
sakthivelmanii previously approved these changes May 14, 2025
Copy link
Collaborator

@sakthivelmanii sakthivelmanii left a comment

Choose a reason for hiding this comment

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

Please fix the code issue

@sakthivelmanii sakthivelmanii added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 14, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 14, 2025
@sakthivelmanii sakthivelmanii added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2025
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 15, 2025
@sakthivelmanii
Copy link
Collaborator

sakthivelmanii commented May 15, 2025

Please fix the checkstyle issues.

Error:  src/main/java/com/example/spanner/SpannerSample.java:[685,7] (indentation) Indentation: 'while' has incorrect indentation level 6, expected level should be 8.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[686,[9](https://github.com/googleapis/java-spanner/actions/runs/15027603684/job/42257173380?pr=3625#step:4:10)] (indentation) Indentation: 'while' child has incorrect indentation level 8, expected level should be 10.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[689,7] (indentation) Indentation: 'while rcurly' has incorrect indentation level 6, expected level should be 8.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[690,5] (indentation) Indentation: 'try rcurly' has incorrect indentation level 4, expected level should be 6.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[691,5] (indentation) Indentation: 'try' has incorrect indentation level 4, expected level should be 6.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[694,7] (indentation) Indentation: 'while' has incorrect indentation level 6, expected level should be 8.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[695,9] (indentation) Indentation: 'while' child has incorrect indentation level 8, expected level should be [10](https://github.com/googleapis/java-spanner/actions/runs/15027603684/job/42257173380?pr=3625#step:4:11).
Error:  src/main/java/com/example/spanner/SpannerSample.java:[698,7] (indentation) Indentation: 'while rcurly' has incorrect indentation level 6, expected level should be 8.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[699,5] (indentation) Indentation: 'try rcurly' has incorrect indentation level 4, expected level should be 6.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[700,3] (indentation) Indentation: 'try rcurly' has incorrect indentation level 2, expected level should be 4.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[701,1] (indentation) Indentation: 'method def rcurly' has incorrect indentation level 0, expected level should be 2.
Error:  src/main/java/com/example/spanner/SpannerSample.java:[702,1] (indentation) CommentsIndentation: Comment has incorrect indentation level 0, expected is 2, indentation should be the same level as line 705.
Error:  Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:3.6.0:check (default-cli) on project spanner-snippets: You have [12](https://github.com/googleapis/java-spanner/actions/runs/15027603684/job/42257173380?pr=3625#step:4:13) Checkstyle violations. -> [Help 1]

https://github.com/googleapis/java-spanner/actions/runs/15027603684/job/42257173380?pr=3625

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: Update SpannerSample.java to align with best practices
3 participants