Program: 82239
Project: 82239
Buggy source:
public static TableContext create(TableDescriptor tableDescriptor){
  if (tableDescriptor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  String name=tableDescriptor.getName();
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  String tableUri=tableDescriptor.getTableUri();
  if (tableUri == null) {
    throw new NullPointerException("String_Node_Str");
  }
  TableContext tableContext=_cache.get(name);
  if (tableContext != null) {
    return tableContext;
  }
  LOG.info("String_Node_Str",name);
  Configuration configuration=getSystemConfiguration();
  BlurConfiguration blurConfiguration=getSystemBlurConfiguration();
  Map<String,String> tableProperties=tableDescriptor.getTableProperties();
  if (tableProperties != null) {
    for (    Entry<String,String> prop : tableProperties.entrySet()) {
      configuration.set(prop.getKey(),prop.getValue());
      blurConfiguration.set(prop.getKey(),prop.getValue());
    }
  }
  tableContext=new TableContext();
  tableContext._configuration=configuration;
  tableContext._blurConfiguration=blurConfiguration;
  tableContext._tablePath=new Path(tableUri);
  tableContext._walTablePath=new Path(tableContext._tablePath,LOGS);
  tableContext._defaultFieldName=SUPER;
  tableContext._table=name;
  tableContext._descriptor=tableDescriptor;
  tableContext._timeBetweenCommits=configuration.getLong(BLUR_SHARD_TIME_BETWEEN_COMMITS,60000);
  tableContext._timeBetweenRefreshs=configuration.getLong(BLUR_SHARD_TIME_BETWEEN_REFRESHS,5000);
  tableContext._defaultPrimeDocTerm=new Term(BlurConstants.PRIME_DOC,BlurConstants.PRIME_DOC_VALUE);
  tableContext._defaultScoreType=ScoreType.SUPER;
  boolean strict=tableDescriptor.isStrictTypes();
  String defaultMissingFieldType=tableDescriptor.getDefaultMissingFieldType();
  boolean defaultMissingFieldLessIndexing=tableDescriptor.isDefaultMissingFieldLessIndexing();
  Map<String,String> defaultMissingFieldProps=emptyIfNull(tableDescriptor.getDefaultMissingFieldProps());
  Path storagePath=new Path(tableContext._tablePath,TYPES);
  try {
    HdfsFieldManager hdfsFieldManager=new HdfsFieldManager(SUPER,new NoStopWordStandardAnalyzer(),storagePath,configuration,strict,defaultMissingFieldType,defaultMissingFieldLessIndexing,defaultMissingFieldProps);
    loadCustomTypes(tableContext,blurConfiguration,hdfsFieldManager);
    hdfsFieldManager.loadFromStorage();
    tableContext._fieldManager=hdfsFieldManager;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  Class<?> c1=configuration.getClass(BLUR_SHARD_INDEX_DELETION_POLICY_MAXAGE,KeepOnlyLastCommitDeletionPolicy.class);
  tableContext._indexDeletionPolicy=(IndexDeletionPolicy)configure(ReflectionUtils.newInstance(c1,configuration),tableContext);
  Class<?> c2=configuration.getClass(BLUR_SHARD_INDEX_SIMILARITY,FairSimilarity.class);
  tableContext._similarity=(Similarity)configure(ReflectionUtils.newInstance(c2,configuration),tableContext);
  String readInterceptorClass=blurConfiguration.get(BLUR_SHARD_READ_INTERCEPTOR);
  if (readInterceptorClass == null || readInterceptorClass.trim().isEmpty()) {
    tableContext._readInterceptor=DEFAULT_INTERCEPTOR;
  }
 else {
    try {
      @SuppressWarnings("String_Node_Str") Class<? extends ReadInterceptor> clazz=(Class<? extends ReadInterceptor>)Class.forName(readInterceptorClass);
      Constructor<? extends ReadInterceptor> constructor=clazz.getConstructor(new Class[]{BlurConfiguration.class});
      tableContext._readInterceptor=constructor.newInstance(blurConfiguration);
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
  tableContext._similarity=(Similarity)configure(ReflectionUtils.newInstance(c2,configuration),tableContext);
  _cache.put(name,tableContext);
  return tableContext;
}

Fixed version (ground truth):
public static TableContext create(TableDescriptor tableDescriptor){
  if (tableDescriptor == null) {
    throw new NullPointerException("String_Node_Str");
  }
  String name=tableDescriptor.getName();
  if (name == null) {
    throw new NullPointerException("String_Node_Str");
  }
  String tableUri=tableDescriptor.getTableUri();
  if (tableUri == null) {
    throw new NullPointerException("String_Node_Str");
  }
  TableContext tableContext=_cache.get(name);
  if (tableContext != null) {
    TableDescriptor newTd=new TableDescriptor(tableDescriptor);
    TableContext clone=tableContext.clone();
    clone._descriptor=newTd;
    return clone;
  }
  LOG.info("String_Node_Str",name);
  Configuration configuration=getSystemConfiguration();
  BlurConfiguration blurConfiguration=getSystemBlurConfiguration();
  Map<String,String> tableProperties=tableDescriptor.getTableProperties();
  if (tableProperties != null) {
    for (    Entry<String,String> prop : tableProperties.entrySet()) {
      configuration.set(prop.getKey(),prop.getValue());
      blurConfiguration.set(prop.getKey(),prop.getValue());
    }
  }
  tableContext=new TableContext();
  tableContext._configuration=configuration;
  tableContext._blurConfiguration=blurConfiguration;
  tableContext._tablePath=new Path(tableUri);
  tableContext._walTablePath=new Path(tableContext._tablePath,LOGS);
  tableContext._defaultFieldName=SUPER;
  tableContext._table=name;
  tableContext._descriptor=tableDescriptor;
  tableContext._timeBetweenCommits=configuration.getLong(BLUR_SHARD_TIME_BETWEEN_COMMITS,60000);
  tableContext._timeBetweenRefreshs=configuration.getLong(BLUR_SHARD_TIME_BETWEEN_REFRESHS,5000);
  tableContext._defaultPrimeDocTerm=new Term(BlurConstants.PRIME_DOC,BlurConstants.PRIME_DOC_VALUE);
  tableContext._defaultScoreType=ScoreType.SUPER;
  boolean strict=tableDescriptor.isStrictTypes();
  String defaultMissingFieldType=tableDescriptor.getDefaultMissingFieldType();
  boolean defaultMissingFieldLessIndexing=tableDescriptor.isDefaultMissingFieldLessIndexing();
  Map<String,String> defaultMissingFieldProps=emptyIfNull(tableDescriptor.getDefaultMissingFieldProps());
  Path storagePath=new Path(tableContext._tablePath,TYPES);
  try {
    HdfsFieldManager hdfsFieldManager=new HdfsFieldManager(SUPER,new NoStopWordStandardAnalyzer(),storagePath,configuration,strict,defaultMissingFieldType,defaultMissingFieldLessIndexing,defaultMissingFieldProps);
    loadCustomTypes(tableContext,blurConfiguration,hdfsFieldManager);
    hdfsFieldManager.loadFromStorage();
    tableContext._fieldManager=hdfsFieldManager;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
  Class<?> c1=configuration.getClass(BLUR_SHARD_INDEX_DELETION_POLICY_MAXAGE,KeepOnlyLastCommitDeletionPolicy.class);
  tableContext._indexDeletionPolicy=(IndexDeletionPolicy)configure(ReflectionUtils.newInstance(c1,configuration),tableContext);
  Class<?> c2=configuration.getClass(BLUR_SHARD_INDEX_SIMILARITY,FairSimilarity.class);
  tableContext._similarity=(Similarity)configure(ReflectionUtils.newInstance(c2,configuration),tableContext);
  String readInterceptorClass=blurConfiguration.get(BLUR_SHARD_READ_INTERCEPTOR);
  if (readInterceptorClass == null || readInterceptorClass.trim().isEmpty()) {
    tableContext._readInterceptor=DEFAULT_INTERCEPTOR;
  }
 else {
    try {
      @SuppressWarnings("String_Node_Str") Class<? extends ReadInterceptor> clazz=(Class<? extends ReadInterceptor>)Class.forName(readInterceptorClass);
      Constructor<? extends ReadInterceptor> constructor=clazz.getConstructor(new Class[]{BlurConfiguration.class});
      tableContext._readInterceptor=constructor.newInstance(blurConfiguration);
    }
 catch (    Exception e) {
      throw new RuntimeException(e);
    }
  }
  tableContext._similarity=(Similarity)configure(ReflectionUtils.newInstance(c2,configuration),tableContext);
  _cache.put(name,tableContext);
  return tableContext.clone();
}