Author: vrubezhny
Date: 2011-10-07 14:18:09 -0400 (Fri, 07 Oct 2011)
New Revision: 35475
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
Log:
JBIDE-9846 XHTML Syntax Validation goes into infinite loop in fillInStackTrace()
JBIDE-9828 NPE and ArrayIndexOutOfBoundsException occur in XHTML validator
Issues are fixed. JUnit Tests are created
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java
===================================================================
---
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2011-10-07
18:08:00 UTC (rev 35474)
+++
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/web/validation/XHTMLValidator.java 2011-10-07
18:18:09 UTC (rev 35475)
@@ -159,7 +159,6 @@
if (!handler.isWellFormedXHTML()) {
SAXParseException ex = handler.getException();
if (ex != null) {
- JSFModelPlugin.getDefault().logError(ex);
report.addError(ex.getLocalizedMessage(), ex.getLineNumber(), ex.getColumnNumber(),
uri);
}
return report;
@@ -183,16 +182,14 @@
xmlReader.parse(uri);
} catch (IOException e) {
JSFModelPlugin.getDefault().logError(e);
- report.addError(e.getLocalizedMessage(), 0, 0, uri);
} catch (SAXNotRecognizedException e) {
JSFModelPlugin.getDefault().logError(e);
} catch (SAXNotSupportedException e) {
JSFModelPlugin.getDefault().logError(e);
} catch (SAXException e) {
report.addError(e.getLocalizedMessage(), 0, 0, uri);
- } catch (Throwable x) {
- x.printStackTrace();
}
+
List<ElementLocation> locations = handler.getNonPairedOpenElements();
if (!locations.isEmpty()) {
for (ElementLocation location : locations) {
@@ -670,11 +667,9 @@
stream = new FilteredInputStream(connect.getInputStream());
}
} catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // Ignore (null will be returned as result)
} catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
+ // Ignore (null will be returned as result)
}
return stream;
}
Show replies by date