You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2022/06/07 17:01:42 UTC

[GitHub] [avro] github-code-scanning[bot] commented on a diff in pull request #1708: AVRO-3527: Generated equals() and hashCode() for SpecificRecords

github-code-scanning[bot] commented on code in PR #1708:
URL: https://github.com/apache/avro/pull/1708#discussion_r891495081


##########
lang/java/compiler/src/main/java/org/apache/avro/compiler/specific/SpecificCompiler.java:
##########
@@ -1131,6 +1131,46 @@
     return word;
   }
 
+  public boolean canGenerateEqualsAndHashCode(Schema schema) {
+    return getUsedCustomLogicalTypeFactories(schema).isEmpty();
+  }
+
+  public boolean isPrimitiveType(Schema schema) {
+    return !isUnboxedJavaTypeNullable(schema) && getConvertedLogicalType(schema) == null;
+  }
+
+  public String hashCodeFor(Schema schema, String name) {
+    switch (javaUnbox(schema)) {

Review Comment:
   ## Deprecated method or constructor invocation
   
   Invoking [SpecificCompiler.javaUnbox](1) should be avoided because it has been deprecated.
   
   [Show more details](https://github.com/apache/avro/security/code-scanning/2708)



-- 
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: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org