Java包循环检测:如何查找涉及的特定类? [英] Java package cycle detection: how do I find the specific classes involved?

查看:116
本文介绍了Java包循环检测:如何查找涉及的特定类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您建议使用什么工具来检测 Java包循环依赖
知道目标是明确列出检测到的'跨包循环'中涉及的特定类

What tool would you recommend to detect Java package cyclic dependencies, knowing that the goal is to list explicitly the specific classes involved in the detected 'across-packages cycle'?

我知道 classycle JDepend ,但他们都没有列出循环包依赖项中涉及的类。 Metrics 有一个有趣的图形表示循环,但它再次限于包,并且很难在某些时候阅读。

I know about classycle and JDepend, but they both fail to list the classes involved in a cyclic package dependency. Metrics has an interesting graphical representation of cycles, but it is again limited to packages, and quite difficult to read sometime.

我厌倦了得到:


你在这3个软件包之间有一个软件包循环依赖

你有每个xxx类
b $ b 祝你好运类和打破这个循环

你知道任何工具需要额外的步骤来实际向你解释为什么检测到周期(即'列出所涉及的类')?

Do you know any tool that takes the extra step to actually explain to you why the cycle is detected (i.e. 'list the involved classes')?

Riiight ...宣布结果的时间:

Riiight... Time to proclaim the results:

@ l7010.de:谢谢你的努力。我会投票给你(当我有足够的代表时),特别是对于'CAP'答案......但是CAP已经死了,不再与我的Eclipse 3.4兼容了。剩下的是商业广告,我只看免费软件。

@l7010.de: Thank you for the effort. I will vote you up (when I will have enough rep), especially for the 'CAP' answer... but CAP is dead in the water and no longer compatible with my Eclipse 3.4. The rest is commercial and I look only for freeware.

@ daniel6651:谢谢你,但是,如上所述,只有免费软件(很抱歉没有首先提到它) 。

@daniel6651: Thank you but, as said, freeware only (sorry to not have mentioned it in the first place).

@izb作为findbugs的常用用户(现在使用最新的1.3.5),我只需点击一下即可接受你的答案......如果可以的话向我解释一下激活findbug以检测任何循环的选项。该功能仅针对传递的0.8.7版本提及(查找'新样式检测器找到类之间的循环依赖'),我无法测试它。
更新:它现在有效,我有一个旧的findbugs配置文件,其中没有激活该选项。我仍然喜欢 CAD 虽然;)

@izb as a frequent user of findbugs (using the latest 1.3.5 right now), I am one click away to accept your answer... if you could explain to me what option there is to activate for findbug to detect any cycle. That feature is only mentioned for the 0.8.7 version in passing (look for 'New Style detector to find circular dependencies between classes'), and I am not able to test it. Update: It works now, and I had an old findbugs configuration file in which that option was not activated. I still like CAD though ;)

答案是......见我自己的(第二个)答案

THE ANSWER is... see my own (second) answer below

推荐答案

Findbugs可以检测循环类依赖,也有一个Eclipse插件。

Findbugs can detect circular class dependencies and has an Eclipse plugin too.

http://findbugs.sourceforge.net/

这篇关于Java包循环检测:如何查找涉及的特定类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