Enerjy has a problem with this line of code:
private static List<ParseTree> getTestTrees(Xml test) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
This is the warning:
(Baseline) JAVA0126 Method 'getTestTrees' declares unchecked exception 'IllegalArgumentException' in throws
How can I fix this? What is the problem? What does it mean for an exception to be “unchecked”?
“Unchecked” exceptions (also known as runtime exceptions) are those that the compiler does not force you to catch. For example, imagine if you had to declare and catch
NullPointerExceptioneverywhere it might occur. These are the types of exceptions that, if they occur, the assumption is your program likely can’t recover anyway.The compiler is telling you to remove
IllegalArgumentExceptionfrom thethrowsclause of your method.