[
https://issues.apache.org/jira/browse/FREEMARKER-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15718326#comment-15718326
]
Daniel Dekany commented on FREEMARKER-40:
-----------------------------------------
Sadly, I can't make the error message more helpful either, because by the time
it turns out that the missing value (the {{null}}) will cause an error, the
left-hand operand value object is already released. Without the left-hand
operand I can't figure out why the subvariable was null/missing. (I could
prolong the life of the left-hand operand by putting it into the
{{Environment}} as {{lastDotLHO}} or something, but other than it makes the
internal workings of FM even more intimidating, it would prevent the immediate
garbage collection of the left-hand operand, which I guess it too dangerous a
change with all the existing applications out there.)
> ClassIntrospector should detect public methods in non-public classes
> --------------------------------------------------------------------
>
> Key: FREEMARKER-40
> URL: https://issues.apache.org/jira/browse/FREEMARKER-40
> Project: Apache Freemarker
> Issue Type: Bug
> Components: engine
> Affects Versions: 2.3.25-incubating
> Reporter: Jochen Wiedmann
> Assignee: Daniel Dekany
> Priority: Minor
>
> In ClassIntrospector.discoverAccessibleMethods, the assumption is made, that
> only public classes can have accessible methods. This is plainly wrong: For
> example, a private object might be implementing an interface.
> Freemarker should detect public gettters, and treat them as accessible. At
> the very least, it should inform the user about the problem. A message like
> "Key <propertyName> was not found on an instance of ..."
> should be replaced by
> "Key <propertyName> was not found on an instance of ..."
> "A possible reason is,that the class must be public."
> Thanks,
> Jochen
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)