You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kie.apache.org by "tkobayas (via GitHub)" <gi...@apache.org> on 2026/07/10 09:04:10 UTC

[PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

tkobayas opened a new pull request, #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803

   …PojoInheritedFieldsConstructor
   
   - Closes https://github.com/apache/incubator-kie-drools/issues/6802


-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803#discussion_r3576723255


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/DeclaredTypesTest.java:
##########
@@ -663,14 +663,16 @@ public void testExtendPojo(RUN_TYPE runType) throws Exception {
     }
 
     @ParameterizedTest
-    @MethodSource("parameters")
+    @MethodSource("parametersPatternOnly")
     public void testExtendPojoInheritedFieldsConstructor(RUN_TYPE runType) throws Exception {
         // A declared type extending a Java (classpath) class must generate a full-argument
         // constructor that also includes the superclass @Position fields and forwards them to
-        // super(...). PositionalParent has @Position(0) name and @Position(1) age, so Child should
-        // expose Child(String name, int age, String dept). The executable model previously omitted
-        // the inherited fields, generating only Child(String dept), which failed to compile the
-        // 'new Child("Mario", 40, "Sales")' consequent.
+        // super(...). PositionalParent has @Position(0) name, @Position(1) age, and @Position(2) salary,
+        // so Child should expose Child(String name, int age, long salary, String dept). The executable
+        // model previously omitted the inherited fields, generating only Child(String dept), which
+        // failed to compile the 'new Child("Mario", 40, 50l, "Sales")' consequent.
+        // Note that in case of non-exec-model, a generated constructor arg order doesn't respect @Position,

Review Comment:
   Use an uppercase `L` for long literals in the explanatory comment (`50L`), to match the rest of the file and avoid confusion with `1`.



-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803#discussion_r3557712147


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/DeclaredTypesTest.java:
##########
@@ -663,14 +663,16 @@ public void testExtendPojo(RUN_TYPE runType) throws Exception {
     }
 
     @ParameterizedTest
-    @MethodSource("parameters")
+    @MethodSource("parametersPatternOnly")

Review Comment:
   By adding the 3rd field `@Position(2) private long salary` to `PositionalParent`, I can confirm that non-exec-model fails, because the generated constructor's arg order is non-deterministic. Disabling non-exec-model to avoid that the test could be unstable.



-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803#discussion_r3557712147


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/DeclaredTypesTest.java:
##########
@@ -663,14 +663,16 @@ public void testExtendPojo(RUN_TYPE runType) throws Exception {
     }
 
     @ParameterizedTest
-    @MethodSource("parameters")
+    @MethodSource("parametersPatternOnly")

Review Comment:
   After adding a third field, `@Position(2) private long salary`, to `PositionalParent`, I confirmed that the non-executable model fails because the generated constructor's argument order is non-deterministic.
   
   I'm disabling the non-executable model to avoid making the test unstable.
   



-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803#discussion_r3576857848


##########
drools-model/drools-model-codegen/src/test/java/org/drools/model/codegen/execmodel/DeclaredTypesTest.java:
##########
@@ -663,14 +663,16 @@ public void testExtendPojo(RUN_TYPE runType) throws Exception {
     }
 
     @ParameterizedTest
-    @MethodSource("parameters")
+    @MethodSource("parametersPatternOnly")
     public void testExtendPojoInheritedFieldsConstructor(RUN_TYPE runType) throws Exception {
         // A declared type extending a Java (classpath) class must generate a full-argument
         // constructor that also includes the superclass @Position fields and forwards them to
-        // super(...). PositionalParent has @Position(0) name and @Position(1) age, so Child should
-        // expose Child(String name, int age, String dept). The executable model previously omitted
-        // the inherited fields, generating only Child(String dept), which failed to compile the
-        // 'new Child("Mario", 40, "Sales")' consequent.
+        // super(...). PositionalParent has @Position(0) name, @Position(1) age, and @Position(2) salary,
+        // so Child should expose Child(String name, int age, long salary, String dept). The executable
+        // model previously omitted the inherited fields, generating only Child(String dept), which
+        // failed to compile the 'new Child("Mario", 40, 50l, "Sales")' consequent.
+        // Note that in case of non-exec-model, a generated constructor arg order doesn't respect @Position,

Review Comment:
   applied



-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org


Re: [PR] [incubator-kie-drools-6802] follow-up on DeclaredTypesTest.testExtend… [incubator-kie-drools]

Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas merged PR #6803:
URL: https://github.com/apache/incubator-kie-drools/pull/6803


-- 
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: commits-unsubscribe@kie.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@kie.apache.org
For additional commands, e-mail: commits-help@kie.apache.org