Program: 103310
Project: 103310
Buggy source:
/** 
 * Initialized the service implementation, and puts it in a sate where it could interoperate with other services. It is strongly recommended that properties in this Map be mapped to property names as specified by <tt>AccountProperties</tt>.
 * @param screenname the account id/uin/screenname of the account thatwe're about to create
 * @param accountID the identifier of the account that this protocolprovider represents.
 * @see net.java.sip.communicator.service.protocol.AccountID
 */
protected void initialize(String screenname,AccountID accountID){
synchronized (initializationLock) {
    this.accountID=accountID;
    supportedFeatures.clear();
    this.clearRegistrationStateChangeListener();
    String protocolIconPath=accountID.getAccountPropertyString(ProtocolProviderFactory.PROTOCOL_ICON_PATH);
    if (protocolIconPath == null)     protocolIconPath="String_Node_Str";
    jabberIcon=new ProtocolIconJabberImpl(protocolIconPath);
    jabberStatusEnum=JabberStatusEnum.getJabberStatusEnum(protocolIconPath);
    supportedFeatures.add("String_Node_Str");
    String keepAliveStrValue=accountID.getAccountPropertyString("String_Node_Str");
    String resourcePriority=accountID.getAccountPropertyString(ProtocolProviderFactory.RESOURCE_PRIORITY);
    OperationSetPersistentPresenceJabberImpl persistentPresence=new OperationSetPersistentPresenceJabberImpl(this);
    if (resourcePriority != null) {
      persistentPresence.setResourcePriority(Integer.parseInt(resourcePriority));
      supportedFeatures.add("String_Node_Str");
    }
    addSupportedOperationSet(OperationSetPersistentPresence.class,persistentPresence);
    addSupportedOperationSet(OperationSetPresence.class,persistentPresence);
    OperationSetBasicInstantMessagingJabberImpl basicInstantMessaging=new OperationSetBasicInstantMessagingJabberImpl(this);
    if (keepAliveStrValue != null)     basicInstantMessaging.setKeepAliveEnabled(Boolean.parseBoolean(keepAliveStrValue));
    addSupportedOperationSet(OperationSetBasicInstantMessaging.class,basicInstantMessaging);
    addSupportedOperationSet(OperationSetWhiteboarding.class,new OperationSetWhiteboardingJabberImpl(this));
    addSupportedOperationSet(OperationSetTypingNotifications.class,new OperationSetTypingNotificationsJabberImpl(this));
    addSupportedOperationSet(OperationSetMultiUserChat.class,new OperationSetMultiUserChatJabberImpl(this));
    InfoRetreiver infoRetreiver=new InfoRetreiver(this,screenname);
    addSupportedOperationSet(OperationSetServerStoredContactInfo.class,new OperationSetServerStoredContactInfoJabberImpl(infoRetreiver));
    OperationSetServerStoredAccountInfo accountInfo=new OperationSetServerStoredAccountInfoJabberImpl(this,infoRetreiver,screenname);
    addSupportedOperationSet(OperationSetServerStoredAccountInfo.class,accountInfo);
    addSupportedOperationSet(OperationSetAvatar.class,new OperationSetAvatarJabberImpl(this,accountInfo));
    addSupportedOperationSet(OperationSetFileTransfer.class,new OperationSetFileTransferJabberImpl(this));
    addSupportedOperationSet(OperationSetInstantMessageTransform.class,new OperationSetInstantMessageTransformImpl());
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add("String_Node_Str");
    addSupportedOperationSet(OperationSetThumbnailedFileFactory.class,new OperationSetThumbnailedFileFactoryImpl());
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add(URN_XMPP_JINGLE_RTP_HDREXT);
    ProviderManager providerManager=ProviderManager.getInstance();
    providerManager.addIQProvider(JingleIQ.ELEMENT_NAME,JingleIQ.NAMESPACE,new JingleIQProvider());
    providerManager.addIQProvider(InputEvtIQ.ELEMENT_NAME,InputEvtIQ.NAMESPACE,new InputEvtIQProvider());
    providerManager.addIQProvider(CoinIQ.ELEMENT_NAME,CoinIQ.NAMESPACE,new CoinIQProvider());
    supportedFeatures.add(URN_XMPP_JINGLE_COIN);
    providerManager.addIQProvider(SessionIQ.ELEMENT_NAME,SessionIQ.NAMESPACE,new SessionIQProvider());
    providerManager.addIQProvider(JingleInfoQueryIQ.ELEMENT_NAME,JingleInfoQueryIQ.NAMESPACE,new JingleInfoQueryIQProvider());
    boolean isCallingDisabled=JabberActivator.getConfigurationService().getBoolean(IS_CALLING_DISABLED,false);
    boolean isCallingDisabledForAccount=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.IS_CALLING_DISABLED_FOR_ACCOUNT,false);
    if (!isCallingDisabled && !isCallingDisabledForAccount) {
      OperationSetBasicTelephonyJabberImpl basicTelephony=new OperationSetBasicTelephonyJabberImpl(this);
      addSupportedOperationSet(OperationSetAdvancedTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetBasicTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetSecureZrtpTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetVideoTelephony.class,new OperationSetVideoTelephonyJabberImpl(basicTelephony));
      addSupportedOperationSet(OperationSetTelephonyConferencing.class,new OperationSetTelephonyConferencingJabberImpl(this));
      addJingleFeatures();
      boolean isDesktopStreamingDisabled=JabberActivator.getConfigurationService().getBoolean(IS_DESKTOP_STREAMING_DISABLED,false);
      boolean isAccountDesktopStreamingDisabled=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.IS_DESKTOP_STREAMING_DISABLED,false);
      if (!isDesktopStreamingDisabled && !isAccountDesktopStreamingDisabled) {
        addSupportedOperationSet(OperationSetDesktopStreaming.class,new OperationSetDesktopStreamingJabberImpl(basicTelephony));
        addSupportedOperationSet(OperationSetDesktopSharingServer.class,new OperationSetDesktopSharingServerJabberImpl(basicTelephony));
        addSupportedOperationSet(OperationSetDesktopSharingClient.class,new OperationSetDesktopSharingClientJabberImpl(this));
        supportedFeatures.add(InputEvtIQ.NAMESPACE);
      }
    }
    opsetContactCapabilities=new OperationSetContactCapabilitiesJabberImpl(this);
    if (discoveryManager != null)     opsetContactCapabilities.setDiscoveryManager(discoveryManager);
    addSupportedOperationSet(OperationSetContactCapabilities.class,opsetContactCapabilities);
    addSupportedOperationSet(OperationSetGenericNotifications.class,new OperationSetGenericNotificationsJabberImpl(this));
    isInitialized=true;
  }
}

