[jboss-jira] [JBoss JIRA] Closed: (JBPM-813) GraphElement - hibernate - "this==runtimeAction.getGraphElement()"

Tom Baeyens (JIRA) jira-events at jboss.com
Tue Jan 2 05:59:27 EST 2007


     [ http://jira.jboss.com/jira/browse/JBPM-813?page=all ]

Tom Baeyens closed JBPM-813.
----------------------------

    Resolution: Done

object identity comparison (==) was replaced with .equals comparison

> GraphElement - hibernate - "this==runtimeAction.getGraphElement()"
> ------------------------------------------------------------------
>
>                 Key: JBPM-813
>                 URL: http://jira.jboss.com/jira/browse/JBPM-813
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions:  jBPM 3.1.2
>            Reporter: Rainer Alfoeldi
>         Assigned To: Tom Baeyens
>             Fix For: jBPM 3.1.4, jBPM 3.2 beta 1
>
>
> See http://www.jboss.com/index.html?module=bb&op=viewtopic&t=96099 for the corresponding forums entry (the field below won't accept this link...)
> Is it possible that 
> GraphElement
> ....
> List getRuntimeActionsForEvent(ExecutionContext executionContext, String eventType) {
>     List runtimeActionsForEvent = null;
>     List runtimeActions = executionContext.getProcessInstance().getRuntimeActions();
>     if (runtimeActions!=null) {
>       Iterator iter = runtimeActions.iterator();
>       while (iter.hasNext()) {
>         RuntimeAction runtimeAction = (RuntimeAction) iter.next();
>         // if the runtime-action action is registered on this element and this eventType
>         if ( (
> ===>>>>>   this==runtimeAction.getGraphElement()   <<<<=====
> )
>              && (eventType.equals(runtimeAction.getEventType()))
>            ) {
>           // ... add its action to the list of runtime actions 
>           if (runtimeActionsForEvent==null) runtimeActionsForEvent = new ArrayList();
>           runtimeActionsForEvent.add(runtimeAction.getAction());
>         }
>       }
>     }
>     return runtimeActionsForEvent;
>   }
> isn't really what you want?
> If you debug it you will (sometimes) have the situation that this is a straight forward Java Object and runtimeAction.getGraphElement() resolves to a Node$$EnhancerByCGLIB$$xxxxx. Both objects represent the same node (same id, the CGLIB even refs to the 'this' instance in its 'target' field.... but '==' obviously fails. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list