Skip to content
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

Fix checkstyle reported warning in Main.java #909

Open
Pinti0001 opened this issue Feb 18, 2024 · 0 comments
Open

Fix checkstyle reported warning in Main.java #909

Pinti0001 opened this issue Feb 18, 2024 · 0 comments

Comments

@Pinti0001
Copy link

Add final before datatype to fix

WARNING:

Parameter provider should be final. (404:29) [FinalParameters]
Parameter options should be final. (404:65) [FinalParameters]
Parameter dbmsSpecificOptions should be final. (404:86) [FinalParameters]
Parameter databaseName should be final. (405:17) [FinalParameters]
Parameter r should be final. (405:38) [FinalParameters]

Following method warnings reported by checkstyle

Screenshot 2024-02-17 at 5 10 57 PM

Here is code where get warning

https://github.com/sqlancer/sqlancer/blob/main/src/sqlancer/Main.java

Screenshot 2024-02-17 at 5 08 52 PM

It's important to note that the use of the final keyword for method parameters is a matter of coding style and best practices. Some developers consider using final in method parameters and local variables to be unnecessary "code noise," especially in cases where unit tests are written properly to catch any harmful assignments to parameters. Additionally, tools like Sonar, FindBugs, and CheckStyle can be configured to break the build if assignment is made to parameters or local variables, providing an alternative approach to ensuring parameter immutability.

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

No branches or pull requests

1 participant