Fixed version (ground truth):
/** 
 * Initialized the service implementation, and puts it in a sate where it could interoperate with other services. It is strongly recommended that properties in this Map be mapped to property names as specified by <tt>AccountProperties</tt>.
 * @param screenname the account id/uin/screenname of the account thatwe're about to create
 * @param accountID the identifier of the account that this protocolprovider represents.
 * @see net.java.sip.communicator.service.protocol.AccountID
 */
protected void initialize(String screenname,AccountID accountID){
synchronized (initializationLock) {
    this.accountID=accountID;
    supportedFeatures.clear();
    this.clearRegistrationStateChangeListener();
    String protocolIconPath=accountID.getAccountPropertyString(ProtocolProviderFactory.PROTOCOL_ICON_PATH);
    if (protocolIconPath == null)     protocolIconPath="String_Node_Str";
    jabberIcon=new ProtocolIconJabberImpl(protocolIconPath);
    jabberStatusEnum=JabberStatusEnum.getJabberStatusEnum(protocolIconPath);
    supportedFeatures.add("String_Node_Str");
    String keepAliveStrValue=accountID.getAccountPropertyString("String_Node_Str");
    String resourcePriority=accountID.getAccountPropertyString(ProtocolProviderFactory.RESOURCE_PRIORITY);
    OperationSetPersistentPresenceJabberImpl persistentPresence=new OperationSetPersistentPresenceJabberImpl(this);
    if (resourcePriority != null) {
      persistentPresence.setResourcePriority(Integer.parseInt(resourcePriority));
      supportedFeatures.add("String_Node_Str");
    }
    addSupportedOperationSet(OperationSetPersistentPresence.class,persistentPresence);
    addSupportedOperationSet(OperationSetPresence.class,persistentPresence);
    OperationSetBasicInstantMessagingJabberImpl basicInstantMessaging=new OperationSetBasicInstantMessagingJabberImpl(this);
    if (keepAliveStrValue != null)     basicInstantMessaging.setKeepAliveEnabled(Boolean.parseBoolean(keepAliveStrValue));
    addSupportedOperationSet(OperationSetBasicInstantMessaging.class,basicInstantMessaging);
    addSupportedOperationSet(OperationSetWhiteboarding.class,new OperationSetWhiteboardingJabberImpl(this));
    addSupportedOperationSet(OperationSetTypingNotifications.class,new OperationSetTypingNotificationsJabberImpl(this));
    addSupportedOperationSet(OperationSetMultiUserChat.class,new OperationSetMultiUserChatJabberImpl(this));
    InfoRetreiver infoRetreiver=new InfoRetreiver(this,screenname);
    addSupportedOperationSet(OperationSetServerStoredContactInfo.class,new OperationSetServerStoredContactInfoJabberImpl(infoRetreiver));
    OperationSetServerStoredAccountInfo accountInfo=new OperationSetServerStoredAccountInfoJabberImpl(this,infoRetreiver,screenname);
    addSupportedOperationSet(OperationSetServerStoredAccountInfo.class,accountInfo);
    addSupportedOperationSet(OperationSetAvatar.class,new OperationSetAvatarJabberImpl(this,accountInfo));
    addSupportedOperationSet(OperationSetFileTransfer.class,new OperationSetFileTransferJabberImpl(this));
    addSupportedOperationSet(OperationSetInstantMessageTransform.class,new OperationSetInstantMessageTransformImpl());
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add("String_Node_Str");
    addSupportedOperationSet(OperationSetThumbnailedFileFactory.class,new OperationSetThumbnailedFileFactoryImpl());
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add("String_Node_Str");
    supportedFeatures.add(URN_XMPP_JINGLE_RTP_HDREXT);
    ProviderManager providerManager=ProviderManager.getInstance();
    providerManager.addIQProvider(JingleIQ.ELEMENT_NAME,JingleIQ.NAMESPACE,new JingleIQProvider());
    providerManager.addIQProvider(InputEvtIQ.ELEMENT_NAME,InputEvtIQ.NAMESPACE,new InputEvtIQProvider());
    providerManager.addIQProvider(CoinIQ.ELEMENT_NAME,CoinIQ.NAMESPACE,new CoinIQProvider());
    supportedFeatures.add(URN_XMPP_JINGLE_COIN);
    providerManager.addIQProvider(SessionIQ.ELEMENT_NAME,SessionIQ.NAMESPACE,new SessionIQProvider());
    providerManager.addIQProvider(JingleInfoQueryIQ.ELEMENT_NAME,JingleInfoQueryIQ.NAMESPACE,new JingleInfoQueryIQProvider());
    boolean isCallingDisabled=JabberActivator.getConfigurationService().getBoolean(IS_CALLING_DISABLED,false);
    boolean isCallingDisabledForAccount=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.IS_CALLING_DISABLED_FOR_ACCOUNT,false);
    if (!isCallingDisabled && !isCallingDisabledForAccount) {
      OperationSetBasicTelephonyJabberImpl basicTelephony=new OperationSetBasicTelephonyJabberImpl(this);
      addSupportedOperationSet(OperationSetAdvancedTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetBasicTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetSecureZrtpTelephony.class,basicTelephony);
      addSupportedOperationSet(OperationSetVideoTelephony.class,new OperationSetVideoTelephonyJabberImpl(basicTelephony));
      addSupportedOperationSet(OperationSetTelephonyConferencing.class,new OperationSetTelephonyConferencingJabberImpl(this));
      addJingleFeatures();
      boolean isDesktopStreamingDisabled=JabberActivator.getConfigurationService().getBoolean(IS_DESKTOP_STREAMING_DISABLED,false);
      boolean isAccountDesktopStreamingDisabled=accountID.getAccountPropertyBoolean(ProtocolProviderFactory.IS_DESKTOP_STREAMING_DISABLED,false);
      if (!isDesktopStreamingDisabled && !isAccountDesktopStreamingDisabled) {
        addSupportedOperationSet(OperationSetDesktopStreaming.class,new OperationSetDesktopStreamingJabberImpl(basicTelephony));
        addSupportedOperationSet(OperationSetDesktopSharingServer.class,new OperationSetDesktopSharingServerJabberImpl(basicTelephony));
        addSupportedOperationSet(OperationSetDesktopSharingClient.class,new OperationSetDesktopSharingClientJabberImpl(this));
        supportedFeatures.add(InputEvtIQ.NAMESPACE);
      }
    }
    opsetContactCapabilities=new OperationSetContactCapabilitiesJabberImpl(this);
    if (discoveryManager != null)     opsetContactCapabilities.setDiscoveryManager(discoveryManager);
    addSupportedOperationSet(OperationSetContactCapabilities.class,opsetContactCapabilities);
    addSupportedOperationSet(OperationSetGenericNotifications.class,new OperationSetGenericNotificationsJabberImpl(this));
    SmackConfiguration.setPacketReplyTimeout(45000);
    isInitialized=true;
  }
}