tkalkirill commented on a change in pull request #490:
URL: https://github.com/apache/ignite-3/pull/490#discussion_r766628199



##########
File path: 
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/asm/ConfigurationAsmGenerator.java
##########
@@ -1660,36 +1716,38 @@ private void addConfigurationImplConstructor(
 
         Constructor<?> superCtor = schemaClassInfo.direct ? 
DIRECT_DYNAMIC_CONFIGURATION_CTOR : DYNAMIC_CONFIGURATION_CTOR;
 
+        Variable thisVar = ctor.getThis();
+
         BytecodeBlock ctorBody = ctor.getBody()
-                .append(ctor.getThis())
+                .append(thisVar)
                 .append(ctor.getScope().getVariable("prefix"))
                 .append(ctor.getScope().getVariable("key"))
                 .append(rootKeyVar)
                 .append(changerVar)
                 .append(listenOnlyVar)
                 .invokeConstructor(superCtor);
 
-        BytecodeExpression thisKeysVar = ctor.getThis().getField("keys", 
List.class);
+        BytecodeExpression thisKeysVar = thisVar.getField("keys", List.class);
 
         int newIdx = 0;
         for (Field schemaField : concat(schemaFields, internalFields, 
polymorphicFields)) {
             String fieldName = schemaField.getName();
 
             BytecodeExpression newValue;
 
-            if (isValue(schemaField) || isPolymorphicId(schemaField)) {
-                Class<?> fieldImplClass = 
schemaField.isAnnotationPresent(DirectAccess.class)
-                        ? DirectDynamicProperty.class : DynamicProperty.class;
+            if (isValue(schemaField) || isPolymorphicId(schemaField) || 
isInjectedName(schemaField)) {
+                Class<?> fieldImplClass = isDirectAccess(schemaField) ? 
DirectDynamicProperty.class : DynamicProperty.class;
 
-                // newValue = new DynamicProperty(super.keys, fieldName, 
rootKey, changer, listenOnly);
+                // newValue = new DynamicProperty(this.keys, fieldName, 
rootKey, changer, listenOnly, injectedNameField);
                 newValue = newInstance(
                         fieldImplClass,
-                        thisKeysVar,
-                        constantString(fieldName),
+                        isInjectedName(schemaField) ? 
invokeStatic(REMOVE_LAST_KEY_MTD, thisKeysVar) : thisKeysVar,

Review comment:
       It's better?
   
   ```
   A field with @InjectedName is special (auxiliary), it is not stored in 
storages as a regular field, and therefore there is no direct access to it. 
   It is stored in the InnerNode and does not participate in its traversal, so 
in order to get it we need to get the InnerNode, and only then the value of 
this field.
   ```




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