I have a utility class that checks to see if isNumeric or not by doing the following:
public static boolean isNumeric(String text) {
try {
Double.parseDouble(text);
} catch (NumberFormatException nfe) {
return false;
}
return true;
}
IntelliJ returns the following error:
Warning:(30, 20) Result of 'Double.parseDouble()' is ignored
How can I refactor my code to avoid this error message? I don't need the result of Double.parseDouble()
to do anything and I don't want to also suppress the error message.