Program: 96441
Project: 96441
Buggy source:
/** 
 * <p> Launch the in-process Gateway. </p>
 * @throws Exception
 */
@Override public void launch() throws Exception {
  if (baseGateway != null) {
    baseGateway.launch();
  }
  if (gateway != null) {
    throw new GatewayAlreadyRunningException("String_Node_Str");
  }
  Properties configuration=getProperties();
  if (configuration == null) {
    throw new Exception("String_Node_Str");
  }
  String bypassPlatformCheckStr=configuration.getProperty(BYPASS_PLATFORM_CHECK_PROPERTY);
  boolean bypassPlatformCheck=bypassPlatformCheckStr != null && !bypassPlatformCheckStr.equalsIgnoreCase("String_Node_Str") && !bypassPlatformCheckStr.equalsIgnoreCase("String_Node_Str") && !bypassPlatformCheckStr.equalsIgnoreCase("String_Node_Str");
  if (!bypassPlatformCheck && !supportedJavaVersion(1,8,"String_Node_Str")) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  String gatewayHomeProperty=configuration.getProperty(GATEWAY_HOME_PROPERTY);
  if (gatewayHomeProperty == null) {
    throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + "String_Node_Str");
  }
  File homeDir=new File(gatewayHomeProperty);
  if (!homeDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + "String_Node_Str" + homeDir.getAbsolutePath());
  }
  String gatewayConfigDirectoryProperty=configuration.getProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY);
  File configDir=(gatewayConfigDirectoryProperty != null) ? new File(gatewayConfigDirectoryProperty) : new File(homeDir,DEFAULT_CONFIG_DIRECTORY);
  if (!configDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_CONFIG_DIRECTORY_PROPERTY + "String_Node_Str" + configDir.getAbsolutePath());
  }
  configuration.setProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY,configDir.toString());
  String gatewayTempDirectoryProperty=configuration.getProperty(GATEWAY_TEMP_DIRECTORY_PROPERTY);
  File tempDir=(gatewayTempDirectoryProperty != null) ? new File(gatewayTempDirectoryProperty) : new File(homeDir,DEFAULT_TEMP_DIRECTORY);
  if (!tempDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_TEMP_DIRECTORY_PROPERTY + "String_Node_Str" + tempDir.getAbsolutePath());
  }
  String gatewayLogDirectoryProperty=configuration.getProperty(GATEWAY_LOG_DIRECTORY_PROPERTY);
  File logDir=(gatewayLogDirectoryProperty != null) ? new File(gatewayLogDirectoryProperty) : new File(homeDir,DEFAULT_LOG_DIRECTORY);
  if (!logDir.exists()) {
    logDir.mkdir();
  }
  if (!logDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_LOG_DIRECTORY_PROPERTY + "String_Node_Str" + logDir.getAbsolutePath());
  }
  configuration.setProperty(GATEWAY_LOG_DIRECTORY_PROPERTY,logDir.toString());
  File gatewayConfigFile;
  String gatewayConfigProperty=configuration.getProperty(GATEWAY_CONFIG_PROPERTY);
  try {
    URL configURL=new URL(gatewayConfigProperty);
    String path=configURL.getPath();
    ReadableByteChannel rbc=Channels.newChannel(configURL.openStream());
    final File configFile=new File(configDir,path.substring(path.lastIndexOf('/') + 1));
    try (FileOutputStream fos=new FileOutputStream(configFile)){
      fos.getChannel().transferFrom(rbc,0,Long.MAX_VALUE);
    }
     configuration.setProperty(Gateway.GATEWAY_CONFIG_PROPERTY,configFile.getPath());
    gatewayConfigProperty=configuration.getProperty(GATEWAY_CONFIG_PROPERTY);
  }
 catch (  MalformedURLException e1) {
  }
catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + gatewayConfigProperty,e);
  }
  if (gatewayConfigProperty != null) {
    gatewayConfigFile=new File(gatewayConfigProperty);
    if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
      throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY + "String_Node_Str" + gatewayConfigFile.getAbsolutePath());
    }
  }
 else {
    gatewayConfigFile=new File(configDir,DEFAULT_GATEWAY_CONFIG_XML);
    if (!gatewayConfigFile.exists()) {
      gatewayConfigFile=new File(configDir,DEFAULT_GATEWAY_CONFIG_MINIMAL_XML);
    }
    if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
      throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY + "String_Node_Str" + "String_Node_Str");
    }
  }
  String gatewayWebDirectoryProperty=configuration.getProperty(GATEWAY_WEB_DIRECTORY_PROPERTY);
  File webRootDir=(gatewayWebDirectoryProperty != null) ? new File(gatewayWebDirectoryProperty) : new File(homeDir,DEFAULT_WEB_DIRECTORY);
  if (!webRootDir.exists()) {
    webRootDir.mkdir();
  }
  if (!webRootDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_WEB_DIRECTORY_PROPERTY + "String_Node_Str" + webRootDir.getAbsolutePath());
  }
  String overrideLogging=configuration.getProperty(OVERRIDE_LOGGING);
  if ((overrideLogging == null) || !Boolean.parseBoolean(overrideLogging)) {
    configureLogging(configDir,configuration);
  }
  duplicateJarFinder.findDuplicateJars();
  displayVersionInfo();
  LOGGER.info("String_Node_Str" + gatewayConfigFile.getCanonicalPath());
  GatewayObserver gatewayObserver=GatewayObserver.newInstance();
  GatewayConfigParser parser=new GatewayConfigParser(configuration);
  GatewayConfigDocument config=parser.parse(gatewayConfigFile);
  GatewayContextResolver resolver=new GatewayContextResolver(configDir,webRootDir,tempDir,jmxMBeanServer);
  gatewayObserver.initingGateway(configuration,resolver.getInjectables());
  GatewayContext context=resolver.resolve(config,configuration);
  gateway=new Launcher(gatewayObserver);
  try {
    gateway.init(context);
  }
 catch (  Exception e) {
    LOGGER.error(String.format("String_Node_Str",e));
    throw e;
  }
}

Fixed version (ground truth):
/** 
 * <p> Launch the in-process Gateway. </p>
 * @throws Exception
 */
@Override public void launch() throws Exception {
  if (baseGateway != null) {
    baseGateway.launch();
  }
  if (gateway != null) {
    throw new GatewayAlreadyRunningException("String_Node_Str");
  }
  Properties configuration=getProperties();
  if (configuration == null) {
    throw new Exception("String_Node_Str");
  }
  if (!supportedJavaVersion(1,8,"String_Node_Str")) {
    throw new RuntimeException("String_Node_Str" + "String_Node_Str");
  }
  String gatewayHomeProperty=configuration.getProperty(GATEWAY_HOME_PROPERTY);
  if (gatewayHomeProperty == null) {
    throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + "String_Node_Str");
  }
  File homeDir=new File(gatewayHomeProperty);
  if (!homeDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_HOME_PROPERTY + "String_Node_Str" + homeDir.getAbsolutePath());
  }
  String gatewayConfigDirectoryProperty=configuration.getProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY);
  File configDir=(gatewayConfigDirectoryProperty != null) ? new File(gatewayConfigDirectoryProperty) : new File(homeDir,DEFAULT_CONFIG_DIRECTORY);
  if (!configDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_CONFIG_DIRECTORY_PROPERTY + "String_Node_Str" + configDir.getAbsolutePath());
  }
  configuration.setProperty(GATEWAY_CONFIG_DIRECTORY_PROPERTY,configDir.toString());
  String gatewayTempDirectoryProperty=configuration.getProperty(GATEWAY_TEMP_DIRECTORY_PROPERTY);
  File tempDir=(gatewayTempDirectoryProperty != null) ? new File(gatewayTempDirectoryProperty) : new File(homeDir,DEFAULT_TEMP_DIRECTORY);
  if (!tempDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_TEMP_DIRECTORY_PROPERTY + "String_Node_Str" + tempDir.getAbsolutePath());
  }
  String gatewayLogDirectoryProperty=configuration.getProperty(GATEWAY_LOG_DIRECTORY_PROPERTY);
  File logDir=(gatewayLogDirectoryProperty != null) ? new File(gatewayLogDirectoryProperty) : new File(homeDir,DEFAULT_LOG_DIRECTORY);
  if (!logDir.exists()) {
    logDir.mkdir();
  }
  if (!logDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_LOG_DIRECTORY_PROPERTY + "String_Node_Str" + logDir.getAbsolutePath());
  }
  configuration.setProperty(GATEWAY_LOG_DIRECTORY_PROPERTY,logDir.toString());
  File gatewayConfigFile;
  String gatewayConfigProperty=configuration.getProperty(GATEWAY_CONFIG_PROPERTY);
  try {
    URL configURL=new URL(gatewayConfigProperty);
    String path=configURL.getPath();
    ReadableByteChannel rbc=Channels.newChannel(configURL.openStream());
    final File configFile=new File(configDir,path.substring(path.lastIndexOf('/') + 1));
    try (FileOutputStream fos=new FileOutputStream(configFile)){
      fos.getChannel().transferFrom(rbc,0,Long.MAX_VALUE);
    }
     configuration.setProperty(Gateway.GATEWAY_CONFIG_PROPERTY,configFile.getPath());
    gatewayConfigProperty=configuration.getProperty(GATEWAY_CONFIG_PROPERTY);
  }
 catch (  MalformedURLException e1) {
  }
