You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Alexander Gavrilov (JIRA)" <ji...@apache.org> on 2010/09/28 08:32:33 UTC

[jira] Created: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
---------------------------------------------------------------------------------------------------------------------------

                 Key: TAP5-1284
                 URL: https://issues.apache.org/jira/browse/TAP5-1284
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.1.0.5
            Reporter: Alexander Gavrilov
            Assignee: Howard M. Lewis Ship
             Fix For: 5.2.1


It appears that the onActivate() method is called before the @PageActivationContext logic, which means the following can fail:

@PageActivationContext
private MyEntity entity;

void onActivate()
{
  if (entity == null) throw new RuntimeException("Entity not found.");
}

The RuntimeException is thrown even when a valid Entity is in the page activation context.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Alexander Gavrilov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Gavrilov updated TAP5-1284:
-------------------------------------

    Affects Version/s: 5.2.0
                           (was: 5.1.0.5)
          Description: 
It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:

public class BasePage { 
    private MyEntity entity; 
      
    protected void setEntity(MyEntity entity) { 
         this.entity = entity; 
    } 
       
    protected void onActivate() { 
        if (entity == null) throw new RuntimeException("Entity not found."); 
    } 
} 

public class ConcreteClass { 

    @PageActivationContext 
    private MyEntity entity; 

    protected void onActivate() { 
        setEntity(entity); 
        super.onActivate(); 
    } 
} 

Workaround is do not use methods overriding. 

The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   


  was:
It appears that the onActivate() method is called before the @PageActivationContext logic, which means the following can fail:

@PageActivationContext
private MyEntity entity;

void onActivate()
{
  if (entity == null) throw new RuntimeException("Entity not found.");
}

The RuntimeException is thrown even when a valid Entity is in the page activation context.

             Priority: Critical  (was: Major)

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.1
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1284:
---------------------------------------

    Fix Version/s: 5.2.2
                       (was: 5.2.1)

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.2
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1284:
---------------------------------------

    Fix Version/s:     (was: 5.2.2)
                   5.2.3

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.3
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1284:
---------------------------------------

    Fix Version/s:     (was: 5.2.2)
                   5.2.3

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.3
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAP5-1284:
---------------------------------------

    Fix Version/s: 5.2.2
                       (was: 5.2.1)

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.2
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TAP5-1284) When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon

Posted by "Alexander Gavrilov (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-1284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alexander Gavrilov updated TAP5-1284:
-------------------------------------

    Affects Version/s: 5.2.0
                           (was: 5.1.0.5)
          Description: 
It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:

public class BasePage { 
    private MyEntity entity; 
      
    protected void setEntity(MyEntity entity) { 
         this.entity = entity; 
    } 
       
    protected void onActivate() { 
        if (entity == null) throw new RuntimeException("Entity not found."); 
    } 
} 

public class ConcreteClass { 

    @PageActivationContext 
    private MyEntity entity; 

    protected void onActivate() { 
        setEntity(entity); 
        super.onActivate(); 
    } 
} 

Workaround is do not use methods overriding. 

The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   


  was:
It appears that the onActivate() method is called before the @PageActivationContext logic, which means the following can fail:

@PageActivationContext
private MyEntity entity;

void onActivate()
{
  if (entity == null) throw new RuntimeException("Entity not found.");
}

The RuntimeException is thrown even when a valid Entity is in the page activation context.

             Priority: Critical  (was: Major)

> When using @PageActivationContext and override a no-args activate event handler of parent page, the handler called too soon
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-1284
>                 URL: https://issues.apache.org/jira/browse/TAP5-1284
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.0
>            Reporter: Alexander Gavrilov
>            Assignee: Howard M. Lewis Ship
>            Priority: Critical
>             Fix For: 5.2.1
>
>
> It appears that the overrided onActivate() method is called before the @PageActivationContext logic, which means the following can fail:
> public class BasePage { 
>     private MyEntity entity; 
>       
>     protected void setEntity(MyEntity entity) { 
>          this.entity = entity; 
>     } 
>        
>     protected void onActivate() { 
>         if (entity == null) throw new RuntimeException("Entity not found."); 
>     } 
> } 
> public class ConcreteClass { 
>     @PageActivationContext 
>     private MyEntity entity; 
>     protected void onActivate() { 
>         setEntity(entity); 
>         super.onActivate(); 
>     } 
> } 
> Workaround is do not use methods overriding. 
> The problem is the consecuence of Howard's approach:  "if the child class *overrides* a method of the parent, then the overridden method will be invoked only by the parent class". When Tapestry performs transformation it skips OnEventWorker advice, which invoke event handler method of subclass and add it only for parent class. And required for @PageActivationContext chain of invocation breaks. My approach is that if some class override some event handler method of some class then Tapestry should stop advaicing parent class method invocation and should rely on subclass method definition and is the subclass implementor responibility to invoke parent class method.   

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.