Program: 71467
Project: 71467
Buggy source:
/** 
 * This method validates several crucial properties for an axis associated with a Chart
 * @param ax The axis to validate
 * @throws ValidationException
 */
protected void validateAxis(Axis ax) throws ChartException {
  if (!ax.isSetType()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.getLabel().isSetVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.getTitle().isSetVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.isSetLabelPosition() && ax.getLabel().isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.isSetTitlePosition() && ax.getTitle().isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  LineAttributes liaTicks=ax.getMajorGrid().getTickAttributes();
  if (!ax.getMajorGrid().isSetTickStyle() && liaTicks.isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  liaTicks=ax.getMinorGrid().getTickAttributes();
  if (!ax.getMinorGrid().isSetTickStyle() && liaTicks.isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  final int iOrientation=ax.getOrientation().getValue();
  if (iOrientation == Orientation.VERTICAL) {
    int iPosition=-1;
    if (ax.getLabel().isVisible()) {
      iPosition=ax.getLabelPosition().getValue();
      if (iPosition != Position.LEFT && iPosition != Position.RIGHT) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    if (ax.getTitle().isVisible()) {
      iPosition=ax.getTitlePosition().getValue();
      if (iPosition != Position.LEFT && iPosition != Position.RIGHT) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    int iTickStyle=ax.getMajorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.LEFT && iTickStyle != TickStyle.RIGHT) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMajorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
    iTickStyle=ax.getMinorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.LEFT && iTickStyle != TickStyle.RIGHT) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMinorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
 else   if (iOrientation == Orientation.HORIZONTAL) {
    int iPosition=-1;
    if (ax.getLabel().isVisible()) {
      iPosition=ax.getLabelPosition().getValue();
      if (iPosition != Position.ABOVE && iPosition != Position.BELOW) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    if (ax.getTitle().isVisible()) {
      iPosition=ax.getTitlePosition().getValue();
      if (iPosition != Position.ABOVE && iPosition != Position.BELOW) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getTitlePosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    int iTickStyle=ax.getMajorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.ABOVE && iTickStyle != TickStyle.BELOW) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMajorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
    iTickStyle=ax.getMinorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.ABOVE && iTickStyle != TickStyle.BELOW) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMinorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}

Fixed version (ground truth):
/** 
 * This method validates several crucial properties for an axis associated with a Chart
 * @param ax The axis to validate
 * @throws ChartException
 */
protected void validateAxis(Axis ax) throws ChartException {
  if (!ax.isSetType()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.getLabel().isSetVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.getTitle().isSetVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.isSetLabelPosition() && ax.getLabel().isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  if (!ax.isSetTitlePosition() && ax.getTitle().isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  LineAttributes liaTicks=ax.getMajorGrid().getTickAttributes();
  if (!ax.getMajorGrid().isSetTickStyle() && liaTicks.isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  liaTicks=ax.getMinorGrid().getTickAttributes();
  if (!ax.getMinorGrid().isSetTickStyle() && liaTicks.isVisible()) {
    throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,new ChartException(ChartEnginePlugin.ID,ChartException.UNDEFINED_VALUE,"String_Node_Str",new Object[]{ax},Messages.getResourceBundle(rtc.getULocale())));
  }
  final int iOrientation=ax.getOrientation().getValue();
  if (iOrientation == Orientation.VERTICAL) {
    int iPosition=-1;
    if (ax.getLabel().isVisible()) {
      iPosition=ax.getLabelPosition().getValue();
      if (iPosition != Position.LEFT && iPosition != Position.RIGHT) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    if (ax.getTitle().isVisible()) {
      iPosition=ax.getTitlePosition().getValue();
      if (iPosition != Position.LEFT && iPosition != Position.RIGHT) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    int iTickStyle=ax.getMajorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.LEFT && iTickStyle != TickStyle.RIGHT) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMajorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
    iTickStyle=ax.getMinorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.LEFT && iTickStyle != TickStyle.RIGHT) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMinorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
 else   if (iOrientation == Orientation.HORIZONTAL) {
    int iPosition=-1;
    if (ax.getLabel().isVisible()) {
      iPosition=ax.getLabelPosition().getValue();
      if (iPosition != Position.ABOVE && iPosition != Position.BELOW) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getLabelPosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    if (ax.getTitle().isVisible()) {
      iPosition=ax.getTitlePosition().getValue();
      if (iPosition != Position.ABOVE && iPosition != Position.BELOW) {
        throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getTitlePosition().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
      }
    }
    int iTickStyle=ax.getMajorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.ABOVE && iTickStyle != TickStyle.BELOW) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMajorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
    iTickStyle=ax.getMinorGrid().getTickStyle().getValue();
    if (iTickStyle != TickStyle.ACROSS && iTickStyle != TickStyle.ABOVE && iTickStyle != TickStyle.BELOW) {
      throw new ChartException(ChartEnginePlugin.ID,ChartException.VALIDATION,"String_Node_Str",new Object[]{ax.getMinorGrid().getTickStyle().getName(),ax},Messages.getResourceBundle(rtc.getULocale()));
    }
  }
}