Program: 95177
Project: 95177
Buggy source:
public Object getAdapter(Class clazz){
  if (clazz.equals(IPresenceContainer.class)) {
    return new IPresenceContainer(){
      public void addPresenceListener(      IPresenceListener listener){
        sharedObject.addPresenceListener(listener);
      }
      public void addMessageListener(      IMessageListener listener){
        sharedObject.addMessageListener(listener);
      }
      public IMessageSender getMessageSender(){
        return new IMessageSender(){
          public void sendMessage(          ID fromID,          ID toID,          Type type,          String subject,          String message){
            try {
              XMPPClientSOContainer.this.sendMessage(toID,message);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str" + toID + "String_Node_Str"+ message,e);
            }
          }
        }
;
      }
      public IPresenceSender getPresenceSender(){
        return new IPresenceSender(){
          public void sendPresenceUpdate(          ID fromID,          ID toID,          IPresence presence){
            try {
              Presence newPresence=makePresenceFromIPresence(presence);
              XMPPClientSOContainer.this.sendPresenceUpdate(toID,newPresence);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str" + toID + "String_Node_Str"+ presence,e);
            }
          }
          public void sendRosterAdd(          ID fromID,          String user,          String name,          String[] groups){
            try {
              XMPPClientSOContainer.this.sendRosterAdd(user,name,groups);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str",e);
            }
          }
          public void sendRosterRemove(          ID fromID,          ID userID){
            try {
              if (userID == null)               return;
              XMPPClientSOContainer.this.sendRosterRemove(userID.getName());
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str",e);
            }
          }
        }
;
      }
      public IAccountManager getAccountManager(){
        return new IAccountManager(){
          public void changePassword(          String newpassword) throws ECFException {
            sharedObject.changePassword(newpassword);
          }
          public void createAccount(          String username,          String password,          Map attributes) throws ECFException {
            sharedObject.createAccount(username,password,attributes);
          }
          public void deleteAccount() throws ECFException {
            sharedObject.deleteAccount();
          }
          public String getAccountInstructions(){
            return sharedObject.getAccountInstructions();
          }
          public String[] getAccountAttributeNames(){
            return sharedObject.getAccountAttributeNames();
          }
          public Object getAccountAttribute(          String name){
            return sharedObject.getAccountAttribute(name);
          }
          public boolean supportsCreation(){
            return sharedObject.supportsCreation();
          }
        }
;
      }
      public void addSubscribeListener(      ISubscribeListener listener){
        sharedObject.addSubscribeListener(listener);
      }
      public IChatRoomManager getChatRoomManager(){
        return new IChatRoomManager(){
          public ID[] getChatRooms(){
            return XMPPClientSOContainer.this.getChatRooms();
          }
          public IRoomInfo getChatRoomInfo(          ID roomID){
            return XMPPClientSOContainer.this.getChatRoomInfo(roomID);
          }
          public IChatRoomContainer makeChatRoomContainer() throws ContainerInstantiationException {
            IChatRoomContainer chatContainer=null;
            try {
              chatContainer=new XMPPGroupChatSOContainer(sharedObject.getConnection(),getConnectNamespace());
            }
 catch (            IDInstantiationException e) {
              ContainerInstantiationException newExcept=new ContainerInstantiationException("String_Node_Str" + getID(),e);
              newExcept.setStackTrace(e.getStackTrace());
              throw newExcept;
            }
            return chatContainer;
          }
          public IRoomInfo[] getChatRoomsInfo(){
            ID[] chatRooms=getChatRooms();
            if (chatRooms == null)             return null;
            IRoomInfo[] res=new IRoomInfo[chatRooms.length];
            int count=0;
            for (int i=0; i < chatRooms.length; i++) {
              IRoomInfo infoResult=getChatRoomInfo(chatRooms[i]);
              if (infoResult != null) {
                res[count++]=infoResult;
              }
            }
            IRoomInfo[] results=new IRoomInfo[count];
            for (int i=0; i < count; i++) {
              results[i]=res[i];
            }
            return results;
          }
        }
;
      }
    }
;
  }
 else {
    return super.getAdapter(clazz);
  }
}

