private List<VcsException> parseException(final String stderr){
  final List<VcsException> exceptions=new ArrayList<VcsException>();
  final String[] exceptionLines=getLines(stderr);
  for (int i=exceptionLines.length / 2; i < exceptionLines.length; i++) {
    if (StringUtils.isNotEmpty(exceptionLines[i]) && !StringUtils.contains(exceptionLines[i],CONFLICT_MESSAGE)) {
      final VcsException exception=new VcsException((exceptionLines[i]));
      exception.setIsWarning(StringUtils.startsWith(exceptionLines[i],WARNING_PREFIX));
      exceptions.add(exception);
    }
  }
  return exceptions;
}

private List < VcsException > parseException ( final String stderr ) { final List < VcsException > exceptions = new ArrayList < VcsException > ( ) ; final String [ ] exceptionLines = getLines ( stderr ) ; for ( int i = exceptionLines . length / 2 ; i < exceptionLines . length ; i ++ ) { if ( StringUtils . isNotEmpty ( exceptionLines [ i ] ) && ! StringUtils . contains ( exceptionLines [ i ] , CONFLICT_MESSAGE ) ) { final VcsException exception = new VcsException ( ( exceptionLines [ i ] ) ) ; exception . setIsWarning ( StringUtils . startsWith ( exceptionLines [ i ] , WARNING_PREFIX ) ) ; exceptions . add ( exception ) ; } } return exceptions ; }
an error will be in the following form where there are duplicates for each error . the duplicates only differ by the fact that the first reference of the error refers to only the file name and the second reference refers to the entire path of the file . all the file name errors are the first listed followed by all the path errors . only make exceptions out of the path errors and ignore the file name errors so we see no duplicates . example of an error message will look like this : < p / > warning - unable to refresh testhererename . txt because you have a pending edit . conflict testadd . txt - unable to perform the get operation because you have a conflicting edit warning - unable to refresh / users / user / tfvc - tfs / tfstest_01 / addfold / testhererename . txt because you have a pending edit . conflict / users / user / tfvc - tfs / tfstest_01 / testadd . txt - unable to perform the get operation because you have a conflicting edit
