#fixed code
                                public void doExecute()
        throws MojoExecutionException, MojoFailureException
    {
        setup();
        boolean generated = false;

        // java -cp gwt-dev.jar:gwt-user.jar
        // com.google.gwt.resources.css.InterfaceGenerator -standalone -typeName some.package.MyCssResource -css
        // input.css
        if ( cssFiles != null )
        {
            for ( String file : cssFiles )
            {
                final String typeName = FilenameUtils.separatorsToSystem( file ).
                    substring( 0, file.lastIndexOf( '.' ) ).replace( File.separatorChar, '.' );
                final File javaOutput =
                    new File( getGenerateDirectory(), typeName.replace( '.', File.separatorChar ) + ".java" );
                final StringBuilder content = new StringBuilder();
                out = new StreamConsumer()
                {
                    public void consumeLine( String line )
                    {
                        content.append( line ).append( SystemUtils.LINE_SEPARATOR );
                    }
                };
                for ( Resource resource : (List<Resource>) getProject().getResources() )
                {
                    final File candidate = new File( resource.getDirectory(), file );
                    if ( candidate.exists() )
                    {
                        if ( buildContext.isUptodate( javaOutput, candidate ) )
                        {
                            getLog().debug( javaOutput.getAbsolutePath() + " is up to date. Generation skipped" );
                            // up to date, but still need to report generated-sources directory as sourceRoot
                            generated = true;
                            break;
                        }

                        getLog().info( "Generating " + javaOutput + " with typeName " + typeName );
                        ensureTargetPackageExists( getGenerateDirectory(), typeName );

                        
                        try
                        {
                            new JavaCommand( "com.google.gwt.resources.css.InterfaceGenerator" )
                            .withinScope( Artifact.SCOPE_COMPILE )
                            .arg( "-standalone" )
                            .arg( "-typeName" )
                            .arg( typeName )
                            .arg( "-css" )
                            .arg( candidate.getAbsolutePath() )
                            .withinClasspath( getGwtDevJar() )
                            .withinClasspath( getGwtUserJar() )
                            .execute();
                            final OutputStreamWriter outputWriter =
                                new OutputStreamWriter( buildContext.newFileOutputStream( javaOutput ) , encoding );
                            try {
                                outputWriter.write( content.toString() );
                            } finally {
                                IOUtil.close( outputWriter );
                            }
                        }
                        catch ( IOException e )
                        {
                            throw new MojoExecutionException( "Failed to write to file: " + javaOutput );
                        }
                        generated = true;
                        break;
                    }
                }
                
                if ( content.length() == 0 )
                {
                    throw new MojoExecutionException( "cannot generate java source from file " + file + "." );
                }
            }
        }

        if ( generated )
        {
            getLog().debug( "add compile source root " + getGenerateDirectory() );
            addCompileSourceRoot( getGenerateDirectory() );
        }

    }
#vulnerable code 
                                public void doExecute()
        throws MojoExecutionException, MojoFailureException
    {
        setup();
        boolean generated = false;

        // java -cp gwt-dev.jar:gwt-user.jar
        // com.google.gwt.resources.css.InterfaceGenerator -standalone -typeName some.package.MyCssResource -css
        // input.css
        if ( cssFiles != null )
        {
            for ( String file : cssFiles )
            {
                final String typeName = FilenameUtils.separatorsToSystem( file ).
                    substring( 0, file.lastIndexOf( '.' ) ).replace( File.separatorChar, '.' );
                final File javaOutput =
                    new File( getGenerateDirectory(), typeName.replace( '.', File.separatorChar ) + ".java" );
                final StringBuilder content = new StringBuilder();
                out = new StreamConsumer()
                {
                    public void consumeLine( String line )
                    {
                        content.append( line ).append( SystemUtils.LINE_SEPARATOR );
                    }
                };
                for ( Resource resource : (List<Resource>) getProject().getResources() )
                {
                    final File candidate = new File( resource.getDirectory(), file );
                    if ( candidate.exists() )
                    {
                        getLog().info( "Generating " + javaOutput + " with typeName " + typeName );
                        ensureTargetPackageExists( getGenerateDirectory(), typeName );

                        
                        try
                        {
                            new JavaCommand( "com.google.gwt.resources.css.InterfaceGenerator" )
                            .withinScope( Artifact.SCOPE_COMPILE )
                            .arg( "-standalone" )
                            .arg( "-typeName" )
                            .arg( typeName )
                            .arg( "-css" )
                            .arg( candidate.getAbsolutePath() )
                            .withinClasspath( getGwtDevJar() )
                            .withinClasspath( getGwtUserJar() )
                            .execute();                            
                            final FileWriter outputWriter = new FileWriter( javaOutput );
                            outputWriter.write( content.toString() );
                            outputWriter.close();
                        }
                        catch ( IOException e )
                        {
                            throw new MojoExecutionException( "Failed to write to file: " + javaOutput );
                        }
                        generated = true;
                        break;
                    }
                }
                
                if ( content.length() == 0 )
                {
                    throw new MojoExecutionException( "cannot generate java source from file " + file + "." );
                }
            }
        }

        if ( generated )
        {
            getLog().debug( "add compile source root " + getGenerateDirectory() );
            addCompileSourceRoot( getGenerateDirectory() );
        }

    } 
                            #location 51 
                            #vulnerability type RESOURCE_LEAK