Program: 69328
Project: 69328
Buggy source:
/** 
 * 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 {
  LineAttributes liaTicks=ax.getMajorGrid().getTickAttributes();
  liaTicks=ax.getMinorGrid().getTickAttributes();
  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 {
  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()));
    }
  }
}