new
but is not thrown SC-W1085An exception was instantiated using the new
keyword. However, it was not thrown using the throw
keyword and is neither assigned to a variable nor passed as an argument. This makes the instantiation redundant. Either throw the exception or remove the statement entirely.
new IllegalArgumentException()
throw new IllegalArgumentException();