[xwiki-devs] [idea] Velocity uberspector + annotations + deprecated code
Hi, Since we decided to switch to Java 1.5, I found a nice use for annotations. We can detect usage of deprecated APIs in java, but it is hard to do in velocity. One way we can accomplish this is by writing our own velocity uberspector, that checks if a method call is deprecated or not, and logs the calls to deprecated methods. This will allow us to easily spot deprecated code in our templates and fix them. The drawback is that it could slow things down a bit. The advantage is that as long as we properly use annotations, any deprecated method used will be listed in the log. -- Sergiu Dumitriu http://purl.org/net/sergiu/
On Mar 3, 2008, at 1:39 PM, Sergiu Dumitriu wrote:
Hi,
Since we decided to switch to Java 1.5, I found a nice use for annotations.
We can detect usage of deprecated APIs in java, but it is hard to do in velocity. One way we can accomplish this is by writing our own velocity uberspector, that checks if a method call is deprecated or not, and logs the calls to deprecated methods. This will allow us to easily spot deprecated code in our templates and fix them.
The drawback is that it could slow things down a bit.
The advantage is that as long as we properly use annotations, any deprecated method used will be listed in the log.
Sure that's a good idea. We had discussed this some time ago. The novelty is that we can now use annotations so we can use runtime annotations for this. I'm +1 for it. I don't think it should cause performance issues. Thanks -Vincent
Vincent Massol wrote:
On Mar 3, 2008, at 1:39 PM, Sergiu Dumitriu wrote:
Hi,
Since we decided to switch to Java 1.5, I found a nice use for annotations.
We can detect usage of deprecated APIs in java, but it is hard to do in velocity. One way we can accomplish this is by writing our own velocity uberspector, that checks if a method call is deprecated or not, and logs the calls to deprecated methods. This will allow us to easily spot deprecated code in our templates and fix them.
The drawback is that it could slow things down a bit.
The advantage is that as long as we properly use annotations, any deprecated method used will be listed in the log.
Sure that's a good idea. We had discussed this some time ago. The novelty is that we can now use annotations so we can use runtime annotations for this.
I'm +1 for it. I don't think it should cause performance issues.
Thanks -Vincent
See http://jira.xwiki.org/jira/browse/XWIKI-2169 -- Sergiu Dumitriu http://purl.org/net/sergiu/
participants (2)
-
Sergiu Dumitriu -
Vincent Massol