Program: 104327
Project: 104327
Buggy source:
/** 
 * Installs an account and verifies whether the installation has gone well.
 */
public void testInstallAccount(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",serRefs != null || serRefs.length > 0);
  icqProviderFactory=(ProtocolProviderFactory)IcqSlickFixture.bc.getService(serRefs[0]);
  assertTrue("String_Node_Str" + "String_Node_Str",icqProviderFactory.getRegisteredAccounts().size() == 0);
  String passwd=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME,null);
  String uin=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME,null);
  assertNotNull("String_Node_Str" + IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME + "String_Node_Str"+ "String_Node_Str"+ IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME,uin);
  assertNotNull("String_Node_Str" + IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME + "String_Node_Str"+ uin+ "String_Node_Str",passwd);
  Hashtable icqAccountProperties=new Hashtable();
  icqAccountProperties.put(ProtocolProviderFactory.PASSWORD,passwd);
  try {
    icqProviderFactory.installAccount(null,icqAccountProperties);
    fail("String_Node_Str" + "String_Node_Str");
  }
 catch (  NullPointerException exc) {
  }
  IcqSlickFixture.icqAccountID=icqProviderFactory.installAccount(uin,icqAccountProperties);
  try {
    IcqSlickFixture.icqAccountID=icqProviderFactory.installAccount(uin,icqAccountProperties);
    fail("String_Node_Str" + "String_Node_Str");
  }
 catch (  IllegalStateException exc) {
  }
  assertTrue("String_Node_Str" + "String_Node_Str",icqProviderFactory.getRegisteredAccounts().size() == 1);
  osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ IcqSlickFixture.icqAccountID.getUserID()+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderService.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str" + "String_Node_Str",serRefs != null && serRefs.length > 0);
  Object icqProtocolProvider=IcqSlickFixture.bc.getService(serRefs[0]);
  assertTrue("String_Node_Str" + "String_Node_Str",icqProtocolProvider instanceof ProtocolProviderService);
}

Fixed version (ground truth):
/** 
 * Installs an account and verifies whether the installation has gone well.
 */
public void testInstallAccount(){
  ServiceReference[] serRefs=null;
  String osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderFactory.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str",(serRefs != null) && (serRefs.length > 0));
  icqProviderFactory=(ProtocolProviderFactory)IcqSlickFixture.bc.getService(serRefs[0]);
  assertTrue("String_Node_Str" + "String_Node_Str",icqProviderFactory.getRegisteredAccounts().size() == 0);
  String passwd=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME,null);
  String uin=System.getProperty(IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME,null);
  assertNotNull("String_Node_Str" + IcqProtocolProviderSlick.TESTED_IMPL_USER_ID_PROP_NAME + "String_Node_Str"+ "String_Node_Str"+ IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME,uin);
  assertNotNull("String_Node_Str" + IcqProtocolProviderSlick.TESTED_IMPL_PWD_PROP_NAME + "String_Node_Str"+ uin+ "String_Node_Str",passwd);
  Hashtable icqAccountProperties=new Hashtable();
  icqAccountProperties.put(ProtocolProviderFactory.PASSWORD,passwd);
  try {
    icqProviderFactory.installAccount(null,icqAccountProperties);
    fail("String_Node_Str" + "String_Node_Str");
  }
 catch (  NullPointerException exc) {
  }
  IcqSlickFixture.icqAccountID=icqProviderFactory.installAccount(uin,icqAccountProperties);
  try {
    IcqSlickFixture.icqAccountID=icqProviderFactory.installAccount(uin,icqAccountProperties);
    fail("String_Node_Str" + "String_Node_Str");
  }
 catch (  IllegalStateException exc) {
  }
  assertTrue("String_Node_Str" + "String_Node_Str",icqProviderFactory.getRegisteredAccounts().size() == 1);
  osgiFilter="String_Node_Str" + ProtocolProviderFactory.PROTOCOL + "String_Node_Str"+ ProtocolNames.ICQ+ "String_Node_Str"+ "String_Node_Str"+ ProtocolProviderFactory.USER_ID+ "String_Node_Str"+ IcqSlickFixture.icqAccountID.getUserID()+ "String_Node_Str";
  try {
    serRefs=IcqSlickFixture.bc.getServiceReferences(ProtocolProviderService.class.getName(),osgiFilter);
  }
 catch (  InvalidSyntaxException ex) {
    fail(osgiFilter + "String_Node_Str");
  }
  assertTrue("String_Node_Str" + "String_Node_Str",serRefs != null && serRefs.length > 0);
  Object icqProtocolProvider=IcqSlickFixture.bc.getService(serRefs[0]);
  assertTrue("String_Node_Str" + "String_Node_Str",icqProtocolProvider instanceof ProtocolProviderService);
}