Skip to content

Remove final from local variables#732

Merged
anuraaga merged 8 commits into
open-telemetry:masterfrom
heyams:heya/remove-final
Jul 20, 2020
Merged

Remove final from local variables#732
anuraaga merged 8 commits into
open-telemetry:masterfrom
heyams:heya/remove-final

Conversation

@heyams

@heyams heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

Fix #592.

@anuraaga

Copy link
Copy Markdown
Contributor

@heyams Thanks a lot for helping with this! Can you describe your approach? IntelliJ has an automated fix for unnecessary final

Help -> Find Action -> Run Inspection By Name -> Unnecessary final on local variable or parameter

You can use Fix All to have it automatically fix. Then just ./gradlew spotlessApply will reformat and the change should be good to go.

821e18a makes me nervous that you may be doing this manually, meaning there's chance of manual error.

@heyams

heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

@anuraaga Oops, I wasn't aware there was an automatic way to fix this. I did it manually 😢

@heyams

heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

@anuraaga I can create a separate PR using your suggestion to see if it will fix all the local variables except those accessed by the inner classes.

@anuraaga

Copy link
Copy Markdown
Contributor

I don't think you need to create a separate PR - how about running that on this PR. It may catch anything you missed, or otherwise it means you got them all :)

@heyams

heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

@anuraaga Cool, will do. Thanks!

@heyams

heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

@anuraaga I missed 10 files. Find Action works. Thanks!

@anuraaga anuraaga marked this pull request as ready for review July 20, 2020 04:51
@trask

trask commented Jul 20, 2020

Copy link
Copy Markdown
Member

Help -> Find Action -> Run Inspection By Name -> Unnecessary final on local variable or parameter

Oh nice! I didn't know about this either. I need to hang around @anuraaga more 😄

@anuraaga anuraaga left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks a lot! As this is purely cosmetic and has a huge chance of merge conflicts I'm going to go ahead and merge this. I scrolled through really fast and "confirm"ed that the left-hand side has a lot of red finals being removed.

@anuraaga anuraaga merged commit 86c438b into open-telemetry:master Jul 20, 2020
@iNikem

iNikem commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

Help -> Find Action -> Run Inspection By Name -> Unnecessary final on local variable or parameter

Oh nice! I didn't know about this either. I need to hang around @anuraaga more 😄

Take a look at videos by Trisha Gee, such as this https://www.youtube.com/watch?v=9AMcN-wkspU :)

@heyams

heyams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

Thank you @anuraaga! I saw one muzzle failed last night.. wonder what was the cause? Do we have a group chat? If i need to do another manual cleanup, I would like to sync up with you before doing anything... @anuraaga seems to know the magic tricks :)

@iNikem

iNikem commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

@heyams Official Gitter channel will do :) https://gitter.im/open-telemetry/opentelemetry-java-instrumentation

schmikei pushed a commit to schmikei/opentelemetry-java-instrumentation that referenced this pull request Apr 17, 2025
Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
schmikei pushed a commit to schmikei/opentelemetry-java-instrumentation that referenced this pull request Apr 17, 2025
Co-authored-by: Alexander Wert <AlexanderWert@users.noreply.github.com>
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.

Remove final from local variables

4 participants