You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Henning Schmiedehausen (JIRA)" <ji...@apache.org> on 2006/10/12 18:42:36 UTC

[jira] Resolved: (VELOCITY-214) References to non-public members (inner classes, fields, etc.) should log a warning rather than failing silently

     [ http://issues.apache.org/jira/browse/VELOCITY-214?page=all ]

Henning Schmiedehausen resolved VELOCITY-214.
---------------------------------------------

    Resolution: Won't Fix
      Assignee:     (was: Daniel Resare)

Well, it does report the 

[info] Null reference [template 'testbed/test.vm', line 1, column 51] : $private.Bar cannot be resolved.

in the log file with Velocity 1.5. the problem here is, that we cannot really distinguish whether this is just a typo or really a private/protected function and even if we could, we do run chains of method lookups (e.g. for getters, we are looking for getfoo, getFoo, get("foo")) so reporting functions that we could not find would log a number of false positives that might be even more confusing than not explicitly logging non-accessible functions.

And as we don't want to play games with changing the visiblity of the methods on the fly, we are basically stuck with what we have. That is reporting "null reference, $private.Bar cannot be resolved". We should add a note to the manual, though.

> References to non-public members (inner classes, fields, etc.) should log a warning rather than failing silently
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: VELOCITY-214
>                 URL: http://issues.apache.org/jira/browse/VELOCITY-214
>             Project: Velocity
>          Issue Type: Bug
>          Components: Source
>    Affects Versions: 1.3.1
>         Environment: Operating System: other
> Platform: Other
>            Reporter: Daniel Resare
>            Priority: Minor
>             Fix For: 1.5
>
>         Attachments: test.vm, VelocibugTest.java
>
>
> When I try to access a property on an object through the context and the
> defining class of that object is a non-public inner class the reference fails as
> if there was no object for that key in the context.
> I'd like to at least get a userful error message in the log.
> I have reproduced this with both velocity-1.3.1 and cvs HEAD as of today.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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