Program: 13224
Project: 13224
Buggy source:
/** 
 * {@inheritDoc}
 */
public List<JsonPointer> getPropertiesToEncrypt(String pidOrFactory,String instanceAlias,JsonValue config) throws WaitForMetaData {
  List<JsonPointer> result=null;
  if (null != pidOrFactory && null != config) {
    if (PID.equals(pidOrFactory)) {
      try {
        JsonValue remoteConnectorHosts=config.get(ConnectorUtil.OPENICF_REMOTE_CONNECTOR_SERVERS).expect(List.class);
        if (!remoteConnectorHosts.isNull()) {
          result=new ArrayList<JsonPointer>(remoteConnectorHosts.size());
          for (          JsonValue hostConfig : remoteConnectorHosts) {
            result.add(hostConfig.get(ConnectorUtil.OPENICF_KEY).getPointer());
          }
        }
      }
 catch (      JsonValueException e) {
        logger.error("String_Node_Str",e);
      }
    }
 else     if (OpenICFProvisionerService.PID.equals(pidOrFactory)) {
      if (isOSGiServiceInstance) {
        ConfigurationProperties properties=null;
        try {
          ConnectorReference connectorReference=ConnectorUtil.getConnectorReference(config);
          ConnectorInfo ci=findConnectorInfo(connectorReference);
          if (null != ci) {
            properties=ci.createDefaultAPIConfiguration().getConfigurationProperties();
          }
        }
 catch (        Exception e) {
          logger.error("String_Node_Str",new Object[]{pidOrFactory,instanceAlias},e);
        }
        if (null != properties) {
          JsonPointer configurationProperties=new JsonPointer(ConnectorUtil.OPENICF_CONFIGURATION_PROPERTIES);
          result=new ArrayList<JsonPointer>(properties.getPropertyNames().size());
          for (          String name : properties.getPropertyNames()) {
            ConfigurationProperty property=properties.getProperty(name);
            if (property.isConfidential() || property.getType().equals(GuardedString.class) || property.getType().equals(GuardedByteArray.class)) {
              result.add(configurationProperties.child(name));
            }
          }
        }
 else {
          throw new WaitForMetaData(pidOrFactory);
        }
      }
 else {
        throw new WaitForMetaData("String_Node_Str");
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public List<JsonPointer> getPropertiesToEncrypt(String pidOrFactory,String instanceAlias,JsonValue config) throws WaitForMetaData {
  List<JsonPointer> result=null;
  if (null != pidOrFactory && null != config) {
    if (PID.equals(pidOrFactory)) {
      try {
        JsonValue remoteConnectorHosts=config.get(ConnectorUtil.OPENICF_REMOTE_CONNECTOR_SERVERS).expect(List.class);
        if (!remoteConnectorHosts.isNull()) {
          result=new ArrayList<JsonPointer>(remoteConnectorHosts.size());
          for (          JsonValue hostConfig : remoteConnectorHosts) {
            result.add(hostConfig.get(ConnectorUtil.OPENICF_KEY).getPointer());
          }
        }
      }
 catch (      JsonValueException e) {
        logger.error("String_Node_Str",e);
      }
    }
 else     if (OpenICFProvisionerService.PID.equals(pidOrFactory)) {
      if (isOSGiServiceInstance) {
        ConfigurationProperties properties=null;
        try {
          ConnectorReference connectorReference=ConnectorUtil.getConnectorReference(config);
          ConnectorInfo ci=findConnectorInfo(connectorReference);
          if (null != ci) {
            properties=ci.createDefaultAPIConfiguration().getConfigurationProperties();
          }
        }
 catch (        JsonValueException jve) {
          throw jve;
        }
catch (        Exception e) {
          logger.error("String_Node_Str",new Object[]{pidOrFactory,instanceAlias,e.getMessage()},e);
        }
        if (null != properties) {
          JsonPointer configurationProperties=new JsonPointer(ConnectorUtil.OPENICF_CONFIGURATION_PROPERTIES);
          result=new ArrayList<JsonPointer>(properties.getPropertyNames().size());
          for (          String name : properties.getPropertyNames()) {
            ConfigurationProperty property=properties.getProperty(name);
            if (property.isConfidential() || property.getType().equals(GuardedString.class) || property.getType().equals(GuardedByteArray.class)) {
              result.add(configurationProperties.child(name));
            }
          }
        }
 else {
          throw new WaitForMetaData(pidOrFactory);
        }
      }
 else {
        throw new WaitForMetaData("String_Node_Str");
      }
    }
  }
  return result;
}