You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Alex Lumpov (Created) (JIRA)" <ji...@apache.org> on 2011/10/02 16:03:33 UTC

[jira] [Created] (TAP5-1679) Bug in InternalClassTransformationImpl

Bug in InternalClassTransformationImpl
--------------------------------------

                 Key: TAP5-1679
                 URL: https://issues.apache.org/jira/browse/TAP5-1679
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.2.6
            Reporter: Alex Lumpov
            Priority: Minor


For example, consider a two components:
public class Parent {
void beginRender(MarkupWriter writer) {
write("A");
}
}

public class Child extends Parent {
void beginRender(MarkupWriter writer) {
write("B");
}
}
Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
component Child should display "AB",
but in reality it displays "A".

The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
because it believes that it override A.beginRender. 
In the process of the transformation of the Child,
InternalClassTransformationImpl.TransformMethodImpl.isOverride()
looking for a method with the same signature in the Parent and it finds it.
All would be right, if the method beginRender was protected or public.

I think
To fix this bug method isOverride()
should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by Howard Lewis Ship <hl...@gmail.com>.
It's very easy to miss the fact that the two methods were private.  I
didn't notice it when I looked at this message. As such, there's
likely something to this.

On Mon, Oct 3, 2011 at 4:11 AM, Alex Lumpov (Commented) (JIRA)
<ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119244#comment-13119244 ]
>
> Alex Lumpov commented on TAP5-1679:
> -----------------------------------
>
> to Igor Drobiazko
> "You are overriding a method without calling the super method and wondering that the later is not called."
> Child.beginRender() never called.
> It is not important whether it call Parent.beginRender()
>
>
>> Bug in InternalClassTransformationImpl
>> --------------------------------------
>>
>>                 Key: TAP5-1679
>>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>>             Project: Tapestry 5
>>          Issue Type: Bug
>>          Components: tapestry-core
>>    Affects Versions: 5.2.6
>>            Reporter: Alex Lumpov
>>            Priority: Minor
>>
>> For example, consider a two components:
>> public class Parent {
>> void beginRender(MarkupWriter writer) {
>> write("A");
>> }
>> }
>> public class Child extends Parent {
>> void beginRender(MarkupWriter writer) {
>> write("B");
>> }
>> }
>> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
>> component Child should display "AB",
>> but in reality it displays "A".
>> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
>> because it believes that it override A.beginRender.
>> In the process of the transformation of the Child,
>> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
>> looking for a method with the same signature in the Parent and it finds it.
>> All would be right, if the method beginRender was protected or public.
>> I think
>> To fix this bug method isOverride()
>> should take into account the modifiers in the method signature.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: [jira] [Closed] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by Howard Lewis Ship <hl...@gmail.com>.
Thank you!  Basic Java.

On Sun, Oct 2, 2011 at 9:00 AM, Igor Drobiazko (Closed) (JIRA)
<ji...@apache.org> wrote:
>
>     [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
>
> Igor Drobiazko closed TAP5-1679.
> --------------------------------
>
>    Resolution: Invalid
>
> It's not a bug; it's expected behavior. You are overriding a method without calling the super method and wondering that the later is not called. Either invoke the super method from the sub-class's method or use @BeginRender annotation. Also beware of the ordering.
>
>> Bug in InternalClassTransformationImpl
>> --------------------------------------
>>
>>                 Key: TAP5-1679
>>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>>             Project: Tapestry 5
>>          Issue Type: Bug
>>          Components: tapestry-core
>>    Affects Versions: 5.2.6
>>            Reporter: Alex Lumpov
>>            Priority: Minor
>>
>> For example, consider a two components:
>> public class Parent {
>> void beginRender(MarkupWriter writer) {
>> write("A");
>> }
>> }
>> public class Child extends Parent {
>> void beginRender(MarkupWriter writer) {
>> write("B");
>> }
>> }
>> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
>> component Child should display "AB",
>> but in reality it displays "A".
>> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
>> because it believes that it override A.beginRender.
>> In the process of the transformation of the Child,
>> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
>> looking for a method with the same signature in the Parent and it finds it.
>> All would be right, if the method beginRender was protected or public.
>> I think
>> To fix this bug method isOverride()
>> should take into account the modifiers in the method signature.
>
> --
> This message is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] [Closed] (TAP5-1679) Bug in InternalClassTransformationImpl

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

