Program: 64443
Project: 64443
Buggy source:
/** 
 * getVotes extension of the instance method getVotesForInstance  in moa.classifier.java returns the prediction of the instance.
 */
public ErrorWeightedVoteMultiLabel getVotes(MultiLabelInstance instance){
  ErrorWeightedVoteMultiLabel errorWeightedVote=newErrorWeightedVote();
  VerboseToConsole(instance);
  for (  MultiLabelRule rule : ruleSet) {
    if (rule.isCovering(instance) == true) {
      Prediction vote=rule.getPredictionForInstance(instance);
      if (vote != null) {
        double[] errors=rule.getCurrentErrors();
        if (errors == null)         errors=defaultRuleErrors(vote);
        debug("String_Node_Str" + rule.getRuleNumberID() + "String_Node_Str"+ vote.toString()+ "String_Node_Str"+ errors+ "String_Node_Str"+ instance.classValue(),3);
        errorWeightedVote.addVote(vote,errors);
      }
      if (!this.unorderedRulesOption.isSet()) {
        break;
      }
    }
  }
  if (!errorWeightedVote.coversAllOutputs()) {
    Prediction vote=errorWeightedVote.getPrediction();
    if (vote == null) {
      vote=new MultiLabelPrediction(instance.numberOutputTargets());
    }
    Prediction defaultVote=defaultRule.getPredictionForInstance(instance);
    if (defaultVote != null) {
      double[] defaultErrors=defaultRule.getCurrentErrors();
      double[] fixErrors=new double[vote.numOutputAttributes()];
      Prediction fixVote=new MultiLabelPrediction(vote.numOutputAttributes());
      for (int i=0; i < vote.numOutputAttributes(); i++) {
        if (!vote.hasVotesForAttribute(i)) {
          fixVote.setVotes(i,defaultVote.getVotes(i));
        }
      }
      errorWeightedVote.addVote(fixVote,fixErrors);
      debug("String_Node_Str" + defaultVote.toString() + "String_Node_Str"+ defaultErrors+ "String_Node_Str"+ instance,3);
    }
  }
  errorWeightedVote.computeWeightedVote();
  return errorWeightedVote;
}

Fixed version (ground truth):
/** 
 * getVotes extension of the instance method getVotesForInstance  in moa.classifier.java returns the prediction of the instance.
 */
public ErrorWeightedVoteMultiLabel getVotes(MultiLabelInstance instance){
  ErrorWeightedVoteMultiLabel errorWeightedVote=newErrorWeightedVote();
  VerboseToConsole(instance);
  for (  MultiLabelRule rule : ruleSet) {
    if (rule.isCovering(instance) == true) {
      Prediction vote=rule.getPredictionForInstance(instance);
      if (vote != null) {
        double[] errors=rule.getCurrentErrors();
        if (errors == null)         errors=defaultRuleErrors(vote);
        debug("String_Node_Str" + rule.getRuleNumberID() + "String_Node_Str"+ vote.toString()+ "String_Node_Str"+ errors+ "String_Node_Str"+ instance.classValue(),3);
        errorWeightedVote.addVote(vote,errors);
      }
      if (!this.unorderedRulesOption.isSet()) {
        break;
      }
    }
  }
  if (!errorWeightedVote.coversAllOutputs()) {
    Prediction vote=errorWeightedVote.getPrediction();
    if (vote == null) {
      vote=new MultiLabelPrediction(instance.numberOutputTargets());
    }
    Prediction defaultVote=defaultRule.getPredictionForInstance(instance);
    if (defaultVote != null) {
      double[] defaultErrors=defaultRule.getCurrentErrors();
      if (defaultErrors == null)       defaultErrors=defaultRuleErrors(defaultVote);
      double[] fixErrors=new double[vote.numOutputAttributes()];
      Prediction fixVote=new MultiLabelPrediction(vote.numOutputAttributes());
      for (int i=0; i < vote.numOutputAttributes(); i++) {
        if (!vote.hasVotesForAttribute(i)) {
          fixVote.setVotes(i,defaultVote.getVotes(i));
          fixErrors[i]=defaultErrors[i];
        }
      }
      errorWeightedVote.addVote(fixVote,fixErrors);
      debug("String_Node_Str" + defaultVote.toString() + "String_Node_Str"+ defaultErrors+ "String_Node_Str"+ instance,3);
    }
  }
  errorWeightedVote.computeWeightedVote();
  return errorWeightedVote;
}