I don't know the library you are using or how ConditionParseException
is implemented. However, it seems to be a so called checked exception.
A checked exception cannot be ignored, you have to somehow handle the case of an exception being thrown. This can be done either by catching it or by delegating it up to the caller of the method. In your current implementation, the latter one is done by adding the exception type to the list of throws
.
If you want to remove the exception from the throws
declaration, you have to handle it using a try-catch
block, e.g.:
try {
} catch (ConditionParseException ex) {
}
Another possibility would be to make it an unchecked exception. For this, handling an exception it is not mandatory. For a detailed explanation of both kinds of exception, let me refer to this question.
TL;DR
However, if you want to completely get rid of the ConditionParseException
type (since it is deprecated), you have to:
- click "yes" in the "Cannot perform refactoring" dialog
- remove every other use of
ConditionParseException
. (e.g. catch
blocks and throw new ConditionParseException
statements)
- remove the
ConditionParseException
java file.