You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Edy Hinzen (JIRA)" <de...@velocity.apache.org> on 2010/03/11 11:30:27 UTC

[jira] Created: (VELOCITY-758) Include line number in message "#parse() null argument"

Include line number in message "#parse() null argument"
-------------------------------------------------------

                 Key: VELOCITY-758
                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
             Project: Velocity
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 1.6.2
            Reporter: Edy Hinzen
            Priority: Trivial


Assume the following scenarios:

Scenario A)
A template has the following line:
#parse("never-found-template.vm")

Scenario B)
A template has the following line:
#parse($nonsense)

Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.

In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
In scenario B) the log says "#parse() null argument"

Problem:
In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.

Sugestion / Feature request:
Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)

Thanks and kind regards

Edy Hinzen


-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-758) Include line number in message "#parse() null argument"

Posted by "Edy Hinzen (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850809#action_12850809 ] 

Edy Hinzen commented on VELOCITY-758:
-------------------------------------

Thanks, guys

> Include line number in message "#parse() null argument"
> -------------------------------------------------------
>
>                 Key: VELOCITY-758
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Edy Hinzen
>            Priority: Trivial
>             Fix For: 1.7, 2.0
>
>         Attachments: velocity-758.patch
>
>
> Assume the following scenarios:
> Scenario A)
> A template has the following line:
> #parse("never-found-template.vm")
> Scenario B)
> A template has the following line:
> #parse($nonsense)
> Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.
> In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
> In scenario B) the log says "#parse() null argument"
> Problem:
> In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.
> Sugestion / Feature request:
> Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)
> Thanks and kind regards
> Edy Hinzen

-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Resolved: (VELOCITY-758) Include line number in message "#parse() null argument"

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nathan Bubna resolved VELOCITY-758.
-----------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0
                   1.7

> Include line number in message "#parse() null argument"
> -------------------------------------------------------
>
>                 Key: VELOCITY-758
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Edy Hinzen
>            Priority: Trivial
>             Fix For: 1.7, 2.0
>
>         Attachments: velocity-758.patch
>
>
> Assume the following scenarios:
> Scenario A)
> A template has the following line:
> #parse("never-found-template.vm")
> Scenario B)
> A template has the following line:
> #parse($nonsense)
> Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.
> In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
> In scenario B) the log says "#parse() null argument"
> Problem:
> In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.
> Sugestion / Feature request:
> Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)
> Thanks and kind regards
> Edy Hinzen

-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-758) Include line number in message "#parse() null argument"

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850557#action_12850557 ] 

Nathan Bubna commented on VELOCITY-758:
---------------------------------------

I'm not sure that throwing an exception for #parse($nullref) is the thing to do here.  For that matter, i don't think the current behavior is correct either, since it precludes the include event.   Seems to me we should give any IncludeEventHandler the shot ot replacing a null value.  And if the value is still null, then we should render "#parse($nullref)" instead of throwing an exception.   When not in strict mode, i think exceptions should be limited to syntactical errors as much as possible.  Null values are not syntax errors.

> Include line number in message "#parse() null argument"
> -------------------------------------------------------
>
>                 Key: VELOCITY-758
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Edy Hinzen
>            Priority: Trivial
>         Attachments: velocity-758.patch
>
>
> Assume the following scenarios:
> Scenario A)
> A template has the following line:
> #parse("never-found-template.vm")
> Scenario B)
> A template has the following line:
> #parse($nonsense)
> Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.
> In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
> In scenario B) the log says "#parse() null argument"
> Problem:
> In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.
> Sugestion / Feature request:
> Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)
> Thanks and kind regards
> Edy Hinzen

-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Updated: (VELOCITY-758) Include line number in message "#parse() null argument"

Posted by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org>.
     [ https://issues.apache.org/jira/browse/VELOCITY-758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jarkko Viinamäki updated VELOCITY-758:
--------------------------------------

    Attachment: velocity-758.patch

This should fix it.

Note that the Velocity code is full of cases where an Exception is not thrown and instead some (often very uninformative) message is written to the log. Someone should find the time to fix all those cases.

> Include line number in message "#parse() null argument"
> -------------------------------------------------------
>
>                 Key: VELOCITY-758
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Edy Hinzen
>            Priority: Trivial
>         Attachments: velocity-758.patch
>
>
> Assume the following scenarios:
> Scenario A)
> A template has the following line:
> #parse("never-found-template.vm")
> Scenario B)
> A template has the following line:
> #parse($nonsense)
> Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.
> In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
> In scenario B) the log says "#parse() null argument"
> Problem:
> In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.
> Sugestion / Feature request:
> Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)
> Thanks and kind regards
> Edy Hinzen

-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org


[jira] Commented: (VELOCITY-758) Include line number in message "#parse() null argument"

Posted by "Nathan Bubna (JIRA)" <de...@velocity.apache.org>.
    [ https://issues.apache.org/jira/browse/VELOCITY-758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850560#action_12850560 ] 

Nathan Bubna commented on VELOCITY-758:
---------------------------------------

On second thought, i like the event handler support for null meaning don't render.  So we just log the null reference and blockinput.  I do still want to give the event handler a shot at null values.

> Include line number in message "#parse() null argument"
> -------------------------------------------------------
>
>                 Key: VELOCITY-758
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-758
>             Project: Velocity
>          Issue Type: Improvement
>          Components: Engine
>    Affects Versions: 1.6.2
>            Reporter: Edy Hinzen
>            Priority: Trivial
>         Attachments: velocity-758.patch
>
>
> Assume the following scenarios:
> Scenario A)
> A template has the following line:
> #parse("never-found-template.vm")
> Scenario B)
> A template has the following line:
> #parse($nonsense)
> Assume further, that neither the "never-found-template.vm" is present nor the variable "$nonsense" is set.
> In scenario A) the log reports "#parse(): cannot find template 'never-found-template.vm', called from template ... at (1, 1)"
> In scenario B) the log says "#parse() null argument"
> Problem:
> In scenario B), having multiple nested #parse-Statements, it's hard to find the error finally.
> Sugestion / Feature request:
> Include source information and line numbers when reporting "#parse() null argument" - analogous to scenario A)
> Thanks and kind regards
> Edy Hinzen

-- 
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@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org