Permalink
Browse files

MYFACES-3697: Error while parsing Facelet-Lib hides the real reason w…

…hen logging

 - using the constructor to set the cause
 - using SAXParseException instead of SAXException

git-svn-id: https://svn.apache.org/repos/asf/myfaces/core/trunk@1448215 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 6ebed8b commit 9276e1db9f6e65b374b29a88d4a8686d662f9616 Udo Schnurpfeil committed Feb 20, 2013
Showing with 23 additions and 35 deletions.
  1. +23 −35 impl/src/main/java/org/apache/myfaces/view/facelets/compiler/TagLibraryConfig.java
@@ -18,31 +18,6 @@
*/
package org.apache.myfaces.view.facelets.compiler;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLConnection;
-import java.util.Collection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import java.util.regex.Pattern;
-
-import javax.faces.FacesException;
-import javax.faces.application.Resource;
-import javax.faces.application.ResourceHandler;
-import javax.faces.application.ViewHandler;
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.view.facelets.ComponentConfig;
-import javax.faces.view.facelets.FaceletHandler;
-import javax.faces.view.facelets.Tag;
-import javax.faces.view.facelets.TagConfig;
-import javax.faces.view.facelets.TagHandler;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
import org.apache.myfaces.config.ConfigFilesXmlValidationUtils;
import org.apache.myfaces.shared.config.MyfacesConfig;
import org.apache.myfaces.shared.util.ArrayUtils;
@@ -57,14 +32,29 @@
import org.apache.myfaces.view.facelets.tag.composite.CompositeResouceWrapper;
import org.apache.myfaces.view.facelets.util.ParameterCheck;
import org.apache.myfaces.view.facelets.util.ReflectionUtil;
-import org.xml.sax.Attributes;
-import org.xml.sax.InputSource;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
+import org.xml.sax.*;
import org.xml.sax.helpers.DefaultHandler;
+import javax.faces.FacesException;
+import javax.faces.application.Resource;
+import javax.faces.application.ResourceHandler;
+import javax.faces.application.ViewHandler;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.view.facelets.*;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Collection;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.regex.Pattern;
+
/**
* Handles creating a {@link org.apache.myfaces.view.facelets.tag.TagLibrary TagLibrary}
* from a {@link java.net.URL URL} source.
@@ -618,10 +608,8 @@ else if ("function-signature".equals(qName))
}
catch (Exception e)
{
- SAXException saxe = new SAXException("Error Handling [" + this.source + "@"
- + this.locator.getLineNumber() + "," + this.locator.getColumnNumber() + "] <" + qName + ">");
- saxe.initCause(e);
- throw saxe;
+ throw new SAXParseException("Error Handling [" + this.source + "@" + this.locator.getLineNumber()
+ + "," + this.locator.getColumnNumber() + "] <" + qName + ">", locator, e);
}
}

0 comments on commit 9276e1d

Please sign in to comment.