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/09/29 05:19:37 UTC
[PR] [incubator-kie#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
tkobayas opened a new pull request, #7136:
URL: https://github.com/apache/incubator-kie/pull/7136
…ic) is deprecated
- Annotate the method with @Deprecated
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136#issuecomment-5886918230
@yesamer Thank you for the suggestion, and I have updated the annotation and the javadoc.
Btw, I have found that exec-model has an issue with `@propertyChangeSupport`, https://github.com/apache/incubator-kie/issues/7137 so I'm going to work on it first. Thanks.
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136#issuecomment-5886986107
Thank you! THat was deprecated looong time ago I see
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas commented on code in PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136#discussion_r4139673267
##########
drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/consequence/DroolsImpl.java:
##########
@@ -54,9 +54,11 @@ public class DroolsImpl implements Drools, org.kie.api.runtime.rule.RuleContext
@Override
public void insert(Object object) {
- insert( object, false );
+ TerminalNode terminalNode = ((InternalMatch)getMatch()).getTerminalNode();
+ ((InternalWorkingMemoryEntryPoint)reteEvaluator.getDefaultEntryPoint()).insert(object, false, getRule(), terminalNode);
Review Comment:
fixed
##########
drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java:
##########
@@ -42,15 +42,18 @@ public interface WorkingMemoryEntryPoint extends EntryPoint {
* Insert a fact registering JavaBean <code>PropertyChangeListeners</code>
* on the Object to automatically trigger <code>update</code> calls
* if <code>dynamic</code> is <code>true</code>.
- *
+ *
* @param object
* The fact object.
* @param dynamic
* true if Drools should add JavaBean
* <code>PropertyChangeListeners</code> to the object.
- *
+ *
* @return The new fact-handle associated with the object.
+ * @deprecated Use {@link org.kie.api.runtime.KieSession#insert(Object)} and declare the fact type
+ * with {@code @propertyChangeSupport} instead.
Review Comment:
fixed
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136#discussion_r4130412895
##########
drools-model/drools-model-compiler/src/main/java/org/drools/modelcompiler/consequence/DroolsImpl.java:
##########
@@ -54,9 +54,11 @@ public class DroolsImpl implements Drools, org.kie.api.runtime.rule.RuleContext
@Override
public void insert(Object object) {
- insert( object, false );
+ TerminalNode terminalNode = ((InternalMatch)getMatch()).getTerminalNode();
+ ((InternalWorkingMemoryEntryPoint)reteEvaluator.getDefaultEntryPoint()).insert(object, false, getRule(), terminalNode);
Review Comment:
This bypasses the existing virtual delegation through `insert(Object, boolean)`. A subclass that overrides that overload previously intercepted `insert(Object)` calls, but will no longer do so; deprecating the overload should not silently change dispatch behavior. Keep the original delegation while the deprecated method remains supported.
##########
drools-kiesession/src/main/java/org/drools/kiesession/consequence/DefaultKnowledgeHelper.java:
##########
@@ -121,9 +121,11 @@ public FactHandle insertAsync( final Object object ) {
}
public FactHandle insert(final Object object) {
- return insert( object, false );
+ return ((InternalWorkingMemoryEntryPoint) this.reteEvaluator.getDefaultEntryPoint())
+ .insert(object, false, this.internalMatch.getRule(), SuperCacheFixer.asTerminalNode(this.internalMatch.getTuple()));
Review Comment:
This direct entry-point call changes the method's virtual-dispatch behavior. Previously, subclasses of this public implementation could override `insert(Object, boolean)` and have `insert(Object)` delegate to it; now that override is bypassed. Deprecation should preserve existing behavior until removal, so retain the original delegation.
##########
drools-core/src/main/java/org/drools/core/WorkingMemoryEntryPoint.java:
##########
@@ -42,15 +42,18 @@ public interface WorkingMemoryEntryPoint extends EntryPoint {
* Insert a fact registering JavaBean <code>PropertyChangeListeners</code>
* on the Object to automatically trigger <code>update</code> calls
* if <code>dynamic</code> is <code>true</code>.
- *
+ *
* @param object
* The fact object.
* @param dynamic
* true if Drools should add JavaBean
* <code>PropertyChangeListeners</code> to the object.
- *
+ *
* @return The new fact-handle associated with the object.
+ * @deprecated Use {@link org.kie.api.runtime.KieSession#insert(Object)} and declare the fact type
+ * with {@code @propertyChangeSupport} instead.
Review Comment:
The replacement link points to `KieSession.insert`, which always inserts into the session's default entry point. This interface also represents named entry points, so following that advice can change where the fact is inserted. Link to the inherited `EntryPoint.insert(Object)` method instead to preserve the receiver's entry point.
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "yesamer (via GitHub)" <gi...@apache.org>.
yesamer commented on PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136#issuecomment-5885151449
@tkobayas Thank you for your PR.
Can you please using this convention to deprecate methods?
Add the since parameter:
`@Deprecated(since = "10.3.0", forRemoval = true)`
And add the reason of deprecation in java doc and if there's a suggested replacement
You can refer to the changes I introduced in this PR --> https://github.com/apache/incubator-kie/pull/6704/changes#diff-038d96d37b58b909c66aaa41fa6cabdaf209f452a376e29151e4d29a1eb2ff98R107
Thank you
--
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#7132] Clarify that insert(Object object, boolean dynam… [incubator-kie]
Posted by "tkobayas (via GitHub)" <gi...@apache.org>.
tkobayas merged PR #7136:
URL: https://github.com/apache/incubator-kie/pull/7136
--
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