Program: 31953
Project: 31953
Buggy source:
@SuppressWarnings("String_Node_Str") public Tuple exec(Tuple input) throws IOException {
  if (input == null || input.size() == 0) {
    return null;
  }
  final String rawTag=input.get(tagColumnNum).toString();
  if (!super.tagSet.contains(rawTag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str")) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1);
    }
    return null;
  }
  if (!this.isForClean) {
    boolean isNotSampled=DataSampler.isNotSampled(modelConfig.isRegression(),super.tagSet,super.posTagSet,super.negTagSet,modelConfig.getNormalizeSampleRate(),modelConfig.isNormalizeSampleNegOnly(),rawTag);
    if (isNotSampled) {
      return null;
    }
  }
  Tuple tuple=TupleFactory.getInstance().newTuple();
  final NormType normType=modelConfig.getNormalizeType();
  for (int i=0; i < input.size(); i++) {
    ColumnConfig config=columnConfigList.get(i);
    String val=(input.get(i) == null) ? "String_Node_Str" : input.get(i).toString().trim();
    if (weightExpr != null) {
      weightContext.set(config.getColumnName(),val);
    }
    if (tagColumnNum == i) {
      if (modelConfig.isRegression()) {
        int type=0;
        if (super.posTagSet.contains(rawTag)) {
          type=1;
        }
 else         if (super.negTagSet.contains(rawTag)) {
          type=0;
        }
 else {
          log.error("String_Node_Str" + rawTag);
          warn("String_Node_Str" + rawTag,WarnInNormalizeUDF.INVALID_TAG);
          return null;
        }
        tuple.append(type);
      }
 else {
        int index=-1;
        for (int j=0; j < tags.size(); j++) {
          Set<String> tagSet=tags.get(j);
          if (tagSet.contains(rawTag)) {
            index=j;
            break;
          }
        }
        if (index == -1) {
          log.error("String_Node_Str" + rawTag);
          return null;
        }
        tuple.append(index);
      }
      continue;
    }
    if (this.isForClean) {
      if (config.isCategorical()) {
        int index=config.getBinCategory().indexOf(val);
        if (index == -1) {
          tuple.append("String_Node_Str");
        }
 else {
          tuple.append(val);
        }
      }
 else {
        Double normVal=0d;
        try {
          normVal=Double.parseDouble(val);
        }
 catch (        Exception e) {
          log.debug("String_Node_Str" + val + "String_Node_Str");
          normVal=Normalizer.defaultMissingValue(config);
        }
        tuple.append(df.format(normVal));
      }
    }
 else {
      if (!CommonUtils.isGoodCandidate(modelConfig.isRegression(),config)) {
        if (config.isMeta()) {
          tuple.append(val);
        }
 else {
          tuple.append(null);
        }
      }
 else {
        Double normVal=Normalizer.normalize(config,val,cutoff,normType);
        tuple.append(df.format(normVal));
      }
    }
  }
  double weight=evaluateWeight(weightExpr,weightContext);
  tuple.append(weight);
  return tuple;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public Tuple exec(Tuple input) throws IOException {
  if (input == null || input.size() == 0) {
    return null;
  }
  final String rawTag=input.get(tagColumnNum).toString();
  if (!super.tagSet.contains(rawTag)) {
    if (isPigEnabled(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str")) {
      PigStatusReporter.getInstance().getCounter(Constants.SHIFU_GROUP_COUNTER,"String_Node_Str").increment(1);
    }
    return null;
  }
  if (!this.isForClean) {
    boolean isNotSampled=DataSampler.isNotSampled(modelConfig.isRegression(),super.tagSet,super.posTagSet,super.negTagSet,modelConfig.getNormalizeSampleRate(),modelConfig.isNormalizeSampleNegOnly(),rawTag);
    if (isNotSampled) {
      return null;
    }
  }
  Tuple tuple=TupleFactory.getInstance().newTuple();
  final NormType normType=modelConfig.getNormalizeType();
  for (int i=0; i < input.size(); i++) {
    ColumnConfig config=columnConfigList.get(i);
    String val=(input.get(i) == null) ? "String_Node_Str" : input.get(i).toString().trim();
    if (weightExpr != null) {
      weightContext.set(config.getColumnName(),val);
    }
    if (tagColumnNum == i) {
      if (modelConfig.isRegression()) {
        int type=0;
        if (super.posTagSet.contains(rawTag)) {
          type=1;
        }
 else         if (super.negTagSet.contains(rawTag)) {
          type=0;
        }
 else {
          log.error("String_Node_Str" + rawTag);
          warn("String_Node_Str" + rawTag,WarnInNormalizeUDF.INVALID_TAG);
          return null;
        }
        tuple.append(type);
      }
 else {
        int index=-1;
        for (int j=0; j < tags.size(); j++) {
          Set<String> tagSet=tags.get(j);
          if (tagSet.contains(rawTag)) {
            index=j;
            break;
          }
        }
        if (index == -1) {
          log.error("String_Node_Str" + rawTag);
          return null;
        }
        tuple.append(index);
      }
      continue;
    }
    if (this.isForClean) {
      if (config.isCategorical()) {
        if (config.getBinCategory() != null) {
          int index=config.getBinCategory().indexOf(val);
          if (index == -1) {
            tuple.append("String_Node_Str");
          }
 else {
            tuple.append(val);
          }
        }
 else {
          tuple.append(val);
        }
      }
 else {
        Double normVal=0d;
        try {
          normVal=Double.parseDouble(val);
        }
 catch (        Exception e) {
          log.debug("String_Node_Str" + val + "String_Node_Str");
          normVal=Normalizer.defaultMissingValue(config);
        }
        tuple.append(df.format(normVal));
      }
    }
 else {
      if (!CommonUtils.isGoodCandidate(modelConfig.isRegression(),config)) {
        if (config.isMeta()) {
          tuple.append(val);
        }
 else {
          tuple.append(null);
        }
      }
 else {
        Double normVal=Normalizer.normalize(config,val,cutoff,normType);
        tuple.append(df.format(normVal));
      }
    }
  }
  double weight=evaluateWeight(weightExpr,weightContext);
  tuple.append(weight);
  return tuple;
}