Program: 104329
Project: 104329
Buggy source:
/** 
 * Initializes protocol provider references and whatever else there is to initialize.
 * @throws java.lang.Exception in case we meet problems while retrivingprotocol providers through OSGI
 */
public void setUp() throws Exception {
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str";
  try {
    serRefs=bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",serRefs != null || serRefs.length > 0);
  providerFactory=(ProtocolProviderFactory)bc.getService(serRefs[0]);
  userID1=System.getProperty(MsnProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.USER_ID);
  userID2=System.getProperty(MsnProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.USER_ID);
  ServiceReference[] msnProvider1Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID1+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID1,msnProvider1Refs);
  assertTrue("String_Node_Str" + userID1,msnProvider1Refs.length > 0);
  ServiceReference[] msnProvider2Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID2+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID2,msnProvider2Refs);
  assertTrue("String_Node_Str" + userID2,msnProvider2Refs.length > 0);
  provider1ServiceRef=msnProvider1Refs[0];
  provider1=(ProtocolProviderService)bc.getService(provider1ServiceRef);
  provider2ServiceRef=msnProvider2Refs[0];
  provider2=(ProtocolProviderService)bc.getService(provider2ServiceRef);
}

Fixed version (ground truth):
/** 
 * Initializes protocol provider references and whatever else there is to initialize.
 * @throws java.lang.Exception in case we meet problems while retrivingprotocol providers through OSGI
 */
public void setUp() throws Exception {
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str";
  try {
    serRefs=bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",(serRefs != null) && (serRefs.length > 0));
  providerFactory=(ProtocolProviderFactory)bc.getService(serRefs[0]);
  userID1=System.getProperty(MsnProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.USER_ID);
  userID2=System.getProperty(MsnProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.USER_ID);
  ServiceReference[] msnProvider1Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID1+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID1,msnProvider1Refs);
  assertTrue("String_Node_Str" + userID1,msnProvider1Refs.length > 0);
  ServiceReference[] msnProvider2Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.MSN+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID2+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID2,msnProvider2Refs);
  assertTrue("String_Node_Str" + userID2,msnProvider2Refs.length > 0);
  provider1ServiceRef=msnProvider1Refs[0];
  provider1=(ProtocolProviderService)bc.getService(provider1ServiceRef);
  provider2ServiceRef=msnProvider2Refs[0];
  provider2=(ProtocolProviderService)bc.getService(provider2ServiceRef);
}