You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2021/02/18 12:28:38 UTC

[GitHub] [ignite-3] SammyVimes commented on a change in pull request #54: IGNITE-14181 Support arrays of primitives in the configuration schema

SammyVimes commented on a change in pull request #54:
URL: https://github.com/apache/ignite-3/pull/54#discussion_r578377267



##########
File path: modules/configuration-annotation-processor/src/main/java/org/apache/ignite/configuration/processor/internal/Processor.java
##########
@@ -1339,6 +1358,31 @@ public MethodSpec createChangeMethod(TypeName type, List<VariableElement> variab
             .build();
     }
 
+    /**
+     * Checks whether TypeName is a primitive (or String) or an array of primitives (or Strings)
+     * @param typeName TypeName.
+     * @return {@code true} if type is primitive or array.
+     */
+    private boolean isPrimitiveOrArrayOfPrimitives(TypeName typeName) {
+        String type = typeName.toString();
+
+        if (typeName instanceof ArrayTypeName)
+            type = ((ArrayTypeName) typeName).componentType.toString();
+
+        switch (type) {
+            case "boolean":
+            case "int":
+            case "long":
+            case "double":
+            case "java.lang.String":
+                return true;
+
+            default:
+                return false;
+

Review comment:
       Codestyle :)




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