private static void addInPathOrder(final List<Cookie> list,final Cookie addCookie){
  int i=0;
  for (i=0; i < list.size(); i++) {
    final Cookie c=list.get(i);
    if (addCookie.compare(addCookie,c) > 0) {
      break;
    }
  }
  list.add(i,addCookie);
}

private static void addInPathOrder ( final List < Cookie > list , final Cookie addCookie ) { int i = 0 ; for ( i = 0 ; i < list . size ( ) ; i ++ ) { final Cookie c = list . get ( i ) ; if ( addCookie . compare ( addCookie , c ) > 0 ) { break ; } } list . add ( i , addCookie ) ; }
adds the given cookie into the given list in descending path order . that is , more specific path to least specific paths . this may not be the fastest algorythm , but it ' ll work ok for the small number of cookies we ' re generally dealing with .
