Skip to content

Commit

Permalink
use fqn for Objects.hashCode, take into account parent
Browse files Browse the repository at this point in the history
Signed-off-by: miguel-vila <[email protected]>
  • Loading branch information
miguel-vila committed Sep 20, 2024
1 parent 492de4e commit 8fd4694
Show file tree
Hide file tree
Showing 29 changed files with 76 additions and 71 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,12 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupBaseNode

public int hashCode() {
int result = 17;
result = 31 * result + (attributes != null ? this.attributes.hashCode() : 0);
result = 31 * result + (host != null ? this.host.hashCode() : 0);
result = 31 * result + (ip != null ? this.ip.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.attributes);
result = 31 * result + java.util.Objects.hashCode(this.host);
result = 31 * result + java.util.Objects.hashCode(this.ip);
result = 31 * result + this.name.hashCode();
result = 31 * result + (roles != null ? this.roles.hashCode() : 0);
result = 31 * result + (transportAddress != null ? this.transportAddress.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.roles);
result = 31 * result + java.util.Objects.hashCode(this.transportAddress);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,11 @@ protected static void setupBulkByScrollFailureDeserializer(ObjectDeserializer<Bu

public int hashCode() {
int result = 17;
result = 31 * result + (cause != null ? this.cause.hashCode() : 0);
result = 31 * result + (id != null ? this.id.hashCode() : 0);
result = 31 * result + (index != null ? this.index.hashCode() : 0);
result = 31 * result + (node != null ? this.node.hashCode() : 0);
result = 31 * result + (reason != null ? this.reason.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.cause);
result = 31 * result + java.util.Objects.hashCode(this.id);
result = 31 * result + java.util.Objects.hashCode(this.index);
result = 31 * result + java.util.Objects.hashCode(this.node);
result = 31 * result + java.util.Objects.hashCode(this.reason);
result = 31 * result + Integer.hashCode(this.shard);
result = 31 * result + Integer.hashCode(this.status);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,17 @@ protected static void setupBulkByScrollTaskStatusDeserializer(ObjectDeserializer
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.batches);
result = 31 * result + (canceled != null ? this.canceled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.canceled);
result = 31 * result + Long.hashCode(this.created);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + Long.hashCode(this.noops);
result = 31 * result + Float.hashCode(this.requestsPerSecond);
result = 31 * result + this.retries.hashCode();
result = 31 * result + Integer.hashCode(this.sliceId);
result = 31 * result + (slices != null ? this.slices.hashCode() : 0);
result = 31 * result + (throttled != null ? this.throttled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.slices);
result = 31 * result + java.util.Objects.hashCode(this.throttled);
result = 31 * result + Long.hashCode(this.throttledMillis);
result = 31 * result + (throttledUntil != null ? this.throttledUntil.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.throttledUntil);
result = 31 * result + Long.hashCode(this.throttledUntilMillis);
result = 31 * result + Long.hashCode(this.total);
result = 31 * result + Long.hashCode(this.updated);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,13 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer<ErrorCause.

public int hashCode() {
int result = 17;
result = 31 * result + (causedBy != null ? this.causedBy.hashCode() : 0);
result = 31 * result + (reason != null ? this.reason.hashCode() : 0);
result = 31 * result + (rootCause != null ? this.rootCause.hashCode() : 0);
result = 31 * result + (stackTrace != null ? this.stackTrace.hashCode() : 0);
result = 31 * result + (suppressed != null ? this.suppressed.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.causedBy);
result = 31 * result + java.util.Objects.hashCode(this.reason);
result = 31 * result + java.util.Objects.hashCode(this.rootCause);
result = 31 * result + java.util.Objects.hashCode(this.stackTrace);
result = 31 * result + java.util.Objects.hashCode(this.suppressed);
result = 31 * result + this.type.hashCode();
result = 31 * result + (metadata != null ? this.metadata.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.metadata);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ protected static void setupNodeStatisticsDeserializer(ObjectDeserializer<NodeSta
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
result = 31 * result + (failures != null ? this.failures.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.failures);
result = 31 * result + Integer.hashCode(this.successful);
result = 31 * result + Integer.hashCode(this.total);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ protected static void setupOpenSearchVersionInfoDeserializer(ObjectDeserializer<
public int hashCode() {
int result = 17;
result = 31 * result + this.buildDate.hashCode();
result = 31 * result + (buildFlavor != null ? this.buildFlavor.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.buildFlavor);
result = 31 * result + this.buildHash.hashCode();
result = 31 * result + Boolean.hashCode(this.buildSnapshot);
result = 31 * result + this.buildType.hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ protected static void setupShardFailureDeserializer(ObjectDeserializer<ShardFail

public int hashCode() {
int result = 17;
result = 31 * result + (index != null ? this.index.hashCode() : 0);
result = 31 * result + (node != null ? this.node.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.index);
result = 31 * result + java.util.Objects.hashCode(this.node);
result = 31 * result + this.reason.hashCode();
result = 31 * result + Integer.hashCode(this.shard);
result = 31 * result + (status != null ? this.status.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.status);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ protected static void setupShardStatisticsDeserializer(ObjectDeserializer<ShardS
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
result = 31 * result + (failures != null ? this.failures.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.failures);
result = 31 * result + Integer.hashCode(this.skipped);
result = 31 * result + Integer.hashCode(this.successful);
result = 31 * result + Integer.hashCode(this.total);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected static void setupDeleteDanglingIndexResponseDeserializer(ObjectDeseria
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected static void setupImportDanglingIndexResponseDeserializer(ObjectDeseria
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ protected static void setupListDanglingIndicesResponseDeserializer(ObjectDeseria

public int hashCode() {
int result = 17;
result = 31 * result + (clusterName != null ? this.clusterName.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.clusterName);
result = 31 * result + this.danglingIndices.hashCode();
result = 31 * result + (nodes != null ? this.nodes.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.nodes);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ protected static void setupDanglingIndexDeserializer(ObjectDeserializer<Dangling

public int hashCode() {
int result = 17;
result = 31 * result + (creationDate != null ? this.creationDate.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.creationDate);
result = 31 * result + Long.hashCode(this.creationDateMillis);
result = 31 * result + this.indexName.hashCode();
result = 31 * result + this.indexUuid.hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected static void setupDeleteModelGroupResponseDeserializer(ObjectDeserializ
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected static void setupDeleteModelResponseDeserializer(ObjectDeserializer<De
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected static void setupDeleteTaskResponseDeserializer(ObjectDeserializer<Del
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + this.status.hashCode();
result = 31 * result + this.taskId.hashCode();
result = 31 * result + (taskType != null ? this.taskType.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.taskType);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,15 @@ protected static void setupGetTaskResponseDeserializer(ObjectDeserializer<GetTas
public int hashCode() {
int result = 17;
result = 31 * result + Long.hashCode(this.createTime);
result = 31 * result + (error != null ? this.error.hashCode() : 0);
result = 31 * result + (functionName != null ? this.functionName.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.error);
result = 31 * result + java.util.Objects.hashCode(this.functionName);
result = 31 * result + Boolean.hashCode(this.isAsync);
result = 31 * result + Long.hashCode(this.lastUpdateTime);
result = 31 * result + (modelId != null ? this.modelId.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.modelId);
result = 31 * result + this.state.hashCode();
result = 31 * result + (taskId != null ? this.taskId.hashCode() : 0);
result = 31 * result + (taskType != null ? this.taskType.hashCode() : 0);
result = 31 * result + (workerNode != null ? this.workerNode.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.taskId);
result = 31 * result + java.util.Objects.hashCode(this.taskType);
result = 31 * result + java.util.Objects.hashCode(this.workerNode);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected static void setupUndeployModelNodeDeserializer(ObjectDeserializer<Unde

public int hashCode() {
int result = 17;
result = 31 * result + (stats != null ? this.stats.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.stats);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ protected static void setupUndeployModelResponseDeserializer(ObjectDeserializer<

public int hashCode() {
int result = 17;
result = 31 * result + (nodes != null ? this.nodes.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.nodes);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected static void setupCancelResponseDeserializer(ObjectDeserializer<CancelR
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ protected static void setupGetTasksResponseDeserializer(ObjectDeserializer<GetTa
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.completed);
result = 31 * result + (error != null ? this.error.hashCode() : 0);
result = 31 * result + (response != null ? this.response.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.error);
result = 31 * result + java.util.Objects.hashCode(this.response);
result = 31 * result + this.task.hashCode();
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected static void setupListResponseDeserializer(ObjectDeserializer<ListRespo
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,24 +771,24 @@ protected static void setupStatusDeserializer(ObjectDeserializer<Status.Builder>
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.batches);
result = 31 * result + (canceled != null ? this.canceled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.canceled);
result = 31 * result + Long.hashCode(this.created);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + Long.hashCode(this.noops);
result = 31 * result + (phase != null ? this.phase.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.phase);
result = 31 * result + Float.hashCode(this.requestsPerSecond);
result = 31 * result + (retries != null ? this.retries.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.retries);
result = 31 * result + Integer.hashCode(this.sliceId);
result = 31 * result + (slices != null ? this.slices.hashCode() : 0);
result = 31 * result + (state != null ? this.state.hashCode() : 0);
result = 31 * result + (throttled != null ? this.throttled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.slices);
result = 31 * result + java.util.Objects.hashCode(this.state);
result = 31 * result + java.util.Objects.hashCode(this.throttled);
result = 31 * result + Long.hashCode(this.throttledMillis);
result = 31 * result + (throttledUntil != null ? this.throttledUntil.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.throttledUntil);
result = 31 * result + Long.hashCode(this.throttledUntilMillis);
result = 31 * result + Long.hashCode(this.total);
result = 31 * result + Long.hashCode(this.updated);
result = 31 * result + Long.hashCode(this.versionConflicts);
result = 31 * result + (metadata != null ? this.metadata.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.metadata);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected static void setupTaskExecutingNodeDeserializer(ObjectDeserializer<Task
}

public int hashCode() {
int result = 17;
int result = super.hashCode();
result = 31 * result + this.tasks.hashCode();
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ protected static void setupTaskGroupDeserializer(ObjectDeserializer<TaskGroup.Bu
}

public int hashCode() {
int result = 17;
result = 31 * result + (children != null ? this.children.hashCode() : 0);
int result = super.hashCode();
result = 31 * result + java.util.Objects.hashCode(this.children);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,15 @@ public int hashCode() {
result = 31 * result + this.action.hashCode();
result = 31 * result + Boolean.hashCode(this.cancellable);
result = 31 * result + Boolean.hashCode(this.cancelled);
result = 31 * result + (description != null ? this.description.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.description);
result = 31 * result + this.headers.hashCode();
result = 31 * result + Long.hashCode(this.id);
result = 31 * result + this.node.hashCode();
result = 31 * result + (parentTaskId != null ? this.parentTaskId.hashCode() : 0);
result = 31 * result + (runningTime != null ? this.runningTime.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.parentTaskId);
result = 31 * result + java.util.Objects.hashCode(this.runningTime);
result = 31 * result + Long.hashCode(this.runningTimeInNanos);
result = 31 * result + Long.hashCode(this.startTimeInMillis);
result = 31 * result + (status != null ? this.status.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.status);
result = 31 * result + this.type.hashCode();
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,10 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupTaskList

public int hashCode() {
int result = 17;
result = 31 * result + (nodeFailures != null ? this.nodeFailures.hashCode() : 0);
result = 31 * result + (nodes != null ? this.nodes.hashCode() : 0);
result = 31 * result + (taskFailures != null ? this.taskFailures.hashCode() : 0);
result = 31 * result + (tasks != null ? this.tasks.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.nodeFailures);
result = 31 * result + java.util.Objects.hashCode(this.nodes);
result = 31 * result + java.util.Objects.hashCode(this.taskFailures);
result = 31 * result + java.util.Objects.hashCode(this.tasks);
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -722,18 +722,18 @@ protected static void setupTaskResponseDeserializer(ObjectDeserializer<TaskRespo
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.batches);
result = 31 * result + (canceled != null ? this.canceled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.canceled);
result = 31 * result + Long.hashCode(this.created);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + this.failures.hashCode();
result = 31 * result + Long.hashCode(this.noops);
result = 31 * result + Float.hashCode(this.requestsPerSecond);
result = 31 * result + this.retries.hashCode();
result = 31 * result + Integer.hashCode(this.sliceId);
result = 31 * result + (slices != null ? this.slices.hashCode() : 0);
result = 31 * result + (throttled != null ? this.throttled.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.slices);
result = 31 * result + java.util.Objects.hashCode(this.throttled);
result = 31 * result + Long.hashCode(this.throttledMillis);
result = 31 * result + (throttledUntil != null ? this.throttledUntil.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.throttledUntil);
result = 31 * result + Long.hashCode(this.throttledUntilMillis);
result = 31 * result + Boolean.hashCode(this.timedOut);
result = 31 * result + Long.hashCode(this.took);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
public int hashCode() {
{{#extendsOtherShape}}
int result = super.hashCode();
{{/extendsOtherShape}}
{{^extendsOtherShape}}
int result = 17;
{{/extendsOtherShape}}
{{#fields}}
{{#isUnboxedPrimitive}}
result = 31 * result + {{getBoxedType}}.hashCode(this.{{name}});
Expand All @@ -9,7 +14,7 @@
result = 31 * result + this.{{name}}.hashCode();
{{/isRequired}}
{{^isRequired}}
result = 31 * result + ({{name}} != null ? this.{{name}}.hashCode() : 0);
result = 31 * result + java.util.Objects.hashCode(this.{{name}});
{{/isRequired}}
{{/isUnboxedPrimitive}}
{{/fields}}
Expand Down

0 comments on commit 8fd4694

Please sign in to comment.