Igor Drobiazko closed TAP5-1679.
--------------------------------

    Resolution: Invalid

It's not a bug; it's expected behavior. You are overriding a method without calling the super method and wondering that the later is not called. Either invoke the super method from the sub-class's method or use @BeginRender annotation. Also beware of the ordering.
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119226#comment-13119226 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

Or this example
public class Parent {
@BeginRender
private void writeLetter(MarkupWriter writer) {
write("A");
}
}

public class Child extends Parent {
@BeginRender
private void writeLetter(MarkupWriter writer) {
write("B");
}
} 

On the ideology of the OOP, when I inherit a class I don't have to worry about private methods with super-class. And in this case it turns out that if I accidentally declare the method is the same for signature with a private method of the super class, it will not be executed.
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119244#comment-13119244 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

to Igor Drobiazko
"You are overriding a method without calling the super method and wondering that the later is not called."
Child.beginRender() never called.
It is not important whether it call Parent.beginRender()

                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119226#comment-13119226 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

Or this example
public class Parent {
@BeginRender
private void writeLetter(MarkupWriter writer) {
write("A");
}
}

public class Child extends Parent {
@BeginRender
private void writeLetter(MarkupWriter writer) {
write("B");
}
} 

On the ideology of the OOP, when I inherit a class I don't have to worry about private methods with super-class. And in this case it turns out that if I accidentally declare the method is the same for signature with a private method of the super class, it will not be executed.
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119222#comment-13119222 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

Iets consider a two components:
public class Parent {
private void beginRender(MarkupWriter writer) {
write("A");
}
}

public class Child extends Parent {
private void beginRender(MarkupWriter writer) {
write("B");
}
} 

I am not overriding method because method is private
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119222#comment-13119222 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

Iets consider a two components:
public class Parent {
private void beginRender(MarkupWriter writer) {
write("A");
}
}

public class Child extends Parent {
private void beginRender(MarkupWriter writer) {
write("B");
}
} 

I am not overriding method because method is private
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (TAP5-1679) Bug in InternalClassTransformationImpl

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

Igor Drobiazko closed TAP5-1679.
--------------------------------

    Resolution: Invalid

It's not a bug; it's expected behavior. You are overriding a method without calling the super method and wondering that the later is not called. Either invoke the super method from the sub-class's method or use @BeginRender annotation. Also beware of the ordering.
                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (TAP5-1679) Bug in InternalClassTransformationImpl

Posted by "Alex Lumpov (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-1679?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119244#comment-13119244 ] 

Alex Lumpov commented on TAP5-1679:
-----------------------------------

to Igor Drobiazko
"You are overriding a method without calling the super method and wondering that the later is not called."
Child.beginRender() never called.
It is not important whether it call Parent.beginRender()

                
> Bug in InternalClassTransformationImpl
> --------------------------------------
>
>                 Key: TAP5-1679
>                 URL: https://issues.apache.org/jira/browse/TAP5-1679
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.2.6
>            Reporter: Alex Lumpov
>            Priority: Minor
>
> For example, consider a two components:
> public class Parent {
> void beginRender(MarkupWriter writer) {
> write("A");
> }
> }
> public class Child extends Parent {
> void beginRender(MarkupWriter writer) {
> write("B");
> }
> }
> Judging by the documentation (http://tapestry.apache.org/component-rendering.html)
> component Child should display "AB",
> but in reality it displays "A".
> The fact that RenderPhaseMethodWorker does not process the method B.beginRender,
> because it believes that it override A.beginRender. 
> In the process of the transformation of the Child,
> InternalClassTransformationImpl.TransformMethodImpl.isOverride()
> looking for a method with the same signature in the Parent and it finds it.
> All would be right, if the method beginRender was protected or public.
> I think
> To fix this bug method isOverride()
> should take into account the modifiers in the method signature.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira