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



##########
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:
       Not, really. For example, there's a comment above:
   ```
   newValue = new DynamicProperty(this.keys, fieldName, rootKey, changer, 
listenOnly, injectedNameField);
   ```
   Looks like some parameters a missing, no?
   
   And I don't understand, why do you need to pass the prefix and the super key 
in case of injected names. (Of course I can read the code, but I think this 
place deserves a better explanation)




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