catch (  IOException e) {
    throw new RuntimeException("String_Node_Str" + gatewayConfigProperty,e);
  }
  if (gatewayConfigProperty != null) {
    gatewayConfigFile=new File(gatewayConfigProperty);
    if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
      throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY + "String_Node_Str" + gatewayConfigFile.getAbsolutePath());
    }
  }
 else {
    gatewayConfigFile=new File(configDir,DEFAULT_GATEWAY_CONFIG_XML);
    if (!gatewayConfigFile.exists()) {
      gatewayConfigFile=new File(configDir,DEFAULT_GATEWAY_CONFIG_MINIMAL_XML);
    }
    if (!gatewayConfigFile.isFile() || !gatewayConfigFile.canRead()) {
      throw new IllegalArgumentException(GATEWAY_CONFIG_PROPERTY + "String_Node_Str" + "String_Node_Str");
    }
  }
  String gatewayWebDirectoryProperty=configuration.getProperty(GATEWAY_WEB_DIRECTORY_PROPERTY);
  File webRootDir=(gatewayWebDirectoryProperty != null) ? new File(gatewayWebDirectoryProperty) : new File(homeDir,DEFAULT_WEB_DIRECTORY);
  if (!webRootDir.exists()) {
    webRootDir.mkdir();
  }
  if (!webRootDir.isDirectory()) {
    throw new IllegalArgumentException(GATEWAY_WEB_DIRECTORY_PROPERTY + "String_Node_Str" + webRootDir.getAbsolutePath());
  }
  String overrideLogging=configuration.getProperty(OVERRIDE_LOGGING);
  if ((overrideLogging == null) || !Boolean.parseBoolean(overrideLogging)) {
    configureLogging(configDir,configuration);
  }
  duplicateJarFinder.findDuplicateJars();
  displayVersionInfo();
  LOGGER.info("String_Node_Str" + gatewayConfigFile.getCanonicalPath());
  GatewayObserver gatewayObserver=GatewayObserver.newInstance();
  GatewayConfigParser parser=new GatewayConfigParser(configuration);
  GatewayConfigDocument config=parser.parse(gatewayConfigFile);
  GatewayContextResolver resolver=new GatewayContextResolver(configDir,webRootDir,tempDir,jmxMBeanServer);
  gatewayObserver.initingGateway(configuration,resolver.getInjectables());
  GatewayContext context=resolver.resolve(config,configuration);
  gateway=new Launcher(gatewayObserver);
  try {
    gateway.init(context);
  }
 catch (  Exception e) {
    LOGGER.error(String.format("String_Node_Str",e));
    throw e;
  }
}