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/01 15:09:52 UTC

[GitHub] [ignite] ptupitsyn commented on a change in pull request #8730: IGNITE-14064 .NET: Fix SQL table name for generic query types

ptupitsyn commented on a change in pull request #8730:
URL: https://github.com/apache/ignite/pull/8730#discussion_r567897197



##########
File path: modules/core/src/main/java/org/apache/ignite/binary/BinaryBasicNameMapper.java
##########
@@ -87,6 +87,18 @@ public BinaryBasicNameMapper setSimpleName(boolean isSimpleName) {
     private static String simpleName(String clsName) {
         assert clsName != null;
 
+        // .NET generic, not valid for Java class name. Clean up every generic part recursively.
+        // Example: Foo.Bar`1[[Baz.Qux`1[[System.String],[System.Int32]]]]
+        int genericIdx = clsName.indexOf("[[");
+
+        if (genericIdx > 0)
+            clsName = clsName.substring(0, genericIdx + 2) + simpleName(clsName.substring(genericIdx + 2));
+
+        genericIdx = clsName.indexOf("],[", genericIdx);
+
+        if (genericIdx > 0)
+            clsName = clsName.substring(0, genericIdx + 3) + simpleName(clsName.substring(genericIdx + 3));
+

Review comment:
       Good point, I've extracted a method. However, I don't think we should test it separately - it is an implementation detail. Corresponding tests added to `BinaryBasicNameMapperSelfTest`.




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