A DESCRIPTION OF THE PROBLEM :
I refactored single line below
throw new RuntimeException("Error");
into a function
public void throwException() throws RuntimeException {
throw new RuntimeException("Error");
}
There was a method
public String test(String msg) throws RuntimeException {
If(msg == null)
throwException();
else
return msg;
}
The above method is showing compilation error which is not logical.
I refactored single line below
throw new RuntimeException("Error");
into a function
public void throwException() throws RuntimeException {
throw new RuntimeException("Error");
}
There was a method
public String test(String msg) throws RuntimeException {
If(msg == null)
throwException();
else
return msg;
}
The above method is showing compilation error which is not logical.