Program: 93550
Project: 93550
Buggy source:
/** 
 * Creates a new instance of ErrorHandler from the configuration file For any missing property the default value is used.
 * @param confFilePath the path of the configuration file
 * @param silent
 * @throws org.restheart.ConfigurationException
 */
public Configuration(final Path confFilePath,boolean silent) throws ConfigurationException {
  this.silent=silent;
  Yaml yaml=new Yaml();
  Map<String,Object> conf=null;
  FileInputStream fis=null;
  try {
    fis=new FileInputStream(confFilePath.toFile());
    conf=(Map<String,Object>)yaml.load(fis);
  }
 catch (  FileNotFoundException fne) {
    throw new ConfigurationException("String_Node_Str",fne);
  }
catch (  Throwable t) {
    throw new ConfigurationException("String_Node_Str",t);
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException ioe) {
        LOGGER.warn("String_Node_Str",ioe);
      }
    }
  }
  httpsListener=getAsBooleanOrDefault(conf,HTTPS_LISTENER,true);
  httpsPort=getAsIntegerOrDefault(conf,HTTPS_PORT_KEY,DEFAULT_HTTPS_PORT);
  httpsHost=getAsStringOrDefault(conf,HTTPS_HOST_KEY,DEFAULT_HTTPS_HOST);
  httpListener=getAsBooleanOrDefault(conf,HTTP_LISTENER_KEY,false);
  httpPort=getAsIntegerOrDefault(conf,HTTP_PORT_KEY,DEFAULT_HTTP_PORT);
  httpHost=getAsStringOrDefault(conf,HTTP_HOST_KEY,DEFAULT_HTTP_HOST);
  ajpListener=getAsBooleanOrDefault(conf,AJP_LISTENER_KEY,false);
  ajpPort=getAsIntegerOrDefault(conf,AJP_PORT_KEY,DEFAULT_AJP_PORT);
  ajpHost=getAsStringOrDefault(conf,AJP_HOST_KEY,DEFAULT_AJP_HOST);
  useEmbeddedKeystore=getAsBooleanOrDefault(conf,USE_EMBEDDED_KEYSTORE_KEY,true);
  keystoreFile=getAsStringOrDefault(conf,KEYSTORE_FILE_KEY,null);
  keystorePassword=getAsStringOrDefault(conf,KEYSTORE_PASSWORD_KEY,null);
  certPassword=getAsStringOrDefault(conf,CERT_PASSWORD_KEY,null);
  List<Map<String,Object>> mongoServersDefault=new ArrayList<>();
  Map<String,Object> defaultMongoServer=new HashMap<>();
  defaultMongoServer.put(MONGO_HOST_KEY,"String_Node_Str");
  defaultMongoServer.put(MONGO_PORT_KEY,27017);
  mongoServersDefault.add(defaultMongoServer);
  mongoServers=getAsListOfMaps(conf,MONGO_SERVERS_KEY,mongoServersDefault);
  mongoCredentials=getAsListOfMaps(conf,MONGO_CREDENTIALS_KEY,null);
  List<Map<String,Object>> mongoMountsDefault=new ArrayList<>();
  Map<String,Object> defaultMongoMounts=new HashMap<>();
  defaultMongoMounts.put(MONGO_MOUNT_WHAT_KEY,"String_Node_Str");
  defaultMongoMounts.put(MONGO_MOUNT_WHERE_KEY,"String_Node_Str");
  mongoMountsDefault.add(defaultMongoMounts);
  mongoMounts=getAsListOfMaps(conf,MONGO_MOUNTS_KEY,mongoMountsDefault);
  applicationLogicMounts=getAsListOfMaps(conf,APPLICATION_LOGIC_MOUNTS_KEY,new ArrayList<>());
  staticResourcesMounts=getAsListOfMaps(conf,STATIC_RESOURCES_MOUNTS_KEY,new ArrayList<>());
  Map<String,Object> idm=getAsMap(conf,IDM_KEY);
  Map<String,Object> am=getAsMap(conf,ACCESS_MANAGER_KEY);
  idmImpl=getAsStringOrDefault(idm,IMPLEMENTATION_CLASS_KEY,DEFAULT_IDM_IMPLEMENTATION_CLASS);
  idmArgs=idm;
  amImpl=getAsStringOrDefault(am,IMPLEMENTATION_CLASS_KEY,DEFAULT_AM_IMPLEMENTATION_CLASS);
  amArgs=am;
  logFilePath=getAsStringOrDefault(conf,LOG_FILE_PATH_KEY,URLUtils.removeTrailingSlashes(System.getProperty("String_Node_Str")).concat(File.separator + "String_Node_Str"));
  String _logLevel=getAsStringOrDefault(conf,LOG_LEVEL_KEY,"String_Node_Str");
  logToConsole=getAsBooleanOrDefault(conf,ENABLE_LOG_CONSOLE_KEY,true);
  logToFile=getAsBooleanOrDefault(conf,ENABLE_LOG_FILE_KEY,true);
  Level level;
  try {
    level=Level.valueOf(_logLevel);
  }
 catch (  Exception e) {
    if (!silent) {
      LOGGER.info("String_Node_Str","String_Node_Str",_logLevel,"String_Node_Str");
    }
    level=Level.INFO;
  }
  logLevel=level;
  requestsLimit=getAsIntegerOrDefault(conf,REQUESTS_LIMIT_KEY,100);
  localCacheEnabled=getAsBooleanOrDefault(conf,LOCAL_CACHE_ENABLED_KEY,true);
  localCacheTtl=getAsLongOrDefault(conf,LOCAL_CACHE_TTL_KEY,(long)1000);
  ioThreads=getAsIntegerOrDefault(conf,IO_THREADS_KEY,2);
  workerThreads=getAsIntegerOrDefault(conf,WORKER_THREADS_KEY,32);
  bufferSize=getAsIntegerOrDefault(conf,BUFFER_SIZE_KEY,16384);
  buffersPerRegion=getAsIntegerOrDefault(conf,BUFFERS_PER_REGION_KEY,20);
  directBuffers=getAsBooleanOrDefault(conf,DIRECT_BUFFERS_KEY,true);
  forceGzipEncoding=getAsBooleanOrDefault(conf,FORCE_GZIP_ENCODING_KEY,false);
  eagerPoolSize=getAsIntegerOrDefault(conf,EAGER_POOL_SIZE,100);
  eagerLinearSliceWidht=getAsIntegerOrDefault(conf,EAGER_LINEAR_SLICE_WIDHT,1000);
  eagerLinearSliceDelta=getAsIntegerOrDefault(conf,EAGER_LINEAR_SLICE_DELTA,100);
  eagerLinearSliceHeights=getAsArrayOfInts(conf,EAGER_LINEAR_HEIGHTS,new int[]{4,2,1});
  eagerRndSliceMinWidht=getAsIntegerOrDefault(conf,EAGER_RND_SLICE_MIN_WIDHT,1000);
  eagerRndMaxCursors=getAsIntegerOrDefault(conf,EAGER_RND_MAX_CURSORS,50);
  authTokenEnabled=getAsBooleanOrDefault(conf,AUTH_TOKEN_ENABLED,true);
  authTokenTtl=getAsIntegerOrDefault(conf,AUTH_TOKEN_TTL,15);
}

