Copilot commented on code in PR #12419:
URL: https://github.com/apache/cloudstack/pull/12419#discussion_r2693121384
##########
plugins/storage/volume/nexenta/src/main/java/org/apache/cloudstack/storage/datastore/util/NexentaStorAppliance.java:
##########
@@ -242,7 +248,7 @@ boolean isLuExists(String luName) {
return response!= null && response.getResult() > 0;
}
- @SuppressWarnings("unused")
+ @SuppressWarnings({"unused", "EqualsHashCode", "EqualsAndHashCode",
"java:S2160", "errorprone"})
Review Comment:
The suppression annotation includes multiple different annotation names for
the same issue. The list contains "EqualsHashCode", "EqualsAndHashCode",
"java:S2160", and "errorprone" which are redundant. Consider standardizing to
use only the ErrorProne annotation "EqualsHashCode" or the SonarQube annotation
"java:S2160".
##########
engine/orchestration/src/main/java/com/cloud/agent/manager/AgentAttache.java:
##########
@@ -497,6 +498,11 @@ public void process(final Answer[] answers) {
*/
protected abstract boolean isClosed();
+ @Override
+ public int hashCode() {
+ return Objects.hash(_id, _uuid, _name);
Review Comment:
The hashCode implementation uses _id, _uuid, and _name, but the equals
method in AgentAttache only uses _id for comparison. The hashCode
implementation should be consistent with equals and only use _id to maintain
the equals-hashCode contract.
```suggestion
return Objects.hash(_id);
```
##########
.github/linters/codespell.txt:
##########
@@ -188,6 +188,7 @@ environmnet
equivalant
erro
erronous
+errorprone
Review Comment:
The codespell exclusion entry "errorprone" should be capitalized as
"ErrorProne" to match the actual tool name, or removed entirely as it's a valid
technical term that doesn't need to be in the codespell ignore list.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]