Tuesday, 14 August 2007
Excluding Unfixables from Eclipse Problem View
« Java Timezone Wrong on Fedora | Main | The Case Against Software Patents »
I find myself using Eclipse for most of my development now. I still bounce back and forth to a text editor (I love jEdit) for writing xml and an interactive scripting language environment, but for java projects the Eclipse tool stack is really valueable.
The problem view in particular is extremely useful, it will show you errors and warnings throughout the project, and with one click take you right to the line where the problem is. I try very hard to refer to this a lot and all errors and all warnings that it surfaces. Warnings is a little hard, and sometimes this means doing things like putting in @SuppressWarnings("unchecked") when mixing generics and pre-generics code. I also clean up my imports (CTRL-O) a lot more. The reason I'm so aggressive with these is that if I keep the list short then new things that pop onto it are much more visible, which helps me prevent them from becoming bigger problems.
One thing that makes this difficult is generated code, or imported 3rd party files. For a long time, I couldn't figure out how to exclude files or directories from the scope of problem detection and validation. It turns out this is extremely easy and can be refined all the way down to the file level.
You do this by using working sets. The trick is to define a similar working set for problem detection scope to the one you typically use under "Select Working Set". Do this via Window->Working Sets->Edit, or any other way to access working sets. You will leave most things from your selected working set in the problem detection working set, except for the few things you want to exclude. Then in the problem view, click "configure the filters to be applied to this view", and then click the select button under the "on working set:" radio button. You can then change to your problem detection scope working set and voila, unfixable things can be excluded by keeping them out of the working set.
Technorati Tags: eclipse working-set problem-view
Posted by at 1:04 PM in stuff about java
[Trackback URL for this entry]

thanks a million! who knew that the solution was not only possible but completely simple and flexable as well?!? My team is already benefiting from this great info.