Program: 20461
Project: 20461
Buggy source:
/** 
 * This is a full test in the Jingle API.
 */
public void testMediaManager(){
  resetCounter();
  try {
    XMPPConnection x0=getConnection(0);
    XMPPConnection x1=getConnection(1);
    final JingleManager jm0=new JingleManager(x0,new FixedResolver("String_Node_Str",20004));
    final JingleManager jm1=new JingleManager(x1,new FixedResolver("String_Node_Str",20040));
    JingleMediaManager jingleMediaManager=new JingleMediaManager(){
      public JingleMediaSession createMediaSession(      final PayloadType payloadType,      final TransportCandidate remote,      final TransportCandidate local){
        return new JingleMediaSession(payloadType,remote,local){
          public void initialize(){
          }
          public void startTrasmit(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void startReceive(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void setTrasmit(          boolean active){
          }
          public void stopTrasmit(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void stopReceive(){
            incCounter();
            System.out.println("String_Node_Str");
          }
        }
;
      }
      public List<PayloadType> getPayloads(){
        return new ArrayList();
      }
      public PayloadType getPreferredPayloadType(){
        return null;
      }
    }
;
    jm0.setMediaManager(jingleMediaManager);
    jm1.setMediaManager(jingleMediaManager);
    jm1.addJingleSessionRequestListener(new JingleSessionRequestListener(){
      public void sessionRequested(      final JingleSessionRequest request){
        try {
          IncomingJingleSession session=request.accept(jm1.getMediaManager().getPayloads());
          session.start(request);
        }
 catch (        XMPPException e) {
          e.printStackTrace();
        }
      }
    }
);
    OutgoingJingleSession js0=jm0.createOutgoingJingleSession(x1.getUser());
    js0.start();
    Thread.sleep(10000);
    js0.terminate();
    Thread.sleep(3000);
    System.out.println(valCounter());
    assertTrue(valCounter() == 8);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * This is a full test in the Jingle API.
 */
public void testMediaManager(){
  resetCounter();
  try {
    XMPPConnection x0=getConnection(0);
    XMPPConnection x1=getConnection(1);
    final JingleManager jm0=new JingleManager(x0,new FixedResolver("String_Node_Str",20004));
    final JingleManager jm1=new JingleManager(x1,new FixedResolver("String_Node_Str",20040));
    JingleMediaManager jingleMediaManager=new JingleMediaManager(){
      public JingleMediaSession createMediaSession(      final PayloadType payloadType,      final TransportCandidate remote,      final TransportCandidate local){
        return new JingleMediaSession(payloadType,remote,local){
          public void initialize(){
          }
          public void startTrasmit(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void startReceive(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void setTrasmit(          boolean active){
          }
          public void stopTrasmit(){
            incCounter();
            System.out.println("String_Node_Str");
          }
          public void stopReceive(){
            incCounter();
            System.out.println("String_Node_Str");
          }
        }
;
      }
      public List<PayloadType> getPayloads(){
        return new ArrayList();
      }
      public PayloadType.Audio getPreferredAudioPayloadType(){
        return null;
      }
    }
;
    jm0.setMediaManager(jingleMediaManager);
    jm1.setMediaManager(jingleMediaManager);
    jm1.addJingleSessionRequestListener(new JingleSessionRequestListener(){
      public void sessionRequested(      final JingleSessionRequest request){
        try {
          IncomingJingleSession session=request.accept(jm1.getMediaManager().getPayloads());
          session.start(request);
        }
 catch (        XMPPException e) {
          e.printStackTrace();
        }
      }
    }
);
    OutgoingJingleSession js0=jm0.createOutgoingJingleSession(x1.getUser());
    js0.start();
    Thread.sleep(10000);
    js0.terminate();
    Thread.sleep(3000);
    System.out.println(valCounter());
    assertTrue(valCounter() == 8);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}