shishkovilja commented on code in PR #11964:
URL: https://github.com/apache/ignite/pull/11964#discussion_r2011732659


##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java:
##########
@@ -409,34 +404,10 @@ private <Row> Object insertVal(Row row, 
ExecutionContext<Row> ectx) throws Ignit
     private Object newVal(String typeName, Class<?> typeCls) throws 
IgniteCheckedException {
         GridCacheContext<?, ?> cctx = cacheContext();
 
-        if (cctx.binaryMarshaller()) {
-            BinaryObjectBuilder builder = 
cctx.grid().binary().builder(typeName);
-            cctx.prepareAffinityField(builder);
-
-            return builder;
-        }
-
-        Class<?> cls = U.classForName(typeName, typeCls);
-
-        try {
-            Constructor<?> ctor = cls.getDeclaredConstructor();
-            ctor.setAccessible(true);
-
-            return ctor.newInstance();
-        }
-        catch (IllegalAccessException | InstantiationException | 
InvocationTargetException e) {
-            throw instantiationException(typeName, e);
-        }
-        catch (NoSuchMethodException | SecurityException e) {
-            try {
-                return GridUnsafe.allocateInstance(cls);
-            }
-            catch (InstantiationException e0) {
-                e0.addSuppressed(e);
+        BinaryObjectBuilder builder = cctx.grid().binary().builder(typeName);
+        cctx.prepareAffinityField(builder);
 
-                throw instantiationException(typeName, e0);

Review Comment:
   Method `instantiationException` has become unused and should be removed



##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/schema/CacheTableDescriptorImpl.java:
##########
@@ -409,34 +404,10 @@ private <Row> Object insertVal(Row row, 
ExecutionContext<Row> ectx) throws Ignit
     private Object newVal(String typeName, Class<?> typeCls) throws 
IgniteCheckedException {

Review Comment:
   `typeCls` has become unused and should be removed



##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlanBuilder.java:
##########
@@ -665,112 +662,38 @@ else if (isSqlType)
                 throw new IgniteCheckedException((key ? "Key" : "Value") + " 
is missing from query");
         }
 
-        if (cctx.binaryMarshaller()) {
-            if (colIdx != -1) {
-                // If we have key or value explicitly present in query, create 
new builder upon them...
-                return new KeyValueSupplier() {
-                    /** {@inheritDoc} */
-                    @Override public Object apply(List<?> arg) {
-                        Object obj = arg.get(colIdx);
+        if (colIdx != -1) {
+            // If we have key or value explicitly present in query, create new 
builder upon them...
+            return new KeyValueSupplier() {
+                /** {@inheritDoc} */
+                @Override public Object apply(List<?> arg) {
+                    Object obj = arg.get(colIdx);
 
-                        if (obj == null)
-                            return null;
+                    if (obj == null)
+                        return null;
 
-                        BinaryObject bin = cctx.grid().binary().toBinary(obj);
+                    BinaryObject bin = cctx.grid().binary().toBinary(obj);
 
-                        BinaryObjectBuilder builder = 
cctx.grid().binary().builder(bin);
+                    BinaryObjectBuilder builder = 
cctx.grid().binary().builder(bin);
 
-                        cctx.prepareAffinityField(builder);
+                    cctx.prepareAffinityField(builder);
 
-                        return builder;
-                    }
-                };
-            }
-            else {
-                // ...and if we don't, just create a new builder.
-                return new KeyValueSupplier() {
-                    /** {@inheritDoc} */
-                    @Override public Object apply(List<?> arg) {
-                        BinaryObjectBuilder builder = 
cctx.grid().binary().builder(typeName);
-
-                        cctx.prepareAffinityField(builder);
-
-                        return builder;
-                    }
-                };
-            }
+                    return builder;
+                }
+            };
         }
         else {
-            if (colIdx != -1) {
-                if (forUpdate && colIdx == 1) {

Review Comment:
   Argument `forUpdate` has become unused and should be removed from method



##########
modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/dml/UpdatePlan.java:
##########
@@ -278,13 +278,11 @@ public UpdatePlan(
             desc.setValue(colName, key, val, colVal);
         }
 
-        if (cctx.binaryMarshaller()) {

Review Comment:
   Variable `cctx` has become unused and should be removed (see line 205).



-- 
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: notifications-unsubscr...@ignite.apache.org

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

Reply via email to