void unweave(int id) throws PTAgentException {
  while (true) {
    ConfiguredAdvice[] oldWoven=woven.get();
    boolean found=false;
    for (int i=0; i < oldWoven.length; i++) {
      ConfiguredAdvice e=oldWoven[i];
      if (e.id == id) {
        ConfiguredAdvice[] newWoven=new ConfiguredAdvice[oldWoven.length - 1];
        System.arraycopy(oldWoven,0,newWoven,0,i);
        System.arraycopy(oldWoven,i + 1,newWoven,i,newWoven.length - i);
        if (woven.compareAndSet(oldWoven,newWoven)) {
          return;
        }
 else {
          found=true;
        }
      }
    }
    if (!found) {
      throw new PTAgentException("No advice with ID %d woven at tracepoint %s",id,this.id);
    }
  }
}

void unweave ( int id ) throws PTAgentException { while ( true ) { ConfiguredAdvice [ ] oldWoven = woven . get ( ) ; boolean found = false ; for ( int i = 0 ; i < oldWoven . length ; i ++ ) { ConfiguredAdvice e = oldWoven [ i ] ; if ( e . id == id ) { ConfiguredAdvice [ ] newWoven = new ConfiguredAdvice [ oldWoven . length - 1 ] ; System . arraycopy ( oldWoven , 0 , newWoven , 0 , i ) ; System . arraycopy ( oldWoven , i + 1 , newWoven , i , newWoven . length - i ) ; if ( woven . compareAndSet ( oldWoven , newWoven ) ) { return ; } else { found = true ; } } } if ( ! found ) { throw new PTAgentException ( "No advice with ID %d woven at tracepoint %s" , id , this . id ) ; } } }
unweave some previously woven advice here
