bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/ErrorDispatcher.java
public static JavacErrorDetail[] parseJavacMessage(
                                Node.Nodes pageNodes,
                                String errMsg,
                                String fname)
                throws IOException, JasperException {

	ArrayList<JavacErrorDetail> errors = new ArrayList<JavacErrorDetail>();
	StringBuilder errMsgBuf = null;
	int lineNum = -1;
        JavacErrorDetail javacError = null;

        BufferedReader reader = new BufferedReader(new StringReader(errMsg));

        /*
         * Parse compilation errors. Each compilation error consists of a file
         * path and error line number, followed by a number of lines describing
         * the error.
         */
        String line = null;
        while ((line = reader.readLine()) != null) {

            /*
	     * Error line number is delimited by set of colons.
	     * Ignore colon following drive letter on Windows (fromIndex = 2).
	     * XXX Handle deprecation warnings that don't have line info
	     */
            int beginColon = line.indexOf(':', 2); 
            int endColon = line.indexOf(':', beginColon + 1);
            if ((beginColon >= 0) && (endColon >= 0)) {
                if (javacError != null) {
                    // add previous error to error vector
                    errors.add(javacError);
		}

		String lineNumStr = line.substring(beginColon + 1, endColon);
                try {
                    lineNum = Integer.parseInt(lineNumStr);
                } catch (NumberFormatException e) {
                    // XXX
                }

                errMsgBuf = new StringBuilder();

                javacError = createJavacError(fname, pageNodes, 
                                              errMsgBuf, lineNum);
            }

            // Ignore messages preceding first error
            if (errMsgBuf != null) {
                errMsgBuf.append(line);
                errMsgBuf.append("\n");
            }
        }

        // Add last error to error vector
        if (javacError != null) {
            errors.add(javacError);
        } 
        reader.close();
        return errors.toArray(new JavacErrorDetail[0]);
    }
public static JavacErrorDetail[] parseJavacMessage(
                                Node.Nodes pageNodes,
                                String errMsg,
                                String fname)
                throws IOException, JasperException {

	ArrayList<JavacErrorDetail> errors = new ArrayList<JavacErrorDetail>();
	StringBuilder errMsgBuf = null;
	int lineNum = -1;
        JavacErrorDetail javacError = null;

        BufferedReader reader = new BufferedReader(new StringReader(errMsg));

        /*
         * Parse compilation errors. Each compilation error consists of a file
         * path and error line number, followed by a number of lines describing
         * the error.
         */
        String line = null;
        while ((line = reader.readLine()) != null) {

            /*
	     * Error line number is delimited by set of colons.
	     * Ignore colon following drive letter on Windows (fromIndex = 2).
	     * XXX Handle deprecation warnings that don't have line info
	     */
            int beginColon = line.indexOf(':', 2); 
            int endColon = line.indexOf(':', beginColon + 1);
            if ((beginColon >= 0) && (endColon >= 0)) {
                if (javacError != null) {
                    // add previous error to error vector
                    errors.add(javacError);
		}

		String lineNumStr = line.substring(beginColon + 1, endColon);
                try {
                    lineNum = Integer.parseInt(lineNumStr);
                } catch (NumberFormatException e) {
                    // XXX
                }

                errMsgBuf = new StringBuilder();

                javacError = createJavacError(fname, pageNodes, 
                                              errMsgBuf, lineNum);
            }

            // Ignore messages preceding first error
            if (errMsgBuf != null) {
                errMsgBuf.append(line);
                errMsgBuf.append("\n");
            }
        }

        // Add last error to error vector
        if (javacError != null) {
            errors.add(javacError);
        } 
        reader.close();
        return errors.toArray(new JavacErrorDetail[0]);
    }
public static JavacErrorDetail [ ] parseJavacMessage ( Node . Nodes pageNodes , String errMsg , String fname ) throws IOException , JasperException { ArrayList < JavacErrorDetail > errors = new ArrayList < JavacErrorDetail > ( ) ; StringBuilder errMsgBuf = null ; int lineNum = - 1 ; JavacErrorDetail javacError = null ; BufferedReader reader = new BufferedReader ( new StringReader ( errMsg ) ) ; /*
         * Parse compilation errors. Each compilation error consists of a file
         * path and error line number, followed by a number of lines describing
         * the error.
         */ String line = null ; while ( ( line = reader . readLine ( ) ) != null ) { /*
	     * Error line number is delimited by set of colons.
	     * Ignore colon following drive letter on Windows (fromIndex = 2).
	     * XXX Handle deprecation warnings that don't have line info
	     */ int beginColon = line . indexOf ( ' ' , 2 ) ; int endColon = line . indexOf ( ' ' , beginColon + 1 ) ; if ( ( beginColon >= 0 ) && ( endColon >= 0 ) ) { if ( javacError != null ) { // add previous error to error vector errors . add ( javacError ) ; } String lineNumStr = line . substring ( beginColon + 1 , endColon ) ; try { lineNum = Integer . parseInt ( lineNumStr ) ; } catch ( NumberFormatException e ) { // XXX } errMsgBuf = new StringBuilder ( ) ; javacError = createJavacError ( fname , pageNodes , errMsgBuf , lineNum ) ; } // Ignore messages preceding first error if ( errMsgBuf != null ) { errMsgBuf . append ( line ) ; errMsgBuf . append ( "\n" ) ; } } // Add last error to error vector if ( javacError != null ) { errors . add ( javacError ) ; } reader . close ( ) ; return errors . toArray ( new JavacErrorDetail [ 0 ] ) ; }
/*
Parses the given Java compilation error message, which may contain one
or more compilation errors, into an array of JavacErrorDetail instances.

Each JavacErrorDetail instance contains the information about a single
compilation error.

@param errMsg Compilation error message that was generated by the
javac compiler
@param fname Name of Java source file whose compilation failed

@return Array of JavacErrorDetail instances corresponding to the
compilation errors, or null if the given error message does not
contain any compilation error line numbers
/ * Parses the given Java compilation error message which may contain one or more compilation errors into an array of JavacErrorDetail instances .