You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2013/03/15 15:08:13 UTC

[jira] [Updated] (CAY-1803) Define toString() in path expressions

     [ https://issues.apache.org/jira/browse/CAY-1803?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrus Adamchik updated CAY-1803:
---------------------------------

    Summary: Define toString() in path expressions  (was: Define toString() in path epxressions)
    
> Define toString() in path expressions
> -------------------------------------
>
>                 Key: CAY-1803
>                 URL: https://issues.apache.org/jira/browse/CAY-1803
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Trivial
>             Fix For: 3.2M1
>
>
> Expression.toString() is pretty heavy:
>  @Override
>     public String toString() {
>         StringWriter buffer = new StringWriter();
>         PrintWriter pw = new PrintWriter(buffer);
>         encodeAsString(pw);
>         pw.close();
>         buffer.flush();
>         return buffer.toString();
>     }
> We didn't bother much about it, as it wasn't supposed to be called in runtime... Well it is sometimes:
> SelectTranslator,java:
> 433 String labelPrefix = pathExp.toString().substring("db:".length());
> And I am seeing this line occasionally in my app profiling reports. So we need to override "toString" at least for ASTObjPath and ASTDbPath with a lighter implementation

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira