Quick fix many problems at once
Asked Answered
C

6

41

Is it possible to quick fix all errors in a class opened in Eclipse?

I have 71 errors that are pretty much the same, I would rather not do it one-by-one.

(Note: I am quick fixing a Java file)

Claudetta answered 20/7, 2011 at 12:8 Comment(0)
Q
26

Often, you can fix errors en masse. There are several ways. I recommend going to your Problems view, selecting one of the errors, and hitting Ctrl-1 (quick fix). It should offer you the chance to fix all the errors of the selected type, in all files.

You can also mouse over the error in the text editor and wait for a popup; it should say "fix 70 other errors of this type". Doing it this way applies only to the specific file.

Quickel answered 20/7, 2011 at 18:53 Comment(5)
Did they take out the "Fix 70 other errors of this type" function. I stumbled upon this answer and was super excited but I don't see it. The Markers show the errors and we can fix that too, but it doesn't work because it limits us to 100 errors and there are 2600 of 'em! (doing a little refactoring....)Sequence
Not sure about that feature disappearing. As for the limit, can you modify the view to show more than 100 errors?Quickel
yeah, found it eventually!Sequence
@PeterTurner Where is it? I'm trying to do the same thing.Spectral
I used to have "fix N other errors" as well. After my upgrade to Luna it's gone. In the Problems view I can select two identical error messages for instance nnn cannot be resolved or is not a field (need to change to getter). Two identical errors for the same variable in the same source, if I select both and quick-fix it tells me the selected problems do not have a common applicable quick fix ???Iou
C
17

It depends on type of errors.If error are there because of missing imports then you can solve it by pressing CTRL + SHIFT + O. For other errors you have to solve one by one [AFAIK].

Companion answered 20/7, 2011 at 12:11 Comment(1)
Thanks, but it's not imports (which are warnings by the way).Claudetta
P
1

As far as I know, there's no way to do this. Sorry!

Pedanticism answered 20/7, 2011 at 12:9 Comment(0)
H
1

You would get better answers if you would specify the error type. And if errors are too similar -hopefully identical-, you can always use find&replace tool.

Hogshead answered 20/7, 2011 at 12:15 Comment(2)
For what it helps you: The constructor BinaryContractInfo<String>(VarInfo, VarInfo, Class<capture#42-of ?>, Object, Object, String) is undefined DaikonConversionUtils.javaClaudetta
I'm guessing problem is caused by either number of or types of parameters is not matching. In that case unless you are going to construct with same parameters all the time -which is unlikely-, you have to go through them one by one. This can only be made easier with methods mentioned in Ladlestein's answers, if that's not the exact answer you need.Hogshead
P
0

There are certain errors/warnings which you can fix in one go in a file e.g. missing NON-NLS tags. When you hover on an error, the quick fix list will show something like 'Fix n problems of same kind'.

In other cases you could use a cleanup, e.g. for missing @Override annotation.

Panta answered 20/7, 2011 at 12:33 Comment(0)
A
0

All imports fix as CTRL + SHIFT + M

Autorotation answered 24/6, 2015 at 12:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.