private boolean verifySortedCoordinatesPropertiesFile(File coordinatePropertiesFile){
  log("Checking for lexically sorted non-duplicated '/org/name' keys in: " + coordinatePropertiesFile,verboseLevel);
  boolean success=true;
  String line=null;
  String currentKey=null;
  String previousKey=null;
  try (InputStream stream=new FileInputStream(coordinatePropertiesFile);Reader reader=new InputStreamReader(stream,StandardCharsets.ISO_8859_1);BufferedReader bufferedReader=new BufferedReader(reader)){
    while (null != (line=readLogicalPropertiesLine(bufferedReader))) {
      final Matcher keyMatcher=COORDINATE_KEY_PATTERN.matcher(line);
      if (!keyMatcher.lookingAt()) {
        continue;
      }
      currentKey=keyMatcher.group(1);
      if (null != previousKey) {
        int comparison=currentKey.compareTo(previousKey);
        if (0 == comparison) {
          log("DUPLICATE coordinate key '" + currentKey + "' in "+ coordinatePropertiesFile.getName(),Project.MSG_ERR);
          success=false;
        }
 else         if (comparison < 0) {
          log("OUT-OF-ORDER coordinate key '" + currentKey + "' in "+ coordinatePropertiesFile.getName(),Project.MSG_ERR);
          success=false;
        }
      }
      previousKey=currentKey;
    }
  }
 catch (  IOException e) {
    throw new BuildException("Exception reading " + coordinatePropertiesFile.getPath() + ": "+ e.toString(),e);
  }
  return success;
}

private boolean verifySortedCoordinatesPropertiesFile ( File coordinatePropertiesFile ) { log ( "Checking for lexically sorted non-duplicated '/org/name' keys in: " + coordinatePropertiesFile , verboseLevel ) ; boolean success = true ; String line = null ; String currentKey = null ; String previousKey = null ; try ( InputStream stream = new FileInputStream ( coordinatePropertiesFile ) ; Reader reader = new InputStreamReader ( stream , StandardCharsets . ISO_8859_1 ) ; BufferedReader bufferedReader = new BufferedReader ( reader ) ) { while ( null != ( line = readLogicalPropertiesLine ( bufferedReader ) ) ) { final Matcher keyMatcher = COORDINATE_KEY_PATTERN . matcher ( line ) ; if ( ! keyMatcher . lookingAt ( ) ) { continue ; } currentKey = keyMatcher . group ( 1 ) ; if ( null != previousKey ) { int comparison = currentKey . compareTo ( previousKey ) ; if ( 0 == comparison ) { log ( "DUPLICATE coordinate key '" + currentKey + "' in " + coordinatePropertiesFile . getName ( ) , Project . MSG_ERR ) ; success = false ; } else if ( comparison < 0 ) { log ( "OUT-OF-ORDER coordinate key '" + currentKey + "' in " + coordinatePropertiesFile . getName ( ) , Project . MSG_ERR ) ; success = false ; } } previousKey = currentKey ; } } catch ( IOException e ) { throw new BuildException ( "Exception reading " + coordinatePropertiesFile . getPath ( ) + ": " + e . toString ( ) , e ) ; } return success ; }
returns true if the " / org / name " coordinate keys in the given properties file are lexically sorted and are not duplicates .
