private boolean addPath(List<OPath> list,OPath path){
  if (list.contains(path)) {
    return true;
  }
  String pName=path.getName();
  for (int i=0; i < list.size(); i++) {
    OPath p=list.get(i);
    if (pName.equals(p.getName())) {
      log.error("Path \"" + path.getName() + "\" is duplicate name for another path in Portal \""+ getUserName()+ "\".");
      return false;
    }
    if (p.equals(path)) {
      log.warn("Path \"" + path.getName() + "\" is duplicate of path \""+ p.getName()+ "\" in Portal \""+ getUserName()+ "\".");
      return false;
    }
  }
  list.add(path);
  return true;
}

private boolean addPath ( List < OPath > list , OPath path ) { if ( list . contains ( path ) ) { return true ; } String pName = path . getName ( ) ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { OPath p = list . get ( i ) ; if ( pName . equals ( p . getName ( ) ) ) { log . error ( "Path \"" + path . getName ( ) + "\" is duplicate name for another path in Portal \"" + getUserName ( ) + "\"." ) ; return false ; } if ( p . equals ( path ) ) { log . warn ( "Path \"" + path . getName ( ) + "\" is duplicate of path \"" + p . getName ( ) + "\" in Portal \"" + getUserName ( ) + "\"." ) ; return false ; } } list . add ( path ) ; return true ; }
utility for both path lists check for duplicate name
