@Test public void testFindFirstViolationError() { final FlexPmdViolations violations = new FlexPmdViolations(); final List< IFlexViolation > abstractRowDataViolations = new ArrayList< IFlexViolation >(); assertEquals( "", PmdEngineUtils.findFirstViolationError( violations ) ); final IFlexFile abstractRowDataFlexFile = getTestFiles().get( "AbstractRowData.as" ); abstractRowDataViolations.add( new Violation( new ViolationPosition( 0 ), new ErrorRule(), abstractRowDataFlexFile ) ); abstractRowDataViolations.add( new Violation( new ViolationPosition( 0 ), new WarningRule(), abstractRowDataFlexFile ) ); violations.getViolations().put( abstractRowDataFlexFile, abstractRowDataViolations ); assertEquals( "An error violation has been found on the file AbstractRowData.as at line 0, with the rule" + " \"com.adobe.ac.pmd.engines.PmdEngineUtilsTest$ErrorRule\": \n", PmdEngineUtils.findFirstViolationError( violations ) ); }
public static String findFirstViolationError( final FlexPmdViolations violations ) { final StringBuffer buffer = new StringBuffer(); final String message = "An error violation has been found on the file {0} at " + "line {1}, with the rule \"{2}\": {3}"; final MessageFormat form = new MessageFormat( message ); for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations() .entrySet() ) { for ( final IFlexViolation violation : violatedFile.getValue() ) { if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) ) { final String[] formatArgument = computeArgumentFormat( violation ); buffer.append( form.format( formatArgument ) ); buffer.append( '\n' ); } } } return buffer.toString(); }
PmdEngineUtils { public static String findFirstViolationError( final FlexPmdViolations violations ) { final StringBuffer buffer = new StringBuffer(); final String message = "An error violation has been found on the file {0} at " + "line {1}, with the rule \"{2}\": {3}"; final MessageFormat form = new MessageFormat( message ); for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations() .entrySet() ) { for ( final IFlexViolation violation : violatedFile.getValue() ) { if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) ) { final String[] formatArgument = computeArgumentFormat( violation ); buffer.append( form.format( formatArgument ) ); buffer.append( '\n' ); } } } return buffer.toString(); } }
PmdEngineUtils { public static String findFirstViolationError( final FlexPmdViolations violations ) { final StringBuffer buffer = new StringBuffer(); final String message = "An error violation has been found on the file {0} at " + "line {1}, with the rule \"{2}\": {3}"; final MessageFormat form = new MessageFormat( message ); for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations() .entrySet() ) { for ( final IFlexViolation violation : violatedFile.getValue() ) { if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) ) { final String[] formatArgument = computeArgumentFormat( violation ); buffer.append( form.format( formatArgument ) ); buffer.append( '\n' ); } } } return buffer.toString(); } private  PmdEngineUtils(); }
PmdEngineUtils { public static String findFirstViolationError( final FlexPmdViolations violations ) { final StringBuffer buffer = new StringBuffer(); final String message = "An error violation has been found on the file {0} at " + "line {1}, with the rule \"{2}\": {3}"; final MessageFormat form = new MessageFormat( message ); for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations() .entrySet() ) { for ( final IFlexViolation violation : violatedFile.getValue() ) { if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) ) { final String[] formatArgument = computeArgumentFormat( violation ); buffer.append( form.format( formatArgument ) ); buffer.append( '\n' ); } } } return buffer.toString(); } private  PmdEngineUtils(); static String findFirstViolationError( final FlexPmdViolations violations ); }
PmdEngineUtils { public static String findFirstViolationError( final FlexPmdViolations violations ) { final StringBuffer buffer = new StringBuffer(); final String message = "An error violation has been found on the file {0} at " + "line {1}, with the rule \"{2}\": {3}"; final MessageFormat form = new MessageFormat( message ); for ( final Entry< IFlexFile, List< IFlexViolation >> violatedFile : violations.getViolations() .entrySet() ) { for ( final IFlexViolation violation : violatedFile.getValue() ) { if ( violation.getRule().getPriority() == Integer.parseInt( ViolationPriority.HIGH.toString() ) ) { final String[] formatArgument = computeArgumentFormat( violation ); buffer.append( form.format( formatArgument ) ); buffer.append( '\n' ); } } } return buffer.toString(); } private  PmdEngineUtils(); static String findFirstViolationError( final FlexPmdViolations violations );  }