hashCode() does not include parent fields #325

Closed
opened 2023-10-27 10:20:21 +02:00 by pulledtim · 0 comments
pulledtim commented 2023-10-27 10:20:21 +02:00 (Migrated from github.com)
  package issue._315;
  
  @jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen")
  @io.micronaut.core.annotation.Introspected
  public class ServiceScopesEntry extends java.util.ArrayList<Credential> {
	  // methods
	  @Override
	  public boolean equals(Object object) {
		  if (object == this) {
			  return true;
		  }
		  if (object == null || getClass() != object.getClass()) {
			  return false;
		  }
		  return super.equals(object);
	  }
	  @Override
	  public int hashCode() {
		  return java.util.Objects.hash();
	  }
	  @Override
	  public java.lang.String toString() {
		  return new java.lang.StringBuilder()
				  .append("ServiceScopesEntry[")
				  .append("super").append(super.toString())
				  .append("]")
				  .toString();
	  }
  }

Line github.com/kokuwaio/micronaut-openapi-codegen@8f06f66cc0/gen/main/java/issue/_315/ServiceScopesEntry.java (L23)
should include a call to the parents hashCode method.

``` package issue._315; @jakarta.annotation.Generated("org.openapitools.codegen.languages.MicronautCodegen") @io.micronaut.core.annotation.Introspected public class ServiceScopesEntry extends java.util.ArrayList<Credential> { // methods @Override public boolean equals(Object object) { if (object == this) { return true; } if (object == null || getClass() != object.getClass()) { return false; } return super.equals(object); } @Override public int hashCode() { return java.util.Objects.hash(); } @Override public java.lang.String toString() { return new java.lang.StringBuilder() .append("ServiceScopesEntry[") .append("super").append(super.toString()) .append("]") .toString(); } } ``` Line https://github.com/kokuwaio/micronaut-openapi-codegen/blob/8f06f66cc000c37ece5c47c324995ced002ad858/gen/main/java/issue/_315/ServiceScopesEntry.java#L23 should include a call to the parents hashCode method.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
kokuwaio/micronaut-openapi-codegen#325
No description provided.