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

[jira] Created: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

private methods in class heirarchy override each other with @SetupRender annotation
-----------------------------------------------------------------------------------

                 Key: TAP5-1263
                 URL: https://issues.apache.org/jira/browse/TAP5-1263
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.1.0.5
            Reporter: Paul Stanton


I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.

Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".

However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.

This is concerning because
1. there should never be a requirement that a sub-class knows of it's super-classes implementation
2. if hierarchy does come into play, the subclass should override the super class.

CASE 1:
------------------
public abstract class StartBase {
   @SetupRender
   private void init() {
       log.debug("setupRender2");
   }
}

public class Start extends StartBase {
   @SetupRender
   private void init() {
       log.debug("setupRender1");
   }
}

CASE 2:
------------------
public abstract class StartBase {
   @SetupRender
   private void init2() {
       log.debug("setupRender2");
   }
}

public class Start extends StartBase {
   @SetupRender
   private void init1() {
       log.debug("setupRender1");
   }
} 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Howard M. Lewis Ship commented on TAP5-1263:
--------------------------------------------

Makes sense to me, private methods are never overrides will probably make all of this work correctly.  Tests will show this for sure.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914962#action_12914962 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Sorry for delay, i was working hard on Wooki.

It seems like method.isOverride() returns true for init() method in 'Start'. Thus it is excluded from code generation and nothing special is generated for sub-class as if it was a public / overriden method.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Assigned: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Christophe Cordenier reassigned TAP5-1263:
------------------------------------------

    Assignee: Christophe Cordenier

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915270#action_12915270 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Doing this solves the rendering process, but i see weird behaviours in 'verify_event_handler_invocation_order_and_circumstance' results (CoreTests) 

I have to investigate more before committing...

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915637#action_12915637 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

We can say that the test was flawed since it uses 'private' scope methods that are executed now (in the parent and the child class), but was not executed before changing 'isOverride' algorithm.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915273#action_12915273 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Ok, everything works as expected but this will also have impact on Event dispatching, i.e. in 'verify_event_handler_invocation_order_and_circumstance' results (CoreTests) more handlers are executed ?

@committers Do you think this logic applies to event dispatching too ? 

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914962#action_12914962 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Sorry for delay, i was working hard on Wooki.

It seems like method.isOverride() returns true for init() method in 'Start'. Thus it is excluded from code generation and nothing special is generated for sub-class as if it was a public / overriden method.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Howard M. Lewis Ship commented on TAP5-1263:
--------------------------------------------

Makes sense to me, private methods are never overrides will probably make all of this work correctly.  Tests will show this for sure.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Howard M. Lewis Ship commented on TAP5-1263:
--------------------------------------------

It is possible that the test itself is flawed.  Do you have more details on how the behavior has changed?

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Assigned: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Christophe Cordenier reassigned TAP5-1263:
------------------------------------------

    Assignee: Christophe Cordenier

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

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

Howard M. Lewis Ship commented on TAP5-1263:
--------------------------------------------

It is possible that the test itself is flawed.  Do you have more details on how the behavior has changed?

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915273#action_12915273 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Ok, everything works as expected but this will also have impact on Event dispatching, i.e. in 'verify_event_handler_invocation_order_and_circumstance' results (CoreTests) more handlers are executed ?

@committers Do you think this logic applies to event dispatching too ? 

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915270#action_12915270 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

Doing this solves the rendering process, but i see weird behaviours in 'verify_event_handler_invocation_order_and_circumstance' results (CoreTests) 

I have to investigate more before committing...

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914971#action_12914971 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

@Paul, Just for information, if you set public visibility on init() in your sub-class then it works.

Since visibility cannot be reduced in Java and case above works as expected : parent before child and execution of the two methods (private and public)

@Committers I suggest to modify TransformMethodImpl.isOverride() and return false by default when visibility of method is private ? I have made some tests, it seems to work well. What's your opinion ?

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12915637#action_12915637 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

We can say that the test was flawed since it uses 'private' scope methods that are executed now (in the parent and the child class), but was not executed before changing 'isOverride' algorithm.

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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


[jira] Commented: (TAP5-1263) private methods in class heirarchy override each other with @SetupRender annotation

Posted by "Christophe Cordenier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1263?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12914971#action_12914971 ] 

Christophe Cordenier commented on TAP5-1263:
--------------------------------------------

@Paul, Just for information, if you set public visibility on init() in your sub-class then it works.

Since visibility cannot be reduced in Java and case above works as expected : parent before child and execution of the two methods (private and public)

@Committers I suggest to modify TransformMethodImpl.isOverride() and return false by default when visibility of method is private ? I have made some tests, it seems to work well. What's your opinion ?

> private methods in class heirarchy override each other with @SetupRender annotation
> -----------------------------------------------------------------------------------
>
>                 Key: TAP5-1263
>                 URL: https://issues.apache.org/jira/browse/TAP5-1263
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.1.0.5
>            Reporter: Paul Stanton
>            Assignee: Christophe Cordenier
>
> I've found a strange issue with the @SetupRender annotation when used in a class hierarchy.
> Typically, in java 2 classes within a hierarchy can have the same signature for a private method and not effect each other, so I would expect this to be the case when both of these private methods are annotated with @SetupRender. Therefore the output for case 1 and case 2 (below) should be the same and print both messages "setupRender2", "setupRender1".
> However case 1 only prints "setupRender2" meaning it somehow overwrites the method in it's implementing class.
> This is concerning because
> 1. there should never be a requirement that a sub-class knows of it's super-classes implementation
> 2. if hierarchy does come into play, the subclass should override the super class.
> CASE 1:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init() {
>        log.debug("setupRender1");
>    }
> }
> CASE 2:
> ------------------
> public abstract class StartBase {
>    @SetupRender
>    private void init2() {
>        log.debug("setupRender2");
>    }
> }
> public class Start extends StartBase {
>    @SetupRender
>    private void init1() {
>        log.debug("setupRender1");
>    }
> } 

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