Package org.codehaus.plexus.compiler

Examples of org.codehaus.plexus.compiler.CompilerError


          "Error while executing the external compiler.", e);
    }

    if (returnCode != 0 && messages.isEmpty()) {
      // TODO: exception?
      messages.add(new CompilerError(
          "Failure executing the compiler, but could not parse the error:"
              + EOL + stringWriter.toString(), true));
    }

    return messages;
View Full Code Here


        boolean compilationError = false;

        for ( Iterator i = messages.iterator(); i.hasNext(); )
        {
            CompilerError message = (CompilerError) i.next();

            if ( message.isError() )
            {
                compilationError = true;
            }
        }

        if ( compilationError )
        {
            throw new CompilationFailureException( messages );
        }
        else
        {
            for ( Iterator i = messages.iterator(); i.hasNext(); )
            {
                CompilerError message = (CompilerError) i.next();

                getLog().warn( message.toString() );
            }
        }
    }
View Full Code Here

        boolean compilationError = false;

        for ( Iterator i = messages.iterator(); i.hasNext(); )
        {
            CompilerError message = (CompilerError) i.next();

            if ( message.isError() )
            {
                compilationError = true;
                break;
            }
        }

        if ( compilationError && failOnError )
        {
            throw new CompilationFailureException( messages );
        }
        else
        {
            for ( Iterator i = messages.iterator(); i.hasNext(); )
            {
                CompilerError message = (CompilerError) i.next();

                getLog().warn( message.toString() );
            }
        }
    }
View Full Code Here

    {
        StringBuffer sb = new StringBuffer();

        for ( Iterator it = messages.iterator(); it.hasNext(); )
        {
            CompilerError compilerError = (CompilerError) it.next();

            sb.append( compilerError ).append( LS );
        }
        return sb.toString();
    }
View Full Code Here

        if ( messages.size() == 1 )
        {
            sb.append( LS );

            CompilerError compilerError = (CompilerError) messages.get( 0 );

            sb.append( compilerError ).append( LS );
        }
        return sb.toString();
    }
View Full Code Here

                throw new CompilerException(
                    "Unknown error trying to execute the external compiler: " + EOL + cli.toString() );
            }
            else
            {
                messages.add( new CompilerError(
                    "Failure executing javac,  but could not parse the error:" + EOL + err.getOutput(), true ) );
            }
        }

        return messages;
View Full Code Here

        }

        if ( ( ok.intValue() != 0 ) && messages.isEmpty() )
        {
            // TODO: exception?
            messages.add( new CompilerError( "Failure executing javac, but could not parse the error:" + EOL +
                                                 out.toString(), true ) );
        }

        return messages;
    }
View Full Code Here

                }

                // TODO: there should be a better way to parse these
                if ( ( buffer.length() == 0 ) && line.startsWith( "error: " ) )
                {
                    errors.add( new CompilerError( line, true ) );
                }
                else if ( ( buffer.length() == 0 ) && isNote( line ) )
                {
                    // skip, JDK 1.5 telling us deprecated APIs are used but -Xlint:deprecation isn't set
                }
View Full Code Here

            if ( endcolumn == -1 )
            {
                endcolumn = context.length();
            }

            return new CompilerError( file, isError, line, startcolumn, line, endcolumn, message.trim() );
        }
        catch ( NoSuchElementException e )
        {
            return new CompilerError( "no more tokens - could not parse error message: " + error, isError );
        }
        catch ( NumberFormatException e )
        {
            return new CompilerError( "could not parse error message: " + error, isError );
        }
        catch ( Exception e )
        {
            return new CompilerError( "could not parse error message: " + error, isError );
        }
    }
View Full Code Here

        if ( messages.size() == 1 )
        {
            sb.append( LS );

            CompilerError compilerError = (CompilerError) messages.get( 0 );

            sb.append( compilerError ).append( LS );
        }
       
        return sb.toString();
View Full Code Here

TOP

Related Classes of org.codehaus.plexus.compiler.CompilerError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.