Program: 187120
Project: 187120
Buggy source:
private static void visualizeWithTextArea(RenderedImage ri,String title,final int textFields,final int index,final boolean displayImage){
  StringBuffer sb=new StringBuffer();
switch (textFields) {
case TextType.ONLY_IMAGE_METADATA:
    sb.append("String_Node_Str").append(title);
  break;
case TextType.ONLY_STREAM_METADATA:
sb.append("String_Node_Str");
break;
case TextType.STREAM_AND_IMAGE_METADATA:
sb.append("String_Node_Str").append(title);
break;
case TextType.PROJECT_AND_GEOTRANSF:
sb.append("String_Node_Str").append(title);
break;
case TextType.EVERYTHING:
sb.append("String_Node_Str").append(title);
break;
}
final JFrame frame=new JFrame(title);
frame.getContentPane().setLayout(new BorderLayout());
String textPosition=BorderLayout.PAGE_START;
if (displayImage) {
frame.getContentPane().add(new ScrollingImagePanel(ri,1024,768));
textPosition=BorderLayout.LINE_START;
}
JLabel label=new JLabel(sb.toString());
frame.getContentPane().add(label,textPosition);
JTextArea textArea=new JTextArea();
if (textFields == TextType.PROJECT_AND_GEOTRANSF) textArea.setText(buildCRSProperties(ri,index));
 else if (textFields != TextType.EVERYTHING) textArea.setText(buildMetadataText(ri,textFields,index));
 else textArea.setText(new StringBuffer(buildMetadataText(ri,textFields,index).toString()).append(newLine).append(buildCRSProperties(ri,index)).toString());
textArea.setEditable(false);
frame.getContentPane().add(textArea);
frame.getContentPane().add(new JScrollPane(textArea),BorderLayout.PAGE_END);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SwingUtilities.invokeLater(new Runnable(){
public void run(){
frame.pack();
frame.setSize(1024,768);
frame.setVisible(true);
}
}
);
}

Fixed version (ground truth):
private static void visualizeWithTextArea(RenderedImage ri,String title,final int textFields,final int index,final boolean displayImage){
  StringBuffer sb=new StringBuffer();
switch (textFields) {
case TextType.ONLY_IMAGE_METADATA:
    sb.append("String_Node_Str").append(title);
  break;
case TextType.ONLY_STREAM_METADATA:
sb.append("String_Node_Str");
break;
case TextType.STREAM_AND_IMAGE_METADATA:
sb.append("String_Node_Str").append(title);
break;
case TextType.PROJECT_AND_GEOTRANSF:
sb.append("String_Node_Str").append(title);
break;
case TextType.EVERYTHING:
sb.append("String_Node_Str").append(title);
break;
}
final JFrame frame=new JFrame(title);
frame.getContentPane().setLayout(new BorderLayout());
String textPosition=BorderLayout.PAGE_START;
if (displayImage) {
frame.getContentPane().add(new ScrollingImagePanel(ri,640,480));
textPosition=BorderLayout.LINE_START;
}
JLabel label=new JLabel(sb.toString());
frame.getContentPane().add(label,textPosition);
JTextArea textArea=new JTextArea();
if (textFields == TextType.PROJECT_AND_GEOTRANSF) textArea.setText(buildCRSProperties(ri,index));
 else if (textFields != TextType.EVERYTHING) textArea.setText(buildMetadataText(ri,textFields,index));
 else textArea.setText(new StringBuffer(buildMetadataText(ri,textFields,index).toString()).append(newLine).append(buildCRSProperties(ri,index)).toString());
textArea.setEditable(false);
frame.getContentPane().add(textArea);
frame.getContentPane().add(new JScrollPane(textArea),BorderLayout.PAGE_END);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SwingUtilities.invokeLater(new Runnable(){
public void run(){
frame.pack();
frame.setSize(1024,768);
frame.setVisible(true);
}
}
);
}