开发者

copy paste detector - how to avoid delegate pattern

We use CPD and works very well.

Some interfaces are implemented in multiple classes. These classes share the implementation code using 'delegate' pat开发者_运维百科tern [ http://en.wikipedia.org/wiki/Delegation_pattern ]. The resulting code sometime gets bigger and reported as duplicate code. How to skip this kind of problem?

Is there an annotation or specific comment pattern to skip duplicate code detection in select part of code?

There is one for PMD -- @SuppressWarnings("PMD"). Could there be something similar for CPD?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