Fixed version (ground truth):
/** 
 * Creates a new instance of ErrorHandler from the configuration file For any missing property the default value is used.
 * @param confFilePath the path of the configuration file
 * @param silent
 * @throws org.restheart.ConfigurationException
 */
public Configuration(final Path confFilePath,boolean silent) throws ConfigurationException {
  this.silent=silent;
  Yaml yaml=new Yaml();
  Map<String,Object> conf=null;
  FileInputStream fis=null;
  try {
    fis=new FileInputStream(confFilePath.toFile());
    conf=(Map<String,Object>)yaml.load(fis);
  }
 catch (  FileNotFoundException fne) {
    throw new ConfigurationException("String_Node_Str",fne);
  }
catch (  Throwable t) {
    throw new ConfigurationException("String_Node_Str",t);
  }
 finally {
    if (fis != null) {
      try {
        fis.close();
      }
 catch (      IOException ioe) {
        LOGGER.warn("String_Node_Str",ioe);
      }
    }
  }
  httpsListener=getAsBooleanOrDefault(conf,HTTPS_LISTENER,true);
  httpsPort=getAsIntegerOrDefault(conf,HTTPS_PORT_KEY,DEFAULT_HTTPS_PORT);
  httpsHost=getAsStringOrDefault(conf,HTTPS_HOST_KEY,DEFAULT_HTTPS_HOST);
  httpListener=getAsBooleanOrDefault(conf,HTTP_LISTENER_KEY,false);
  httpPort=getAsIntegerOrDefault(conf,HTTP_PORT_KEY,DEFAULT_HTTP_PORT);
  httpHost=getAsStringOrDefault(conf,HTTP_HOST_KEY,DEFAULT_HTTP_HOST);
  ajpListener=getAsBooleanOrDefault(conf,AJP_LISTENER_KEY,false);
  ajpPort=getAsIntegerOrDefault(conf,AJP_PORT_KEY,DEFAULT_AJP_PORT);
  ajpHost=getAsStringOrDefault(conf,AJP_HOST_KEY,DEFAULT_AJP_HOST);
  useEmbeddedKeystore=getAsBooleanOrDefault(conf,USE_EMBEDDED_KEYSTORE_KEY,true);
  keystoreFile=getAsStringOrDefault(conf,KEYSTORE_FILE_KEY,null);
  keystorePassword=getAsStringOrDefault(conf,KEYSTORE_PASSWORD_KEY,null);
  certPassword=getAsStringOrDefault(conf,CERT_PASSWORD_KEY,null);
  List<Map<String,Object>> mongoServersDefault=new ArrayList<>();
  Map<String,Object> defaultMongoServer=new HashMap<>();
  defaultMongoServer.put(MONGO_HOST_KEY,DEFAULT_MONGO_HOST);
  defaultMongoServer.put(MONGO_PORT_KEY,DEFAULT_MONGO_PORT);
  mongoServersDefault.add(defaultMongoServer);
  mongoServers=getAsListOfMaps(conf,MONGO_SERVERS_KEY,mongoServersDefault);
  mongoCredentials=getAsListOfMaps(conf,MONGO_CREDENTIALS_KEY,null);
  List<Map<String,Object>> mongoMountsDefault=new ArrayList<>();
  Map<String,Object> defaultMongoMounts=new HashMap<>();
  defaultMongoMounts.put(MONGO_MOUNT_WHAT_KEY,"String_Node_Str");
  defaultMongoMounts.put(MONGO_MOUNT_WHERE_KEY,"String_Node_Str");
  mongoMountsDefault.add(defaultMongoMounts);
  mongoMounts=getAsListOfMaps(conf,MONGO_MOUNTS_KEY,mongoMountsDefault);
  applicationLogicMounts=getAsListOfMaps(conf,APPLICATION_LOGIC_MOUNTS_KEY,new ArrayList<>());
  staticResourcesMounts=getAsListOfMaps(conf,STATIC_RESOURCES_MOUNTS_KEY,new ArrayList<>());
  Map<String,Object> idm=getAsMap(conf,IDM_KEY);
  Map<String,Object> am=getAsMap(conf,ACCESS_MANAGER_KEY);
  idmImpl=getAsStringOrDefault(idm,IMPLEMENTATION_CLASS_KEY,DEFAULT_IDM_IMPLEMENTATION_CLASS);
  idmArgs=idm;
  amImpl=getAsStringOrDefault(am,IMPLEMENTATION_CLASS_KEY,DEFAULT_AM_IMPLEMENTATION_CLASS);
  amArgs=am;
  logFilePath=getAsStringOrDefault(conf,LOG_FILE_PATH_KEY,URLUtils.removeTrailingSlashes(System.getProperty("String_Node_Str")).concat(File.separator + "String_Node_Str"));
  String _logLevel=getAsStringOrDefault(conf,LOG_LEVEL_KEY,"String_Node_Str");
  logToConsole=getAsBooleanOrDefault(conf,ENABLE_LOG_CONSOLE_KEY,true);
  logToFile=getAsBooleanOrDefault(conf,ENABLE_LOG_FILE_KEY,true);
  Level level;
  try {
    level=Level.valueOf(_logLevel);
  }
 catch (  Exception e) {
    if (!silent) {
      LOGGER.info("String_Node_Str","String_Node_Str",_logLevel,"String_Node_Str");
    }
    level=Level.INFO;
  }
  logLevel=level;
  requestsLimit=getAsIntegerOrDefault(conf,REQUESTS_LIMIT_KEY,100);
  localCacheEnabled=getAsBooleanOrDefault(conf,LOCAL_CACHE_ENABLED_KEY,true);
  localCacheTtl=getAsLongOrDefault(conf,LOCAL_CACHE_TTL_KEY,(long)1000);
  ioThreads=getAsIntegerOrDefault(conf,IO_THREADS_KEY,2);
  workerThreads=getAsIntegerOrDefault(conf,WORKER_THREADS_KEY,32);
  bufferSize=getAsIntegerOrDefault(conf,BUFFER_SIZE_KEY,16384);
  buffersPerRegion=getAsIntegerOrDefault(conf,BUFFERS_PER_REGION_KEY,20);
  directBuffers=getAsBooleanOrDefault(conf,DIRECT_BUFFERS_KEY,true);
  forceGzipEncoding=getAsBooleanOrDefault(conf,FORCE_GZIP_ENCODING_KEY,false);
  eagerPoolSize=getAsIntegerOrDefault(conf,EAGER_POOL_SIZE,100);
  eagerLinearSliceWidht=getAsIntegerOrDefault(conf,EAGER_LINEAR_SLICE_WIDHT,1000);
  eagerLinearSliceDelta=getAsIntegerOrDefault(conf,EAGER_LINEAR_SLICE_DELTA,100);
  eagerLinearSliceHeights=getAsArrayOfInts(conf,EAGER_LINEAR_HEIGHTS,new int[]{4,2,1});
  eagerRndSliceMinWidht=getAsIntegerOrDefault(conf,EAGER_RND_SLICE_MIN_WIDHT,1000);
  eagerRndMaxCursors=getAsIntegerOrDefault(conf,EAGER_RND_MAX_CURSORS,50);
  authTokenEnabled=getAsBooleanOrDefault(conf,AUTH_TOKEN_ENABLED,true);
  authTokenTtl=getAsIntegerOrDefault(conf,AUTH_TOKEN_TTL,15);
}