tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu...@apache.org
Subject cvs commit: jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler DefaultErrorHandler.java ErrorDispatcher.java ErrorHandler.java TldLocationsCache.java
Date Mon, 07 Oct 2002 19:37:21 GMT
luehe       2002/10/07 12:37:21

  Modified:    jasper2/src/share/org/apache/jasper/compiler
                        DefaultErrorHandler.java ErrorDispatcher.java
                        ErrorHandler.java TldLocationsCache.java
  Log:
  Improved error reporting
  
  Revision  Changes    Path
  1.3       +17 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java
  
  Index: DefaultErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/DefaultErrorHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultErrorHandler.java	24 Jul 2002 19:58:57 -0000	1.2
  +++ DefaultErrorHandler.java	7 Oct 2002 19:37:21 -0000	1.3
  @@ -101,6 +101,20 @@
       }
   
       /*
  +     * Processes the given JSP parse error.
  +     *
  +     * @param errMsg Parse error message
  +     * @param exception Parse exception
  +     */
  +    public void jspError(String errMsg, Exception ex) throws JasperException {
  +	if (errMsg != null) {
  +	    throw new JasperException(errMsg);
  +	} else {
  +	    throw new JasperException(ex.getMessage());
  +	}
  +    }
  +
  +    /*
        * Processes the given javac compilation errors.
        *
        * @param details Array of JavacErrorDetail instances corresponding to the
  
  
  
  1.5       +11 -4     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java
  
  Index: ErrorDispatcher.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorDispatcher.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ErrorDispatcher.java	21 Aug 2002 16:21:56 -0000	1.4
  +++ ErrorDispatcher.java	7 Oct 2002 19:37:21 -0000	1.5
  @@ -412,6 +412,7 @@
   	String errMsg = null;
   	int line = -1;
   	int column = -1;
  +	boolean hasLocation = false;
   
   	// Localize
   	
  @@ -424,10 +425,12 @@
   	    file = where.getFile();
   	    line = where.getLineNumber();
   	    column = where.getColumnNumber();
  +	    hasLocation = true;
   	} else if (e instanceof SAXParseException) {
   	    file = ((SAXParseException) e).getSystemId();
   	    line = ((SAXParseException) e).getLineNumber();
   	    column = ((SAXParseException) e).getColumnNumber();
  +	    hasLocation = true;
   	}
   
   	// Get nested exception
  @@ -437,7 +440,11 @@
   	    nestedEx = ((SAXException) e).getException();
   	}
   
  -	errHandler.jspError(file, line, column, errMsg, nestedEx);
  +	if (hasLocation) {
  +	    errHandler.jspError(file, line, column, errMsg, nestedEx);
  +	} else {
  +	    errHandler.jspError(errMsg, nestedEx);
  +	}
       }
   
       /*
  
  
  
  1.2       +12 -3     jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorHandler.java
  
  Index: ErrorHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/ErrorHandler.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ErrorHandler.java	28 Mar 2002 18:46:18 -0000	1.1
  +++ ErrorHandler.java	7 Oct 2002 19:37:21 -0000	1.2
  @@ -88,6 +88,15 @@
   			 Exception exception) throws JasperException;
   
       /**
  +     * Processes the given JSP parse error.
  +     *
  +     * @param errMsg Parse error message
  +     * @param exception Parse exception
  +     */
  +    public void jspError(String msg, Exception exception)
  +	throws JasperException;
  +
  +    /**
        * Processes the given javac compilation errors.
        *
        * @param details Array of JavacErrorDetail instances corresponding to the
  
  
  
  1.6       +8 -9      jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java
  
  Index: TldLocationsCache.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-jasper/jasper2/src/share/org/apache/jasper/compiler/TldLocationsCache.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TldLocationsCache.java	20 Aug 2002 03:52:18 -0000	1.5
  +++ TldLocationsCache.java	7 Oct 2002 19:37:21 -0000	1.6
  @@ -253,16 +253,10 @@
                   String name = entry.getName();
                   if (!name.startsWith("META-INF/")) continue;
                   if (!name.endsWith(".tld")) continue;
  -                //p("tldConfigJar(" + resourcePath +
  -                //  "): Processing entry '" + name + "'");
                   stream = jarFile.getInputStream(entry);
                   String uri = parseTldForUri(resourcePath, stream);
  -                //p("uri in TLD is: " + uri);
                   if (uri != null) {
  -                    mappings.put(uri, 
  -                                 new String[]{resourcePath, name});
  -                    //p("added mapping: " + uri +
  -                    //  " -> " + resourcePath + " " + name);
  +                    mappings.put(uri, new String[]{ resourcePath, name });
                   }
               }
               // FIXME @@@
  @@ -274,13 +268,18 @@
               if (stream != null) {
                   try {
                       stream.close();
  -                } catch (Throwable t) {}
  +                } catch (Throwable t) {
  +		    // ignore
  +		}
               }
               if (jarFile != null) {
                   try {
                       jarFile.close();
  -                } catch (Throwable t) {}
  +                } catch (Throwable t) {
  +		    // ignore
  +		}
               }
  +	    throw new JasperException(ex);
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message