开发者

Problem with "Java Stack Trace Console" in eclipse!

The main goal of my job is to find and then remove all unuesd methods and classes in an extremly big project in Java. At the moment I work with UCdetector which is a plugins in eclipse and it provides me an HTML file with all information about the methods and classes which are not used in my project. Afterward for finding the locations of these methods and classes in my project, I run the "Java Stack Trace Console" in开发者_如何转开发 eclipse, but it shows me " Source not found for" ..... . For small programs it works well and it directs me exactly to the java source code but I do'nt know what is happening with my project!!!


I've witnessed a problem with white spaces before each line of the stacktrace.

Apparently the following has been fixed a long time ago: https://bugs.eclipse.org/bugs/show_bug.cgi?id=119611

But I still get an issue with a stacktraced copied from Weblogic logging. I noticed that block selecting the tabs in an editor, deleting, an replacing with spaces got this functionality to work again!


In Eclipse, right click the project that you're running this in, click Properties, then Java Build Path, then the Source tab.

You'll need to add source folder entry indicating where the source of this project is stored. If you've segmented it to /src/controllers and /src/models for instance, you'll need to add an entry for both of those.


The Stack Trace Console in Eclipse is intended for copy-paste of stack traces from remote sources, not for manual entry.

Consider going to the class in question with Ctrl-Shift-T, and then use the Outline view to locate the method you need.


Run UCDetector in eclipse, jump to unused code by clicking on UCDetector warnings in Eclipse Problems view.

Or try the UCDetector text report.


What you want is a code coverage tool, which will allow you to see what methods are called and what codepaths are not taken during a specific execution of your program. It will have a performance penalty, so don't use it on production systems, and keep in mind to test all possible inputs.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