[Httpunit-commit] CVS: httpunit/src/com/meterware/httpunit HttpUnitOptions.java,1.33,1.34
Brought to you by:
russgold
From: Russell G. <rus...@us...> - 2002-11-26 11:56:00
|
Update of /cvsroot/httpunit/httpunit/src/com/meterware/httpunit In directory sc8-pr-cvs1:/tmp/cvs-serv21694/src/com/meterware/httpunit Modified Files: HttpUnitOptions.java Log Message: Some cleanup to tolerate missing jars Index: HttpUnitOptions.java =================================================================== RCS file: /cvsroot/httpunit/httpunit/src/com/meterware/httpunit/HttpUnitOptions.java,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- HttpUnitOptions.java 6 Nov 2002 13:10:41 -0000 1.33 +++ HttpUnitOptions.java 26 Nov 2002 11:55:57 -0000 1.34 @@ -62,7 +62,13 @@ public static HTMLParser getHTMLParser() { - return _htmlParser; + if (_nekoParser != null) { + return _nekoParser; + } else if (_jtidyParser != null) { + return _jtidyParser; + } else { + throw new RuntimeException( "No HTML parser found. Make sure that either nekoHTML.jar or Tidy.jar is in the in classpath" ); + } } @@ -511,8 +517,6 @@ private static boolean _exceptionsThrownOnScriptError = true; - private static HTMLParser _htmlParser; - private static HTMLParser _jtidyParser; private static HTMLParser _nekoParser; @@ -536,7 +540,5 @@ } catch (IllegalAccessException e) { } catch (ClassNotFoundException e) { } - - _htmlParser = (_nekoParser == null) ? _jtidyParser : _nekoParser; } } |