You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/01/15 21:46:50 UTC

[GitHub] [kafka] cmccabe opened a new pull request #9914: KAFKA-12214: Generated code does not include UUID or struct fields in toString()

cmccabe opened a new pull request #9914:
URL: https://github.com/apache/kafka/pull/9914


   


----------------------------------------------------------------
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.

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



[GitHub] [kafka] jolshan commented on a change in pull request #9914: KAFKA-12214: Generated code does not include UUID or struct fields in toString()

Posted by GitBox <gi...@apache.org>.
jolshan commented on a change in pull request #9914:
URL: https://github.com/apache/kafka/pull/9914#discussion_r558621458



##########
File path: generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java
##########
@@ -1901,7 +1901,9 @@ private void generateFieldToString(String prefix, FieldSpec field) {
             buffer.printf("+ \"%s%s=\" + %s%n",
                     prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct() ||
-            field.type() instanceof FieldType.UUIDFieldType) {
+                field.type() instanceof FieldType.UUIDFieldType) {
+            buffer.printf("+ \"%s%s=\" + %s.toString()%n",
+                prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct()) {

Review comment:
       Should this line be removed if it is covered by the line above?




----------------------------------------------------------------
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.

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



[GitHub] [kafka] cmccabe merged pull request #9914: KAFKA-12214: Generated code does not include UUID or struct fields in toString()

Posted by GitBox <gi...@apache.org>.
cmccabe merged pull request #9914:
URL: https://github.com/apache/kafka/pull/9914


   


----------------------------------------------------------------
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.

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



[GitHub] [kafka] jolshan commented on a change in pull request #9914: KAFKA-12214: Generated code does not include UUID or struct fields in toString()

Posted by GitBox <gi...@apache.org>.
jolshan commented on a change in pull request #9914:
URL: https://github.com/apache/kafka/pull/9914#discussion_r558621458



##########
File path: generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java
##########
@@ -1901,7 +1901,9 @@ private void generateFieldToString(String prefix, FieldSpec field) {
             buffer.printf("+ \"%s%s=\" + %s%n",
                     prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct() ||
-            field.type() instanceof FieldType.UUIDFieldType) {
+                field.type() instanceof FieldType.UUIDFieldType) {
+            buffer.printf("+ \"%s%s=\" + %s.toString()%n",
+                prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct()) {

Review comment:
       Should this case be removed if it is covered by the case above?




----------------------------------------------------------------
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.

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



[GitHub] [kafka] cmccabe commented on a change in pull request #9914: KAFKA-12214: Generated code does not include UUID or struct fields in toString()

Posted by GitBox <gi...@apache.org>.
cmccabe commented on a change in pull request #9914:
URL: https://github.com/apache/kafka/pull/9914#discussion_r558710494



##########
File path: generator/src/main/java/org/apache/kafka/message/MessageDataGenerator.java
##########
@@ -1901,7 +1901,9 @@ private void generateFieldToString(String prefix, FieldSpec field) {
             buffer.printf("+ \"%s%s=\" + %s%n",
                     prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct() ||
-            field.type() instanceof FieldType.UUIDFieldType) {
+                field.type() instanceof FieldType.UUIDFieldType) {
+            buffer.printf("+ \"%s%s=\" + %s.toString()%n",
+                prefix, field.camelCaseName(), field.camelCaseName());
         } else if (field.type().isStruct()) {

Review comment:
       good point.  I will consolidate these.




----------------------------------------------------------------
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.

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