[
https://issues.apache.org/jira/browse/OGNL-21?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13104015#comment-13104015
]
Daniel Pitts commented on OGNL-21:
----------------------------------
I'm glad you asked :-)
I use IntelliJ idea which uses static analysis to detect and highlight unused
members. After removing those unused members, I ran the unit tests to verify
nothing broke.
I did notice a few methods in OgnlOps which are only accessed "reflectively",
and I left them alone. Incidentally, those should probably be "unit-tested"
and document.
My patch does run the risk of removing methods which might be used by external
projects. I can't imagine it would seem like a good idea to call into
OgnlRuntime manually though. The nice thing about SVN is we can resurrect any
code which shouldn't have been deleted (eg, was intended to be a public utility
API method).
My personal philosophy is if it didn't break when I removed something, then the
something was unnecessary or needs to be better tested :-)
> Remove dead and broken code from OgnlRuntime/SimpleNode
> -------------------------------------------------------
>
> Key: OGNL-21
> URL: https://issues.apache.org/jira/browse/OGNL-21
> Project: OGNL
> Issue Type: Task
> Reporter: Daniel Pitts
> Labels: cleanup
> Attachments: Remove-dead-code.patch
>
>
> I noticed there are some apparently unnecessary methods in both SimpleNode
> and OgnlRuntime.
> I've created a patch which removes them, and the unit tests still run fine.
> One of the methods was clearly buggy and would cause ClassCastExceptions if
> used (it put an array into a cache which was used to also store Maps).
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira