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