ibessonov commented on code in PR #1431:
URL: https://github.com/apache/ignite-3/pull/1431#discussion_r1048107734


##########
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/asm/AbstractAsmGenerator.java:
##########
@@ -0,0 +1,285 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.configuration.asm;
+
+import com.facebook.presto.bytecode.ClassDefinition;
+import java.io.Serializable;
+import java.lang.invoke.LambdaMetafactory;
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles.Lookup;
+import java.lang.invoke.MethodType;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.function.Consumer;
+import org.apache.ignite.configuration.ConfigurationProperty;
+import org.apache.ignite.configuration.RootKey;
+import org.apache.ignite.internal.configuration.ConfigurationNode;
+import org.apache.ignite.internal.configuration.DynamicConfiguration;
+import org.apache.ignite.internal.configuration.DynamicConfigurationChanger;
+import 
org.apache.ignite.internal.configuration.direct.DirectConfigurationProxy;
+import org.apache.ignite.internal.configuration.tree.ConfigurationSource;
+import org.apache.ignite.internal.configuration.tree.ConfigurationVisitor;
+import org.apache.ignite.internal.configuration.tree.ConstructableTreeNode;
+import org.apache.ignite.internal.configuration.tree.InnerNode;
+import org.apache.ignite.internal.configuration.tree.NamedListNode;
+import org.apache.ignite.internal.configuration.util.ConfigurationUtil;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Class that holds constants and commonly used fields for generators.
+ */
+abstract class AbstractAsmGenerator {
+    /** {@link DynamicConfiguration#DynamicConfiguration} constructor. */
+    static final Constructor<?> DYNAMIC_CONFIGURATION_CTOR;
+
+    /** {@link LambdaMetafactory#metafactory(Lookup, String, MethodType, 
MethodType, MethodHandle, MethodType)}. */
+    static final Method LAMBDA_METAFACTORY;
+
+    /** {@link Consumer#accept(Object)}. */
+    static final Method ACCEPT;
+
+    /** {@link ConfigurationVisitor#visitLeafNode(String, Serializable)}. */
+    static final Method VISIT_LEAF;
+
+    /** {@link ConfigurationVisitor#visitInnerNode(String, InnerNode)}. */
+    static final Method VISIT_INNER;
+
+    /** {@link ConfigurationVisitor#visitNamedListNode(String, 
NamedListNode)}. */
+    static final Method VISIT_NAMED;
+
+    /** {@link ConfigurationSource#unwrap(Class)}. */
+    static final Method UNWRAP;
+
+    /** {@link ConfigurationSource#descend(ConstructableTreeNode)}. */
+    static final Method DESCEND;
+
+    /** {@link ConstructableTreeNode#copy()}. */
+    static final Method COPY;
+
+    /** {@link InnerNode#internalId()}. */
+    static final Method INTERNAL_ID;
+
+    /** {@code DynamicConfiguration#add} method. */
+    static final Method DYNAMIC_CONFIGURATION_ADD_MTD;
+
+    /** {@link Objects#requireNonNull(Object, String)}. */
+    static final Method REQUIRE_NON_NULL;
+
+    /** {@link Class#getName} method. */
+    static final Method CLASS_GET_NAME_MTD;
+
+    /** {@link String#equals} method. */
+    static final Method STRING_EQUALS_MTD;
+
+    /** {@link ConfigurationSource#polymorphicTypeId} method. */
+    static final Method POLYMORPHIC_TYPE_ID_MTD;
+
+    /** {@link InnerNode#constructDefault} method. */
+    static final Method CONSTRUCT_DEFAULT_MTD;
+
+    /** {@code ConfigurationNode#refreshValue} method. */
+    static final Method REFRESH_VALUE_MTD;
+
+    /** {@code DynamicConfiguration#addMember} method. */
+    static final Method ADD_MEMBER_MTD;
+
+    /** {@code DynamicConfiguration#removeMember} method. */
+    static final Method REMOVE_MEMBER_MTD;
+
+    /** {@link InnerNode#specificNode} method. */
+    static final Method SPECIFIC_NODE_MTD;
+
+    /** {@link DynamicConfiguration#specificConfigTree} method. */
+    static final Method SPECIFIC_CONFIG_TREE_MTD;
+
+    /** {@link ConfigurationUtil#addDefaults}. */
+    static final Method ADD_DEFAULTS_MTD;
+
+    /** {@link InnerNode#setInjectedNameFieldValue}. */
+    static final Method SET_INJECTED_NAME_FIELD_VALUE_MTD;
+
+    /** {@code ConfigurationNode#currentValue}. */
+    static final Method CURRENT_VALUE_MTD;
+
+    /** {@link DynamicConfiguration#isRemovedFromNamedList}. */
+    static final Method IS_REMOVED_FROM_NAMED_LIST_MTD;
+
+    /** {@link InnerNode#isPolymorphic}. */
+    static final Method IS_POLYMORPHIC_MTD;
+
+    /** {@link InnerNode#internalSchemaTypes}. */
+    static final Method INTERNAL_SCHEMA_TYPES_MTD;
+
+    /** {@code Node#convert} method name. */
+    static final String CONVERT_MTD_NAME = "convert";
+
+    /** {@link ConstructableTreeNode#construct(String, ConfigurationSource, 
boolean)} method name. */
+    static final String CONSTRUCT_MTD_NAME = "construct";
+
+    /** Field name for method {@link 
DynamicConfiguration#internalConfigTypes}. */
+    static final String INTERNAL_CONFIG_TYPES_FIELD_NAME = 
"_internalConfigTypes";
+
+    /** {@link DirectConfigurationProxy#DirectConfigurationProxy(List, 
DynamicConfigurationChanger)}. */
+    static final Constructor<?> DIRECT_CFG_CTOR;
+
+    /** {@link ConfigurationUtil#appendKey(List, Object)}. */
+    static final Method APPEND_KEY;

Review Comment:
   That's a laziness, I hated these constants in every class



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to