You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Dan Adams (JIRA)" <de...@tapestry.apache.org> on 2007/06/29 18:39:04 UTC

[jira] Created: (TAPESTRY-1615) ClassTransformation needs ability to rename a method and extend the beginning of a method

ClassTransformation needs ability to rename a method and extend the beginning of a method
-----------------------------------------------------------------------------------------

                 Key: TAPESTRY-1615
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1615
             Project: Tapestry
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.0.5
            Reporter: Dan Adams
             Fix For: 5.0.6


My original problem:

-------------------------------------------
Okay, so I'm creating a @Once annotation that when applied to a method
like so:

@Once
public List<Foos> getFoos() {
  // do some expensive operation like reading foos from the db
}

you can call getFoos() as much as you want and it will only actually
execute once, allowing you to reference foos many times in your template
(or elsewhere) without having to worry about doing expensive operations
multiple times or having to cache a value manually.

I had this working just fine in T4 because you could call the superclass
method but since this is transforming the class I can't call
super.getFoos(). ClassTransformation doesn't seem to have any methods
for renaming a method or replacing any calls to it.
--------------------------

This could be solved by either being able to rename a method so all calls go to your new method which can call the old method or by being able to add code to the beginning of a method similar to how extendMethod() currently adds to the end.


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


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


[jira] Resolved: (TAPESTRY-1615) ClassTransformation needs ability to rename a method and extend the beginning of a method

Posted by "Dan Adams (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Adams resolved TAPESTRY-1615.
---------------------------------

    Resolution: Fixed

Added ClassTransformation.prefixMethod() for adding code to the beginning of a method.

> ClassTransformation needs ability to rename a method and extend the beginning of a method
> -----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1615
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1615
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>            Reporter: Dan Adams
>            Assignee: Dan Adams
>             Fix For: 5.0.6
>
>
> My original problem:
> -------------------------------------------
> Okay, so I'm creating a @Once annotation that when applied to a method
> like so:
> @Once
> public List<Foos> getFoos() {
>   // do some expensive operation like reading foos from the db
> }
> you can call getFoos() as much as you want and it will only actually
> execute once, allowing you to reference foos many times in your template
> (or elsewhere) without having to worry about doing expensive operations
> multiple times or having to cache a value manually.
> I had this working just fine in T4 because you could call the superclass
> method but since this is transforming the class I can't call
> super.getFoos(). ClassTransformation doesn't seem to have any methods
> for renaming a method or replacing any calls to it.
> --------------------------
> This could be solved by either being able to rename a method so all calls go to your new method which can call the old method or by being able to add code to the beginning of a method similar to how extendMethod() currently adds to the end.

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


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


[jira] Assigned: (TAPESTRY-1615) ClassTransformation needs ability to rename a method and extend the beginning of a method

Posted by "Dan Adams (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Adams reassigned TAPESTRY-1615:
-----------------------------------

    Assignee: Dan Adams

> ClassTransformation needs ability to rename a method and extend the beginning of a method
> -----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1615
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1615
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>            Reporter: Dan Adams
>            Assignee: Dan Adams
>             Fix For: 5.0.6
>
>
> My original problem:
> -------------------------------------------
> Okay, so I'm creating a @Once annotation that when applied to a method
> like so:
> @Once
> public List<Foos> getFoos() {
>   // do some expensive operation like reading foos from the db
> }
> you can call getFoos() as much as you want and it will only actually
> execute once, allowing you to reference foos many times in your template
> (or elsewhere) without having to worry about doing expensive operations
> multiple times or having to cache a value manually.
> I had this working just fine in T4 because you could call the superclass
> method but since this is transforming the class I can't call
> super.getFoos(). ClassTransformation doesn't seem to have any methods
> for renaming a method or replacing any calls to it.
> --------------------------
> This could be solved by either being able to rename a method so all calls go to your new method which can call the old method or by being able to add code to the beginning of a method similar to how extendMethod() currently adds to the end.

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


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


[jira] Closed: (TAPESTRY-1615) ClassTransformation needs ability to rename a method and extend the beginning of a method

Posted by "Dan Adams (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dan Adams closed TAPESTRY-1615.
-------------------------------


> ClassTransformation needs ability to rename a method and extend the beginning of a method
> -----------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1615
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1615
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: tapestry-core
>    Affects Versions: 5.0.5
>            Reporter: Dan Adams
>            Assignee: Dan Adams
>             Fix For: 5.0.6
>
>
> My original problem:
> -------------------------------------------
> Okay, so I'm creating a @Once annotation that when applied to a method
> like so:
> @Once
> public List<Foos> getFoos() {
>   // do some expensive operation like reading foos from the db
> }
> you can call getFoos() as much as you want and it will only actually
> execute once, allowing you to reference foos many times in your template
> (or elsewhere) without having to worry about doing expensive operations
> multiple times or having to cache a value manually.
> I had this working just fine in T4 because you could call the superclass
> method but since this is transforming the class I can't call
> super.getFoos(). ClassTransformation doesn't seem to have any methods
> for renaming a method or replacing any calls to it.
> --------------------------
> This could be solved by either being able to rename a method so all calls go to your new method which can call the old method or by being able to add code to the beginning of a method similar to how extendMethod() currently adds to the end.

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


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