Fixed version (ground truth):
public Object getAdapter(Class clazz){
  if (clazz.equals(IPresenceContainer.class)) {
    return new IPresenceContainer(){
      public void addPresenceListener(      IPresenceListener listener){
        sharedObject.addPresenceListener(listener);
      }
      public void addMessageListener(      IMessageListener listener){
        sharedObject.addMessageListener(listener);
      }
      public IMessageSender getMessageSender(){
        return new IMessageSender(){
          public void sendMessage(          ID fromID,          ID toID,          Type type,          String subject,          String message){
            try {
              XMPPClientSOContainer.this.sendMessage(toID,message);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str" + toID + "String_Node_Str"+ message,e);
            }
          }
        }
;
      }
      public IPresenceSender getPresenceSender(){
        return new IPresenceSender(){
          public void sendPresenceUpdate(          ID fromID,          ID toID,          IPresence presence){
            try {
              Presence newPresence=makePresenceFromIPresence(presence);
              XMPPClientSOContainer.this.sendPresenceUpdate(toID,newPresence);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str" + toID + "String_Node_Str"+ presence,e);
            }
          }
          public void sendRosterAdd(          ID fromID,          String user,          String name,          String[] groups){
            try {
              XMPPClientSOContainer.this.sendRosterAdd(user,name,groups);
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str",e);
            }
          }
          public void sendRosterRemove(          ID fromID,          ID userID){
            try {
              if (userID == null)               return;
              XMPPClientSOContainer.this.sendRosterRemove(userID.getName());
            }
 catch (            IOException e) {
              dumpStack("String_Node_Str",e);
            }
          }
        }
;
      }
      public IAccountManager getAccountManager(){
        return new IAccountManager(){
          public void changePassword(          String newpassword) throws ECFException {
            sharedObject.changePassword(newpassword);
          }
          public void createAccount(          String username,          String password,          Map attributes) throws ECFException {
            sharedObject.createAccount(username,password,attributes);
          }
          public void deleteAccount() throws ECFException {
            sharedObject.deleteAccount();
          }
          public String getAccountInstructions(){
            return sharedObject.getAccountInstructions();
          }
          public String[] getAccountAttributeNames(){
            return sharedObject.getAccountAttributeNames();
          }
          public Object getAccountAttribute(          String name){
            return sharedObject.getAccountAttribute(name);
          }
          public boolean supportsCreation(){
            return sharedObject.supportsCreation();
          }
        }
;
      }
      public void addSubscribeListener(      ISubscribeListener listener){
        sharedObject.addSubscribeListener(listener);
      }
      public IChatRoomManager getChatRoomManager(){
        return new IChatRoomManager(){
          public ID[] getChatRooms(){
            return XMPPClientSOContainer.this.getChatRooms();
          }
          public IRoomInfo getChatRoomInfo(          ID roomID){
            return XMPPClientSOContainer.this.getChatRoomInfo(roomID);
          }
          public IChatRoomContainer makeChatRoomContainer() throws ContainerInstantiationException {
            IChatRoomContainer chatContainer=null;
            try {
              chatContainer=new XMPPGroupChatSOContainer(sharedObject.getConnection(),getConnectNamespace());
            }
 catch (            IDInstantiationException e) {
              ContainerInstantiationException newExcept=new ContainerInstantiationException("String_Node_Str" + getID(),e);
              newExcept.setStackTrace(e.getStackTrace());
              throw newExcept;
            }
            chats.add(chatContainer);
            return chatContainer;
          }
          public IRoomInfo[] getChatRoomsInfo(){
            ID[] chatRooms=getChatRooms();
            if (chatRooms == null)             return null;
            IRoomInfo[] res=new IRoomInfo[chatRooms.length];
            int count=0;
            for (int i=0; i < chatRooms.length; i++) {
              IRoomInfo infoResult=getChatRoomInfo(chatRooms[i]);
              if (infoResult != null) {
                res[count++]=infoResult;
              }
            }
            IRoomInfo[] results=new IRoomInfo[count];
            for (int i=0; i < count; i++) {
              results[i]=res[i];
            }
            return results;
          }
        }
;
      }
    }
;
  }
 else {
    return super.getAdapter(clazz);
  }
}