Program: 185227
Project: 185227
Buggy source:
/** 
 * Setup the mouse position x,y label that will be positioned at the top of the plot. 
 */
private void setupXYDisplay(){
  pointerXYValueLabel.setSize((int)pointerXYValueLabel.getPreferredSize().getWidth(),(int)pointerXYValueLabel.getPreferredSize().getHeight());
  pointerXYValueLabel.setFont(parentPlot.timeAxisFont);
  pointerXYValueLabel.setForeground(PlotConstants.DATA_CURSOR_COLOR);
  pointerXYValueLabel.attach(parentPlot.plotView);
  if (parentPlot.axisOrientation == AxisOrientationSetting.X_AXIS_AS_TIME) {
    MessageFormat format=new MessageFormat("String_Node_Str" + HTML_WHITESPACES + "String_Node_Str");
    format.setFormatByArgumentIndex(0,dateFormat);
    format.setFormatByArgumentIndex(1,PlotConstants.SCIENTIFIC_FORMAT);
    pointerXYValueLabel.setFormat(format);
  }
 else {
    MessageFormat format=new MessageFormat("String_Node_Str" + HTML_WHITESPACES + "String_Node_Str");
    format.setFormatByArgumentIndex(0,PlotConstants.SCIENTIFIC_FORMAT);
    format.setFormatByArgumentIndex(1,dateFormat);
    pointerXYValueLabel.setFormat(format);
  }
  pointerXYValueLabel.setText("String_Node_Str");
  Dimension size=pointerXYValueLabel.getPreferredSize();
  size.width=100;
  pointerXYValueLabel.setText("String_Node_Str");
  pointerXYValueLabel.setPreferredSize(size);
  XYPlot plot=parentPlot.plotView;
  XYPlotContents contents=plot.getContents();
  plot.add(pointerXYValueLabel);
  plot.add(timeSystemFormattedLabel);
  SpringLayout layout2=(SpringLayout)plot.getLayout();
  layout2.putConstraint(SpringLayout.NORTH,pointerXYValueLabel,0,SpringLayout.NORTH,plot);
  layout2.putConstraint(SpringLayout.WEST,pointerXYValueLabel,0,SpringLayout.WEST,contents);
  layout2.putConstraint(SpringLayout.WEST,timeSystemFormattedLabel,0,SpringLayout.WEST,contents);
  layout2.putConstraint(SpringLayout.NORTH,timeSystemFormattedLabel,0,SpringLayout.NORTH,plot);
  layout2.putConstraint(SpringLayout.WEST,pointerXYValueLabel,10,SpringLayout.EAST,timeSystemFormattedLabel);
  layout2.putConstraint(SpringLayout.NORTH,contents,0,SpringLayout.SOUTH,pointerXYValueLabel);
  layout2.putConstraint(SpringLayout.NORTH,contents,0,SpringLayout.SOUTH,timeSystemFormattedLabel);
  plot.getYAxis().setEndMargin(pointerXYValueLabel.getPreferredSize().height);
  plot.getYAxis().setEndMargin(timeSystemFormattedLabel.getPreferredSize().height);
}

Fixed version (ground truth):
/** 
 * Setup the mouse position x,y label that will be positioned at the top of the plot. 
 */
private void setupXYDisplay(){
  pointerXYValueLabel.setSize((int)pointerXYValueLabel.getPreferredSize().getWidth(),(int)pointerXYValueLabel.getPreferredSize().getHeight());
  pointerXYValueLabel.setFont(parentPlot.timeAxisFont);
  pointerXYValueLabel.setForeground(PlotConstants.DATA_CURSOR_COLOR);
  pointerXYValueLabel.attach(parentPlot.plotView);
  if (parentPlot.axisOrientation == AxisOrientationSetting.X_AXIS_AS_TIME) {
    MessageFormat format=new MessageFormat("String_Node_Str" + HTML_WHITESPACES + "String_Node_Str");
    format.setFormatByArgumentIndex(0,dateFormat);
    format.setFormatByArgumentIndex(1,PlotConstants.SCIENTIFIC_FORMAT);
    pointerXYValueLabel.setFormat(format);
  }
 else {
    MessageFormat format=new MessageFormat("String_Node_Str" + HTML_WHITESPACES + "String_Node_Str");
    format.setFormatByArgumentIndex(0,PlotConstants.SCIENTIFIC_FORMAT);
    format.setFormatByArgumentIndex(1,dateFormat);
    pointerXYValueLabel.setFormat(format);
  }
  pointerXYValueLabel.setText("String_Node_Str");
  Dimension size=pointerXYValueLabel.getPreferredSize();
  size.width=100;
  pointerXYValueLabel.setText("String_Node_Str");
  pointerXYValueLabel.setPreferredSize(size);
  XYPlot plot=parentPlot.plotView;
  XYPlotContents contents=plot.getContents();
  plot.add(pointerXYValueLabel);
  plot.add(timeSystemFormattedLabel);
  SpringLayout layout2=(SpringLayout)plot.getLayout();
  layout2.putConstraint(SpringLayout.NORTH,pointerXYValueLabel,0,SpringLayout.NORTH,plot);
  layout2.putConstraint(SpringLayout.WEST,pointerXYValueLabel,0,SpringLayout.WEST,contents);
  layout2.putConstraint(SpringLayout.WEST,timeSystemFormattedLabel,0,SpringLayout.WEST,contents);
  layout2.putConstraint(SpringLayout.NORTH,timeSystemFormattedLabel,0,SpringLayout.NORTH,plot);
  layout2.putConstraint(SpringLayout.WEST,pointerXYValueLabel,10,SpringLayout.EAST,timeSystemFormattedLabel);
  JComponent top=(pointerXYValueLabel.getPreferredSize().height > timeSystemFormattedLabel.getPreferredSize().height) ? pointerXYValueLabel : timeSystemFormattedLabel;
  layout2.putConstraint(SpringLayout.NORTH,contents,0,SpringLayout.SOUTH,top);
  plot.getYAxis().setEndMargin(top.getPreferredSize().height);
}