Program: 104331
Project: 104331
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.YAHOO+ "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(YahooProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.USER_ID);
  userID2=System.getProperty(YahooProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.USER_ID);
  ServiceReference[] yahooProvider1Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.YAHOO+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID1+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID1,yahooProvider1Refs);
  assertTrue("String_Node_Str" + userID1,yahooProvider1Refs.length > 0);
  ServiceReference[] yahooProvider2Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.YAHOO+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID2+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID2,yahooProvider2Refs);
  assertTrue("String_Node_Str" + userID2,yahooProvider2Refs.length > 0);
  provider1ServiceRef=yahooProvider1Refs[0];
  provider1=(ProtocolProviderService)bc.getService(provider1ServiceRef);
  provider2ServiceRef=yahooProvider2Refs[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.YAHOO+ "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(YahooProtocolProviderServiceLick.ACCOUNT_1_PREFIX + ProtocolProviderFactory.USER_ID);
  userID2=System.getProperty(YahooProtocolProviderServiceLick.ACCOUNT_2_PREFIX + ProtocolProviderFactory.USER_ID);
  ServiceReference[] yahooProvider1Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.YAHOO+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID1+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID1,yahooProvider1Refs);
  assertTrue("String_Node_Str" + userID1,yahooProvider1Refs.length > 0);
  ServiceReference[] yahooProvider2Refs=bc.getServiceReferences(ProtocolProviderService.class.getName(),"String_Node_Str" + "String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.YAHOO+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ userID2+ "String_Node_Str"+ "String_Node_Str");
  assertNotNull("String_Node_Str" + userID2,yahooProvider2Refs);
  assertTrue("String_Node_Str" + userID2,yahooProvider2Refs.length > 0);
  provider1ServiceRef=yahooProvider1Refs[0];
  provider1=(ProtocolProviderService)bc.getService(provider1ServiceRef);
  provider2ServiceRef=yahooProvider2Refs[0];
  provider2=(ProtocolProviderService)bc.getService(provider2ServiceRef);
}