Skip to content
New issue

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

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

Already on GitHub? # to your account

client, improvement on Headers class property definitions #2873

Open
weidongxu-microsoft opened this issue Jul 22, 2024 · 0 comments
Open

client, improvement on Headers class property definitions #2873

weidongxu-microsoft opened this issue Jul 22, 2024 · 0 comments

Comments

@weidongxu-microsoft
Copy link
Member

Headers class like below would trigger some "EnforceFinalFields" error in check-style
https://github.com/Azure/azure-sdk-for-java/blob/e621a3c9dba7853280bd5432d873b7ea94fb88b8/sdk/avs/azure-resourcemanager-avs/src/main/java/com/azure/resourcemanager/avs/models/PrivateCloudsUpdateHeaders.java

error is

 src/main/java/com/azure/resourcemanager/avs/models/PlacementPoliciesUpdateHeaders.java(19,5): error :  src/main/java/com/azure/resourcemanager/avs/models/PlacementPoliciesUpdateHeaders.java:[19,5] (extension) EnforceFinalFields: Field "retryAfter" is only assigned in constructor and it is not final. You should consider making the field final, or suppressing the warning.

https://github.com/Azure/azure-sdk-for-java/pull/40479/checks?check_run_id=27728266899


There is some nuance on the property
private String location; seems can be directly a final property.
However, private Integer retryAfter; cannot be final, unless a minor change in code e.g.

    this.retryAfter = retryAfter != null ? Integer.parseInt(retryAfter) : null;
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant