protected boolean doAssert(boolean value, CharSequence message) { if (!value) { super.doAssert(value, message); // Logs error. if (JUNIT_ERROR_CONSTRUCTOR != null) { RuntimeException junitError = (RuntimeException) JUNIT_ERROR_CONSTRUCTOR.newInstance(message.toString()); throw junitError; } else { throw new AssertionException(message.toString()); } } return true; } private static Reflection.Constructor JUNIT_ERROR_CONSTRUCTOR
public void parse(String systemId) throws IOException, SAXException { InputStream inStream; try { Object url = NEW_URL.newInstance(systemId); inStream = (InputStream) OPEN_STREAM.invoke(url); } catch (Exception urlException) { // Try as filename. try { inStream = (InputStream) NEW_FILE_INPUT_STREAM.newInstance(systemId); } catch (Exception fileException) { throw new UnsupportedOperationException("Cannot parse " + systemId); } } parse(inStream); }