computeReport( pmd ) );
}
private Report computeReport( final FlexPmdViolations pmd )
{
final Report report = new Report();
final RuleContext ruleContext = new RuleContext();
final PmdReportListener reportSink = new PmdReportListener( sink, bundle, aggregate );
report.addListener( reportSink );
ruleContext.setReport( report );
reportSink.beginDocument();
report.start();
for ( final IFlexFile file : pmd.getViolations().keySet() )
{
final File javaFile = new File( file.getFilePath() ); // NOPMD
final List< IFlexViolation > violations = pmd.getViolations().get( file );
reportSink.beginFile( javaFile,
new PmdFileInfo( project, javaFile.getParentFile(), "" ) ); // NOPMD
ruleContext.setSourceCodeFilename( file.getPackageName()
+ "." + file.getClassName() );
for ( final IFlexViolation violation : violations )
{
report.addRuleViolation( violation );
reportSink.ruleViolationAdded( violation );
}
reportSink.endFile( javaFile );
}
reportSink.endDocument();
report.end();
return report;
}