nus-yam/ex-repair huggingface dataset:
Program: 185138
Project: 185138
Buggy source:
/** 
 * Gets the value of the val property.
 * @return possible object is {@link String }
 */
public byte[] getVal(){
  return val;
}

Fixed version (ground truth):
/** 
 * Gets the value of the val property.
 * @return possible object is {@link String }
 */
public String getVal(){
  return val;
}
Program: 185139
Project: 185139
Buggy source:
/** 
 * Sets the value of the val property.
 * @param value allowed object is {@link String }
 */
public void setVal(byte[] value){
  this.val=((byte[])value);
}

Fixed version (ground truth):
/** 
 * Sets the value of the val property.
 * @param value allowed object is {@link String }
 */
public void setVal(String value){
  this.val=value;
}
Program: 185140
Project: 185140
Buggy source:
public void saveRawXmlPart(ZipOutputStream out,Part part) throws Docx4JException {
  String partName=part.getPartName().getName().substring(1);
  if (part instanceof org.docx4j.openpackaging.parts.JaxbXmlPart) {
    try {
      ((org.docx4j.openpackaging.parts.JaxbXmlPart)part).marshal(out);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else   if (part instanceof org.docx4j.openpackaging.parts.Dom4jXmlPart) {
    try {
      out.putNextEntry(new ZipEntry(partName));
      OutputFormat format=OutputFormat.createPrettyPrint();
      format.setEncoding("String_Node_Str");
      XMLWriter writer=new XMLWriter(out,format);
      writer.write(((org.docx4j.openpackaging.parts.Dom4jXmlPart)part).getDocument());
      out.closeEntry();
      log.info("String_Node_Str" + partName);
    }
 catch (    Exception e) {
      e.printStackTrace();
      throw new Docx4JException("String_Node_Str" + partName,e);
    }
  }
 else {
    log.error("String_Node_Str" + partName);
  }
}

Fixed version (ground truth):
public void saveRawXmlPart(ZipOutputStream out,Part part) throws Docx4JException {
  String partName=part.getPartName().getName().substring(1);
  if (part instanceof org.docx4j.openpackaging.parts.JaxbXmlPart) {
    try {
      out.putNextEntry(new ZipEntry(partName));
      ((org.docx4j.openpackaging.parts.JaxbXmlPart)part).marshal(out);
      out.closeEntry();
      log.info("String_Node_Str" + partName);
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
 else   if (part instanceof org.docx4j.openpackaging.parts.Dom4jXmlPart) {
    try {
      out.putNextEntry(new ZipEntry(partName));
      OutputFormat format=OutputFormat.createPrettyPrint();
      format.setEncoding("String_Node_Str");
      XMLWriter writer=new XMLWriter(out,format);
      writer.write(((org.docx4j.openpackaging.parts.Dom4jXmlPart)part).getDocument());
      out.closeEntry();
      log.info("String_Node_Str" + partName);
    }
 catch (    Exception e) {
      e.printStackTrace();
      throw new Docx4JException("String_Node_Str" + partName,e);
    }
  }
 else {
    log.error("String_Node_Str" + partName);
  }
}
Program: 185141
Project: 185141
Buggy source:
/** 
 * Get the text content of all runs in the P 
 */
public String toString(){
  StringBuilder result=new StringBuilder();
  List<Object> children=getParagraphContent();
  for (  Object o : children) {
    System.out.println("String_Node_Str" + o.getClass().getName());
    if (o instanceof org.docx4j.jaxb.document.R) {
      org.docx4j.jaxb.document.R run=(org.docx4j.jaxb.document.R)o;
      List<Object> runContent=run.getRunContent();
      for (      Object o2 : runContent) {
        if (o instanceof javax.xml.bind.JAXBElement) {
          if (((JAXBElement)o).getDeclaredType().getName().equals("String_Node_Str")) {
            org.docx4j.jaxb.document.Text t=(org.docx4j.jaxb.document.Text)((JAXBElement)o).getValue();
            result.append(t.getValue());
          }
        }
      }
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Get the text content of all runs in the P 
 */
public String toString(){
  StringBuilder result=new StringBuilder();
  List<Object> children=getParagraphContent();
  for (  Object o : children) {
    if (o instanceof org.docx4j.jaxb.document.R) {
      org.docx4j.jaxb.document.R run=(org.docx4j.jaxb.document.R)o;
      List<Object> runContent=run.getRunContent();
      for (      Object o2 : runContent) {
        if (o2 instanceof javax.xml.bind.JAXBElement) {
          if (((JAXBElement)o2).getDeclaredType().getName().equals("String_Node_Str")) {
            org.docx4j.jaxb.document.Text t=(org.docx4j.jaxb.document.Text)((JAXBElement)o2).getValue();
            result.append(t.getValue());
          }
        }
 else {
        }
      }
    }
  }
  return result.toString();
}
Program: 185143
Project: 185143
Buggy source:
@Override public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  ComponentInfo ci=(ComponentInfo)value;
  JLabel label=(JLabel)super.getListCellRendererComponent(list,ci.name,index,isSelected,cellHasFocus);
  label.setIcon(AbstractComponent.getIconForComponentType(ci.type));
  return label;
}

Fixed version (ground truth):
@Override public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
  ComponentInfo ci=(ComponentInfo)value;
  JLabel label=(JLabel)super.getListCellRendererComponent(list,ci.name,index,isSelected,cellHasFocus);
  label.setIcon(getIconForComponentType(ci.type));
  return label;
}
Program: 185144
Project: 185144
Buggy source:
@Test public void testComponentTypeInfos(){
  boolean foundGraphicalComponent=false;
  for (  ComponentTypeInfo info : provider.getComponentTypes()) {
    if (info.getComponentClass().equals(GraphicalComponent.class)) {
      foundGraphicalComponent=true;
      Assert.assertTrue(info.isCreatable());
      Assert.assertTrue(info.getWizardUI() instanceof GraphicalComponentWizardUI);
    }
  }
  Assert.assertTrue(foundGraphicalComponent);
}

Fixed version (ground truth):
@Test public void testComponentTypeInfos(){
  boolean foundGraphicalComponent=false;
  for (  ComponentTypeInfo info : provider.getComponentTypes()) {
    if (info.getComponentClass().equals(GraphicalComponent.class)) {
      foundGraphicalComponent=true;
      Assert.assertTrue(info.isCreatable());
    }
  }
  Assert.assertTrue(foundGraphicalComponent);
}
Program: 185145
Project: 185145
Buggy source:
@Test public void testPolicyInfos(){
  boolean foundPolicy=false;
  for (  PolicyInfo info : provider.getPolicyInfos()) {
    for (    Class c : info.getPolicyClasses()) {
      if (c.equals(GraphicalViewPolicy.class)) {
        foundPolicy=true;
        Assert.assertEquals(info.getCategoryKey(),PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey());
      }
    }
  }
  Assert.assertTrue(foundPolicy);
}

Fixed version (ground truth):
@Test public void testPolicyInfos(){
  boolean foundPolicy=false;
  for (  PolicyInfo info : provider.getPolicyInfos()) {
    for (    Class<?> c : info.getPolicyClasses()) {
      if (c.equals(GraphicalViewPolicy.class)) {
        foundPolicy=true;
        Assert.assertEquals(info.getCategoryKey(),PolicyInfo.CategoryType.FILTER_VIEW_ROLE.getKey());
      }
    }
  }
  Assert.assertTrue(foundPolicy);
}
Program: 185146
Project: 185146
Buggy source:
@Test public void testViews(){
  Collection<ViewInfo> views=evaluatorProvider.getViews(EvaluatorComponent.class.getName());
  Assert.assertEquals(views.size(),3);
  Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"String_Node_Str",ViewType.CENTER)));
  Iterator<ViewInfo> it=evaluatorProvider.getViews(EvaluatorComponent.class.getName()).iterator();
  Assert.assertEquals(it.next(),new ViewInfo(InfoViewManifestation.class,"String_Node_Str",ViewType.CENTER));
  Assert.assertEquals(it.next(),new ViewInfo(ExpressionsViewManifestation.class,"String_Node_Str",ViewType.CENTER));
  views=multiProvider.getViews(MultiComponent.class.getName());
  Assert.assertEquals(views.size(),3);
  Assert.assertTrue(views.contains(new ViewInfo(MultiViewManifestation.class,"String_Node_Str",ViewType.CENTER)));
  it=multiProvider.getViews(MultiComponent.class.getName()).iterator();
  Assert.assertEquals(it.next(),new ViewInfo(InfoViewManifestation.class,InfoViewManifestation.VIEW_NAME,InfoViewManifestation.class.getName(),ViewType.OBJECT,null,null,false,MultiComponent.class));
  Assert.assertEquals(it.next(),new ViewInfo(MultiViewManifestation.class,MultiViewManifestation.VIEW_NAME,ViewType.OBJECT));
  Assert.assertEquals(it.next(),new ViewInfo(MultiViewManifestation.class,MultiViewManifestation.VIEW_NAME,InfoViewManifestation.class.getName(),ViewType.CENTER,null,null,true,MultiComponent.class));
}

Fixed version (ground truth):
@Test public void testViews(){
  Collection<ViewInfo> views=evaluatorProvider.getViews(EvaluatorComponent.class.getName());
  Assert.assertEquals(views.size(),3);
  Assert.assertTrue(views.contains(new ViewInfo(ExpressionsViewManifestation.class,"String_Node_Str",ViewType.CENTER)));
  Iterator<ViewInfo> it=evaluatorProvider.getViews(EvaluatorComponent.class.getName()).iterator();
  Assert.assertEquals(it.next(),new ViewInfo(InfoViewManifestation.class,"String_Node_Str",ViewType.CENTER));
  Assert.assertEquals(it.next(),new ViewInfo(ExpressionsViewManifestation.class,"String_Node_Str",ViewType.CENTER));
  views=multiProvider.getViews(MultiComponent.class.getName());
  Assert.assertEquals(views.size(),3);
  Assert.assertTrue(views.contains(new ViewInfo(MultiViewManifestation.class,"String_Node_Str",ViewType.CENTER)));
  it=multiProvider.getViews(MultiComponent.class.getName()).iterator();
  Assert.assertEquals(it.next(),new ViewInfo(InfoViewManifestation.class,InfoViewManifestation.VIEW_NAME,InfoViewManifestation.class.getName(),ViewType.OBJECT));
  Assert.assertEquals(it.next(),new ViewInfo(MultiViewManifestation.class,MultiViewManifestation.VIEW_NAME,ViewType.OBJECT));
  Assert.assertEquals(it.next(),new ViewInfo(MultiViewManifestation.class,MultiViewManifestation.VIEW_NAME,InfoViewManifestation.class.getName(),ViewType.CENTER));
}
Program: 185147
Project: 185147
Buggy source:
/** 
 * Get an asset of a specified type. For instance, an  Icon may be retrieved using getAsset(Icon.class).
 * @param assetClass the desired type of asset
 * @return an asset of the desired type (or null if there is none)
 */
public <T>T getAsset(Class<T> assetClass){
  return getCapability(ComponentTypeInfo.class).getAsset(assetClass);
}

Fixed version (ground truth):
/** 
 * Get an asset of a specified type. For instance, an  Icon may be retrieved using getAsset(Icon.class).
 * @param < T > the type of asset desired
 * @param assetClass the desired type of asset
 * @return an asset of the desired type (or null if there is none)
 */
public <T>T getAsset(Class<T> assetClass){
  return getCapability(ComponentTypeInfo.class).getAsset(assetClass);
}
Program: 185148
Project: 185148
Buggy source:
public ProviderDelegateService getProviderDelegateService();

Fixed version (ground truth):
/** 
 * Provides an instance of the provider delegate service
 * @return the provider delegate service
 */
public ProviderDelegateService getProviderDelegateService();
Program: 185149
Project: 185149
Buggy source:
/** 
 * Get some asset associated with a given object type. Typically this will be used to obtain  things like icons or create wizards which are associated with specific component or view  types, but are not incorporated into those types directly to preserve separation of  concerns. 
 * @param objectType the type with which the requested asset is associated
 * @param assetClass the type of the requested asset
 * @return an asset of the requested type (or null, if none is provided)
 */
<T>T getAsset(TypeInfo<?> objectType,Class<T> assetClass);

Fixed version (ground truth):
/** 
 * Get some asset associated with a given object type. Typically this will be used to obtain  things like icons or create wizards which are associated with specific component or view  types, but are not incorporated into those types directly to preserve separation of  concerns. 
 * @param < T > the type of asset desired
 * @param objectType the type with which the requested asset is associated
 * @param assetClass the type of the requested asset
 * @return an asset of the requested type (or null, if none is provided)
 */
<T>T getAsset(TypeInfo<?> objectType,Class<T> assetClass);
Program: 185150
Project: 185150
Buggy source:
/** 
 * Get an asset associated with this type. For instance, getAsset(ImageIcon.class) to get  an icon.
 * @param assetClass the type of asset desired
 * @return an object of the desired type (or null if none is available)
 */
public <A>A getAsset(Class<A> assetClass){
  return PlatformAccess.getPlatform().getComponentRegistry().getAsset(this,assetClass);
}

Fixed version (ground truth):
/** 
 * Get an asset associated with this type. For instance, getAsset(ImageIcon.class) to get  an icon.
 * @param assetClass the type of asset desired
 * @param < A > the type of asset desired
 * @return an object of the desired type (or null if none is available)
 */
public <A>A getAsset(Class<A> assetClass){
  return PlatformAccess.getPlatform().getComponentRegistry().getAsset(this,assetClass);
}
Program: 185151
Project: 185151
Buggy source:
/** 
 * Get an asset of a specific type, associated with some other type.  For instance, this can be used to obtain an Icon  for a specific component or view class.
 * @param objectType the type with which the asset is associated
 * @param assetClass the type of the desired asset
 * @return an asset of the desired type (or null if none is available)
 */
public <T>T getAsset(TypeInfo<?> objectType,Class<T> assetClass);

Fixed version (ground truth):
/** 
 * Get an asset of a specific type, associated with some other type.  For instance, this can be used to obtain an Icon  for a specific component or view class.
 * @param < T > the type of asset desired
 * @param objectType the type with which the asset is associated
 * @param assetClass the type of the desired asset
 * @return an asset of the desired type (or null if none is available)
 */
public <T>T getAsset(TypeInfo<?> objectType,Class<T> assetClass);
Program: 185152
Project: 185152
Buggy source:
private JComboBox createOwnerField(){
  List<String> usersAndRoles=new ArrayList<String>();
  usersAndRoles.addAll(Arrays.asList(RoleAccess.getAllRoles()));
  usersAndRoles.addAll(Arrays.asList(RoleAccess.getAllUsers()));
  final JComboBox comboBox=new JComboBox(usersAndRoles.toArray());
  comboBox.setSelectedItem(getManifestedComponent().getOwner());
  return comboBox;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private JComboBox createOwnerField(){
  List<String> usersAndRoles=new ArrayList<String>();
  usersAndRoles.addAll(Arrays.asList(RoleAccess.getAllRoles()));
  usersAndRoles.addAll(Arrays.asList(RoleAccess.getAllUsers()));
  @SuppressWarnings("String_Node_Str") final JComboBox comboBox=new JComboBox(usersAndRoles.toArray());
  comboBox.setSelectedItem(getManifestedComponent().getOwner());
  return comboBox;
}
Program: 185153
Project: 185153
Buggy source:
private void populateVisualComponent(JComponent component,PropertyDescriptor p){
  Object newValue=null;
switch (p.getVisualControlDescriptor()) {
case Label:
{
      ((JLabel)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
      break;
    }
case TextField:
{
    ((JTextField)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
    break;
  }
case CheckBox:
{
  ((JCheckBox)component).setSelected((Boolean)(newValue=p.getPropertyEditor().getValue()));
  break;
}
case ComboBox:
{
((JComboBox)component).getModel().setSelectedItem(newValue=p.getPropertyEditor().getValue());
break;
}
case TextArea:
{
((JTextArea)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
break;
}
}
extendedFieldCache.put(component,newValue);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private void populateVisualComponent(JComponent component,PropertyDescriptor p){
  Object newValue=null;
switch (p.getVisualControlDescriptor()) {
case Label:
{
      ((JLabel)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
      break;
    }
case TextField:
{
    ((JTextField)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
    break;
  }
case CheckBox:
{
  ((JCheckBox)component).setSelected((Boolean)(newValue=p.getPropertyEditor().getValue()));
  break;
}
case ComboBox:
{
((JComboBox)component).getModel().setSelectedItem(newValue=p.getPropertyEditor().getValue());
break;
}
case TextArea:
{
((JTextArea)component).setText((String)(newValue=p.getPropertyEditor().getAsText()));
break;
}
}
extendedFieldCache.put(component,newValue);
}
Program: 185154
Project: 185154
Buggy source:
@Override public void enterLockedState(){
  boolean allowEdit=checkAllowComponentRenamePolicy();
  displayName.setFocusable(allowEdit);
  if (allowEdit) {
    displayName.setEnabled(true);
    displayName.setEditable(true);
  }
 else {
    displayName.setEnabled(false);
    displayName.setDisabledTextColor(fgUIColor);
  }
  boolean canChangeUser=RoleAccess.canChangeOwner(getManifestedComponent(),currentUser);
  owner.setFocusable(canChangeUser);
  owner.setEnabled(canChangeUser);
  if (!canChangeUser) {
    owner.setRenderer(new DefaultListCellRenderer(){
      public void paint(      Graphics g){
        setBackground(bgUIColor);
        setForeground(fgUIColor);
        super.paint(g);
      }
    }
);
  }
  addExtendedContent();
  for (  JComponent jComponent : extendedFieldCache.keySet()) {
    jComponent.setFocusable(true);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void enterLockedState(){
  boolean allowEdit=checkAllowComponentRenamePolicy();
  displayName.setFocusable(allowEdit);
  if (allowEdit) {
    displayName.setEnabled(true);
    displayName.setEditable(true);
  }
 else {
    displayName.setEnabled(false);
    displayName.setDisabledTextColor(fgUIColor);
  }
  boolean canChangeUser=RoleAccess.canChangeOwner(getManifestedComponent(),currentUser);
  owner.setFocusable(canChangeUser);
  owner.setEnabled(canChangeUser);
  if (!canChangeUser) {
    owner.setRenderer(new DefaultListCellRenderer(){
      public void paint(      Graphics g){
        setBackground(bgUIColor);
        setForeground(fgUIColor);
        super.paint(g);
      }
    }
);
  }
  addExtendedContent();
  for (  JComponent jComponent : extendedFieldCache.keySet()) {
    jComponent.setFocusable(true);
  }
}
Program: 185155
Project: 185155
Buggy source:
@Override public void exitLockedState(){
  boolean allowEdit=checkAllowComponentRenamePolicy();
  displayName.setFocusable(allowEdit);
  displayName.setEnabled(allowEdit);
  displayName.setEditable(allowEdit);
  owner.setFocusable(false);
  owner.setEnabled(false);
  owner.setRenderer(new DefaultListCellRenderer(){
    public void paint(    Graphics g){
      setBackground(bgUIColor);
      setForeground(fgUIColor);
      super.paint(g);
    }
  }
);
  addExtendedContent();
  for (  JComponent jComponent : extendedFieldCache.keySet()) {
    jComponent.setFocusable(false);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override public void exitLockedState(){
  boolean allowEdit=checkAllowComponentRenamePolicy();
  displayName.setFocusable(allowEdit);
  displayName.setEnabled(allowEdit);
  displayName.setEditable(allowEdit);
  owner.setFocusable(false);
  owner.setEnabled(false);
  owner.setRenderer(new DefaultListCellRenderer(){
    public void paint(    Graphics g){
      setBackground(bgUIColor);
      setForeground(fgUIColor);
      super.paint(g);
    }
  }
);
  addExtendedContent();
  for (  JComponent jComponent : extendedFieldCache.keySet()) {
    jComponent.setFocusable(false);
  }
}
Program: 185156
Project: 185156
Buggy source:
private JPanel buildWarningPanel(Set<String> componentsToBeDeleted){
  List<String> deleteComps=new ArrayList<String>(componentsToBeDeleted.size());
  for (  String comp : componentsToBeDeleted) {
    deleteComps.add(AbstractComponent.getComponentById(comp).getDisplayName());
  }
  JPanel warning=new JPanel(new FlowLayout());
  warning.setPreferredSize(new Dimension(400,400));
  JList deleteList=new JList(deleteComps.toArray());
  JScrollPane scrollPane2=new JScrollPane(deleteList);
  scrollPane2.setPreferredSize(new Dimension(300,200));
  JLabel deletingObjectsLabel=new JLabel(bundle.getString("String_Node_Str"));
  deletingObjectsLabel.setPreferredSize(new Dimension(300,20));
  deletingObjectsLabel.setVerticalAlignment(SwingConstants.BOTTOM);
  deletingObjectsLabel.setHorizontalAlignment(SwingConstants.LEFT);
  JTextArea warningMessage=new JTextArea(bundle.getString("String_Node_Str"));
  warningMessage.setWrapStyleWord(true);
  warningMessage.setLineWrap(true);
  warningMessage.setOpaque(false);
  warningMessage.setPreferredSize(new Dimension(300,200));
  warningMessage.setEditable(false);
  warning.add(warningMessage);
  warning.add(deletingObjectsLabel);
  warning.add(scrollPane2);
  return warning;
}

Fixed version (ground truth):
private JPanel buildWarningPanel(Set<String> componentsToBeDeleted){
  List<String> deleteComps=new ArrayList<String>(componentsToBeDeleted.size());
  for (  String comp : componentsToBeDeleted) {
    deleteComps.add(AbstractComponent.getComponentById(comp).getDisplayName());
  }
  JPanel warning=new JPanel(new FlowLayout());
  warning.setPreferredSize(new Dimension(400,400));
  @SuppressWarnings({"String_Node_Str","String_Node_Str"}) JList deleteList=new JList(deleteComps.toArray());
  JScrollPane scrollPane2=new JScrollPane(deleteList);
  scrollPane2.setPreferredSize(new Dimension(300,200));
  JLabel deletingObjectsLabel=new JLabel(bundle.getString("String_Node_Str"));
  deletingObjectsLabel.setPreferredSize(new Dimension(300,20));
  deletingObjectsLabel.setVerticalAlignment(SwingConstants.BOTTOM);
  deletingObjectsLabel.setHorizontalAlignment(SwingConstants.LEFT);
  JTextArea warningMessage=new JTextArea(bundle.getString("String_Node_Str"));
  warningMessage.setWrapStyleWord(true);
  warningMessage.setLineWrap(true);
  warningMessage.setOpaque(false);
  warningMessage.setPreferredSize(new Dimension(300,200));
  warningMessage.setEditable(false);
  warning.add(warningMessage);
  warning.add(deletingObjectsLabel);
  warning.add(scrollPane2);
  return warning;
}
Program: 185158
Project: 185158
Buggy source:
@Test public void testCreateManifestation(){
  ImageIcon icon=new ImageIcon();
  ExtendedComponentProvider extendedProvider=new ExtendedComponentProvider(mockProvider,"String_Node_Str");
  ComponentTypeInfo info=new ComponentTypeInfo("String_Node_Str","String_Node_Str",MockComponent.class,null,icon);
  Mockito.when(mockProvider.getComponentTypes()).thenReturn(Collections.singleton(info));
  ExternalComponentRegistryImpl.getInstance().refreshComponents(Collections.singletonList(extendedProvider));
  Assert.assertSame(component.getIcon(),info.getIcon());
  ExternalComponentRegistryImpl.getInstance().refreshComponents(Collections.<ExtendedComponentProvider>emptyList());
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Test public void testCreateManifestation(){
  ImageIcon icon=new ImageIcon();
  ExtendedComponentProvider extendedProvider=new ExtendedComponentProvider(mockProvider,"String_Node_Str");
  ComponentTypeInfo info=new ComponentTypeInfo("String_Node_Str","String_Node_Str",MockComponent.class,null,icon);
  Mockito.when(mockProvider.getComponentTypes()).thenReturn(Collections.singleton(info));
  ExternalComponentRegistryImpl.getInstance().refreshComponents(Collections.singletonList(extendedProvider));
  Assert.assertSame(component.getIcon(),info.getIcon());
  ExternalComponentRegistryImpl.getInstance().refreshComponents(Collections.<ExtendedComponentProvider>emptyList());
}
Program: 185159
Project: 185159
Buggy source:
private PropertyDescriptor buildMockDescriptor(VisualControlDescriptor vcd){
  PropertyDescriptor mockDescriptor=Mockito.mock(PropertyDescriptor.class);
  PropertyEditor mockEditor=Mockito.mock(PropertyEditor.class);
  Mockito.when(mockDescriptor.getShortDescription()).thenReturn("String_Node_Str");
  Mockito.when(mockDescriptor.getVisualControlDescriptor()).thenReturn(vcd);
  Mockito.when(mockDescriptor.getPropertyEditor()).thenReturn(mockEditor);
  Mockito.when(mockDescriptor.isFieldMutable()).thenReturn(true);
  Mockito.when(mockEditor.getTags()).thenReturn(Arrays.asList("String_Node_Str","String_Node_Str"));
  Mockito.when(mockEditor.getAsText()).thenReturn("String_Node_Str");
  Mockito.when(mockEditor.getValue()).thenReturn(vcd != VisualControlDescriptor.CheckBox ? "String_Node_Str" : Boolean.TRUE);
  return mockDescriptor;
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private PropertyDescriptor buildMockDescriptor(VisualControlDescriptor vcd){
  PropertyDescriptor mockDescriptor=Mockito.mock(PropertyDescriptor.class);
  PropertyEditor mockEditor=Mockito.mock(PropertyEditor.class);
  Mockito.when(mockDescriptor.getShortDescription()).thenReturn("String_Node_Str");
  Mockito.when(mockDescriptor.getVisualControlDescriptor()).thenReturn(vcd);
  Mockito.when(mockDescriptor.getPropertyEditor()).thenReturn(mockEditor);
  Mockito.when(mockDescriptor.isFieldMutable()).thenReturn(true);
  Mockito.when(mockEditor.getTags()).thenReturn(Arrays.asList("String_Node_Str","String_Node_Str"));
  Mockito.when(mockEditor.getAsText()).thenReturn("String_Node_Str");
  Mockito.when(mockEditor.getValue()).thenReturn(vcd != VisualControlDescriptor.CheckBox ? "String_Node_Str" : Boolean.TRUE);
  return mockDescriptor;
}
Program: 185161
Project: 185161
Buggy source:
/** 
 * Set the view housed within this view
 * @param viewInfo the type of view to create
 * @return true if the view was changed; otherwise false 
 */
public boolean setHousedViewManifestation(ViewInfo viewInfo);

Fixed version (ground truth):
/** 
 * Set the view housed within this view.
 * @param viewInfo the type of view to create
 * @return true if the view was changed; otherwise false 
 */
public boolean setHousedViewManifestation(ViewInfo viewInfo);
Program: 185162
Project: 185162
Buggy source:
private void updateLinePlotFromSettings(){
  int index=lineSettings.getColorIndex();
  Color c=PlotLineColorPalette.getColor(index);
  setForeground(c);
  Stroke s=linePlot.getStroke();
  if (s == null || s instanceof BasicStroke) {
    int t=lineSettings.getThickness();
    linePlot.setStroke(t == 1 ? null : new BasicStroke(t));
    originalPlotLineStroke=linePlot.getStroke();
  }
  if (linePlot.getPointIcon() != null) {
    Shape shape=null;
    if (lineSettings.getUseCharacter()) {
      Graphics g=(Graphics)getGraphics();
      if (g != null && g instanceof Graphics2D) {
        FontRenderContext frc=((Graphics2D)g).getFontRenderContext();
        shape=PlotLineShapePalette.getShape(lineSettings.getCharacter(),frc);
      }
    }
 else {
      int marker=lineSettings.getMarker();
      shape=PlotLineShapePalette.getShape(marker);
    }
    if (shape != null) {
      linePlot.setPointIcon(new PlotMarkerIcon(shape));
      baseDisplayNameLabel.setIcon(new PlotMarkerIcon(shape,false,12,12));
    }
  }
  linePlot.repaint();
  repaint();
}

Fixed version (ground truth):
private void updateLinePlotFromSettings(){
  int index=lineSettings.getColorIndex();
  Color c=PlotLineColorPalette.getColor(index);
  setForeground(c);
  Stroke s=linePlot.getStroke();
  if (s == null || s instanceof BasicStroke) {
    int t=lineSettings.getThickness();
    linePlot.setStroke(t == 1 ? null : new BasicStroke(t));
    originalPlotLineStroke=linePlot.getStroke();
  }
  if (linePlot.getPointIcon() != null) {
    Shape shape=null;
    if (lineSettings.getUseCharacter()) {
      Graphics g=getGraphics();
      if (g != null && g instanceof Graphics2D) {
        FontRenderContext frc=((Graphics2D)g).getFontRenderContext();
        shape=PlotLineShapePalette.getShape(lineSettings.getCharacter(),frc);
      }
    }
 else {
      int marker=lineSettings.getMarker();
      shape=PlotLineShapePalette.getShape(marker);
    }
    if (shape != null) {
      linePlot.setPointIcon(new PlotMarkerIcon(shape));
      baseDisplayNameLabel.setIcon(new PlotMarkerIcon(shape,false,12,12));
    }
  }
  linePlot.repaint();
  repaint();
}
Program: 185163
Project: 185163
Buggy source:
/** 
 * Get per-line settings currently in use for this stack of plots. Each element of the returned list corresponds,  in order, to the sub-plots displayed, and maps subscription ID to a  LineSettings object describing how its plot line should be drawn.
 * @return a list of subscription->setting mappings for this plot
 */
public List<Map<String,LineSettings>> getLineSettings(){
  List<Map<String,LineSettings>> settingsAssignments=new ArrayList<Map<String,LineSettings>>();
  for (int subPlotIndex=0; subPlotIndex < subPlots.size(); subPlotIndex++) {
    Map<String,LineSettings> settingsMap=new HashMap<String,LineSettings>();
    settingsAssignments.add(settingsMap);
    AbstractPlottingPackage plot=(AbstractPlottingPackage)subPlots.get(subPlotIndex);
    for (    LegendEntry entry : plot.getLegendManager().getLegendEntryList()) {
      settingsMap.put(entry.getDataSetName(),entry.getLineSettings());
    }
  }
  return settingsAssignments;
}

Fixed version (ground truth):
/** 
 * Get per-line settings currently in use for this stack of plots. Each element of the returned list corresponds,  in order, to the sub-plots displayed, and maps subscription ID to a  LineSettings object describing how its plot line should be drawn.
 * @return a list of subscription->setting mappings for this plot
 */
public List<Map<String,LineSettings>> getLineSettings(){
  List<Map<String,LineSettings>> settingsAssignments=new ArrayList<Map<String,LineSettings>>();
  for (int subPlotIndex=0; subPlotIndex < subPlots.size(); subPlotIndex++) {
    Map<String,LineSettings> settingsMap=new HashMap<String,LineSettings>();
    settingsAssignments.add(settingsMap);
    AbstractPlottingPackage plot=subPlots.get(subPlotIndex);
    for (    LegendEntry entry : plot.getLegendManager().getLegendEntryList()) {
      settingsMap.put(entry.getDataSetName(),entry.getLineSettings());
    }
  }
  return settingsAssignments;
}
Program: 185164
Project: 185164
Buggy source:
/** 
 * Set line settings for use in this stack of plots. Each element corresponds, in order, to the sub-plots displayed, and maps  subscription ID to the line settings described by a LineSettings object
 * @param lineSettings a list of subscription->line setting mappings for this plot
 */
public void setLineSettings(List<Map<String,LineSettings>> lineSettings){
  if (lineSettings != null) {
    for (int subPlotIndex=0; subPlotIndex < lineSettings.size() && subPlotIndex < subPlots.size(); subPlotIndex++) {
      AbstractPlottingPackage plot=(AbstractPlottingPackage)subPlots.get(subPlotIndex);
      for (      Entry<String,LineSettings> entry : lineSettings.get(subPlotIndex).entrySet()) {
        AbstractPlotDataSeries series=plot.getPlotDataManager().getNamedDataSeries(entry.getKey());
        if (series != null) {
          AbstractLegendEntry legendEntry=series.getLegendEntry();
          if (legendEntry instanceof LegendEntry) {
            ((LegendEntry)legendEntry).setLineSettings(entry.getValue());
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Set line settings for use in this stack of plots. Each element corresponds, in order, to the sub-plots displayed, and maps  subscription ID to the line settings described by a LineSettings object
 * @param lineSettings a list of subscription->line setting mappings for this plot
 */
public void setLineSettings(List<Map<String,LineSettings>> lineSettings){
  if (lineSettings != null) {
    for (int subPlotIndex=0; subPlotIndex < lineSettings.size() && subPlotIndex < subPlots.size(); subPlotIndex++) {
      AbstractPlottingPackage plot=subPlots.get(subPlotIndex);
      for (      Entry<String,LineSettings> entry : lineSettings.get(subPlotIndex).entrySet()) {
        AbstractPlotDataSeries series=plot.getPlotDataManager().getNamedDataSeries(entry.getKey());
        if (series != null) {
          AbstractLegendEntry legendEntry=series.getLegendEntry();
          if (legendEntry instanceof LegendEntry) {
            ((LegendEntry)legendEntry).setLineSettings(entry.getValue());
          }
        }
      }
    }
  }
}
Program: 185165
Project: 185165
Buggy source:
/** 
 * Adds the popup menus to plot legend entry.
 */
public void addPopupMenus(){
  LegendEntryPopupMenuFactory popupManager=new LegendEntryPopupMenuFactory(plotUser);
  for (int index=0; index < subPlots.size(); index++) {
    AbstractPlottingPackage plot=(AbstractPlottingPackage)subPlots.get(index);
    for (    LegendEntry entry : plot.getLegendManager().getLegendEntryList()) {
      entry.setPopup(popupManager);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds the popup menus to plot legend entry.
 */
public void addPopupMenus(){
  LegendEntryPopupMenuFactory popupManager=new LegendEntryPopupMenuFactory(plotUser);
  for (int index=0; index < subPlots.size(); index++) {
    AbstractPlottingPackage plot=subPlots.get(index);
    for (    LegendEntry entry : plot.getLegendManager().getLegendEntryList()) {
      entry.setPopup(popupManager);
    }
  }
}
Program: 185166
Project: 185166
Buggy source:
public void updateFrom(PlotViewManifestation view){
  if (temporal) {
    minControls.updateCurrent(getActualMinimum(view));
    maxControls.updateCurrent(getActualMaximum(view));
    minControls.updateAuto((double)view.getCurrentMCTTime());
    maxControls.updateAuto((double)getValue(minControls) + spanControls.getSpanValue());
    if (!maxControls.auto.isSelected()) {
      spanControls.setSpanValue(getValue(maxControls) - getValue(minControls));
    }
  }
 else {
    minControls.currentValue.setValue(getActualMinimum(view));
    maxControls.currentValue.setValue(getActualMaximum(view));
  }
}

Fixed version (ground truth):
public void updateFrom(PlotViewManifestation view){
  if (temporal) {
    minControls.updateCurrent(getActualMinimum(view));
    maxControls.updateCurrent(getActualMaximum(view));
    minControls.updateAuto((double)view.getCurrentMCTTime());
    maxControls.updateAuto(getValue(minControls) + spanControls.getSpanValue());
    if (!maxControls.auto.isSelected()) {
      spanControls.setSpanValue(getValue(maxControls) - getValue(minControls));
    }
  }
 else {
    minControls.currentValue.setValue(getActualMinimum(view));
    maxControls.currentValue.setValue(getActualMaximum(view));
  }
}
Program: 185167
Project: 185167
Buggy source:
/** 
 * Set the selection for this group. Note that this will be considered  the "clean" selection - user changes will flag this as dirty.
 * @param object
 */
public void setSelection(T object){
  this.selection=(T)object;
  ItemWrapper<T> w=items.get(object);
  if (w == null)   return;
  comboBox.removeActionListener(this);
  comboBox.setSelectedItem(w);
  comboBox.addActionListener(this);
}

Fixed version (ground truth):
/** 
 * Set the selection for this group. Note that this will be considered  the "clean" selection - user changes will flag this as dirty.
 * @param object
 */
public void setSelection(T object){
  this.selection=object;
  ItemWrapper<T> w=items.get(object);
  if (w == null)   return;
  comboBox.removeActionListener(this);
  comboBox.setSelectedItem(w);
  comboBox.addActionListener(this);
}
Program: 185168
Project: 185168
Buggy source:
public String[] getTimeSystemChoices(){
  Set<String> s=plotDataAssigner.getTimeSystemChoices();
  return (String[])s.toArray(new String[s.size()]);
}

Fixed version (ground truth):
public String[] getTimeSystemChoices(){
  Set<String> s=plotDataAssigner.getTimeSystemChoices();
  return s.toArray(new String[s.size()]);
}
Program: 185169
Project: 185169
Buggy source:
public String[] getTimeFormatChoices(){
  Set<String> s=plotDataAssigner.getTimeFormatChoices();
  return (String[])s.toArray(new String[s.size()]);
}

Fixed version (ground truth):
public String[] getTimeFormatChoices(){
  Set<String> s=plotDataAssigner.getTimeFormatChoices();
  return s.toArray(new String[s.size()]);
}
Program: 185170
Project: 185170
Buggy source:
private Font updateBaseFont(int style){
  baseFont=label.getFont().deriveFont(9f).deriveFont(style);
  Map attrs=baseFont.getAttributes();
  attrs.put(TextAttribute.STRIKETHROUGH,TextAttribute.STRIKETHROUGH_ON);
  strikeThroughFont=baseFont.deriveFont(attrs);
  return baseFont;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private Font updateBaseFont(int style){
  baseFont=label.getFont().deriveFont(9f).deriveFont(style);
  @SuppressWarnings("String_Node_Str") Map attrs=baseFont.getAttributes();
  attrs.put(TextAttribute.STRIKETHROUGH,TextAttribute.STRIKETHROUGH_ON);
  strikeThroughFont=baseFont.deriveFont(attrs);
  return baseFont;
}
Program: 185172
Project: 185172
Buggy source:
/** 
 * Prompts users to commit or abort pending changes in view.
 * @param view the modified view
 * @param dialogMessage the dialog message which differs from where the view is located (in the center or inspector pane)
 * @return true to keep the window open, false to close the window
 */
private boolean commitOrAbortPendingChanges(View view,String dialogMessage){
  if (!isComponentWriteableByUser(view.getManifestedComponent()))   return true;
  Object[] options={BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str")};
  int answer=OptionBox.showOptionDialog(view,dialogMessage,BUNDLE.getString("String_Node_Str"),OptionBox.YES_NO_CANCEL_OPTION,OptionBox.WARNING_MESSAGE,null,options,options[0]);
switch (answer) {
case OptionBox.CANCEL_OPTION:
    return false;
case OptionBox.YES_OPTION:
  PlatformAccess.getPlatform().getPersistenceProvider().persist(Collections.singleton(view.getManifestedComponent()));
default :
return true;
}
}

Fixed version (ground truth):
/** 
 * Prompts users to commit or abort pending changes in view.
 * @param view the modified view
 * @param dialogMessage the dialog message which differs from where the view is located (in the center or inspector pane)
 * @return true to keep the window open, false to close the window
 */
private boolean commitOrAbortPendingChanges(View view,String dialogMessage){
  if (!isComponentWriteableByUser(view.getManifestedComponent()))   return true;
  Object[] options={BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str"),BUNDLE.getString("String_Node_Str")};
  int answer=OptionBox.showOptionDialog(view,dialogMessage,BUNDLE.getString("String_Node_Str"),OptionBox.YES_NO_CANCEL_OPTION,OptionBox.WARNING_MESSAGE,null,options,options[0]);
switch (answer) {
case OptionBox.CANCEL_OPTION:
    return false;
case OptionBox.YES_OPTION:
  PlatformAccess.getPlatform().getPersistenceProvider().persist(Collections.singleton(view.getManifestedComponent()));
return true;
default :
return true;
}
}
Program: 185173
Project: 185173
Buggy source:
public PlotSettingsControlArea(PlotViewManifestation managedView){
  setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  add(new SectionPanel("String_Node_Str",new PlotBehaviorPanel()));
  add(new SectionPanel("String_Node_Str",new LineSetupPanel()));
}

Fixed version (ground truth):
public PlotSettingsControlArea(PlotViewManifestation managedView){
  setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  add(new SectionPanel("String_Node_Str",new PlotSetupControlPanel(managedView)));
  add(new SectionPanel("String_Node_Str",new PlotBehaviorPanel()));
  add(new SectionPanel("String_Node_Str",new LineSetupPanel()));
}
Program: 185175
Project: 185175
Buggy source:
@Override public int getDataSetSize(){
  return knownDataSeries.size();
}

Fixed version (ground truth):
@Override public int getDataSetSize(){
  return plotDataManager.size();
}
Program: 185178
Project: 185178
Buggy source:
@Override public void addDataSet(String dataSetName,Color plottingColor){
  if (!dataSetName.contains(PlotConstants.NON_TIME_FEED_SEPARATOR)) {
    beginGroup(dataSetName);
  }
 else {
    String dataSetNames[]=dataSetName.split(PlotConstants.NON_TIME_FEED_SEPARATOR);
    dataSeriesMap.put(dataSetName,new HashMap<String,ScatterPlotDataSeries>());
    LegendEntry legendEntry=new LegendEntry(PlotConstants.LEGEND_BACKGROUND_COLOR,plottingColor,PlotConstants.DEFAULT_TIME_AXIS_FONT,scatterPlot.getPlotLabelingAlgorithm());
    ScatterPlotDataSeries dataSeries=new ScatterPlotDataSeries(scatterPlot,getDataMap(dataSetNames[0]),getDataMap(dataSetNames[1]),legendEntry);
    dataSeriesMap.get(dataSetNames[0]).put(dataSetNames[1],dataSeries);
    addToDataSeriesList(dataSetNames[0],dataSeries);
    addToDataSeriesList(dataSetNames[1],dataSeries);
  }
}

Fixed version (ground truth):
@Override public void addDataSet(String dataSetName,Color plottingColor){
  if (!dataSetName.contains(PlotConstants.NON_TIME_FEED_SEPARATOR)) {
    beginGroup(dataSetName);
  }
 else {
    System.out.println(dataSetName);
    String dataSetNames[]=dataSetName.split(PlotConstants.NON_TIME_FEED_SEPARATOR);
    dataSeriesMap.put(dataSetName,new HashMap<String,ScatterPlotDataSeries>());
    LegendEntry legendEntry=new LegendEntry(PlotConstants.LEGEND_BACKGROUND_COLOR,plottingColor,PlotConstants.DEFAULT_TIME_AXIS_FONT,scatterPlot.getPlotLabelingAlgorithm());
    ScatterPlotDataSeries dataSeries=new ScatterPlotDataSeries(scatterPlot,getDataMap(dataSetNames[0]),getDataMap(dataSetNames[1]),legendEntry);
    dataSeriesMap.get(dataSetNames[0]).put(dataSetNames[1],dataSeries);
    addToDataSeriesList(dataSetNames[0],dataSeries);
    addToDataSeriesList(dataSetNames[1],dataSeries);
  }
}
Program: 185179
Project: 185179
Buggy source:
@Override public void addData(String feed,SortedMap<Long,Double> points){
  SortedMap<Long,Double> target=getDataMap(feed);
  for (  Entry<Long,Double> point : points.entrySet()) {
    target.put(point.getKey(),point.getValue());
  }
  if (dataSeriesList.containsKey(feed)) {
    for (    ScatterPlotDataSeries series : dataSeriesList.get(feed)) {
      series.updatePlotLine();
    }
  }
  clearBefore(scatterPlot.getCurrentTimeAxisMin().getTimeInMillis());
}

Fixed version (ground truth):
@Override public void addData(String feed,SortedMap<Long,Double> points){
  List<Long> timestamps=new ArrayList<Long>();
  SortedMap<Long,Double> target=getDataMap(feed);
  for (  Entry<Long,Double> point : points.entrySet()) {
    target.put(point.getKey(),point.getValue());
  }
  if (dataSeriesList.containsKey(feed)) {
    for (    ScatterPlotDataSeries series : dataSeriesList.get(feed)) {
      series.updatePlotLine();
    }
  }
  clearBefore(scatterPlot.getCurrentTimeAxisMin().getTimeInMillis());
}
Program: 185180
Project: 185180
Buggy source:
public void updatePlotLine(){
  for (  Entry<Long,Double> entry : dependent.entrySet()) {
    long t=entry.getKey();
    if (t > lastUpdate) {
      if (independent.containsKey(t)) {
        double depValue=entry.getValue();
        double indValue=independent.get(t);
        plotLine.addData(indValue,depValue);
        timestamps.add(t);
      }
      lastUpdate=t;
    }
  }
}

Fixed version (ground truth):
public void updatePlotLine(){
  for (  Entry<Long,Double> entry : dependent.tailMap(lastUpdate + 1).entrySet()) {
    long t=entry.getKey();
    if (independent.containsKey(t)) {
      double depValue=entry.getValue();
      double indValue=independent.get(t);
      plotLine.addData(indValue,depValue);
      timestamps.add(t);
      lastUpdate=t;
    }
  }
}
Program: 185181
Project: 185181
Buggy source:
@Override public void populate(PlotConfiguration settings){
  cachedFlags=getSelectedDrawingFlags();
  settings.setPlotLineDraw(cachedFlags);
  cachedConnectionType=getSelectedConnectionType();
  settings.setPlotLineConnectionType(cachedConnectionType);
}

Fixed version (ground truth):
@Override public void populate(PlotConfiguration settings){
  settings.setPlotLineDraw(getSelectedDrawingFlags());
  settings.setPlotLineConnectionType(getSelectedConnectionType());
}
Program: 185182
Project: 185182
Buggy source:
public PlotSettingsControlArea(PlotViewManifestation managedView){
  setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  add(new SectionPanel("String_Node_Str",new PlotSetupControlPanel(managedView)));
  add(new SectionPanel("String_Node_Str",new PlotBehaviorPanel()));
  add(new SectionPanel("String_Node_Str",new LineSetupPanel()));
}

Fixed version (ground truth):
public PlotSettingsControlArea(PlotViewManifestation managedView){
  setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
  add(new SectionPanel("String_Node_Str",new PlotBehaviorPanel()));
  add(new SectionPanel("String_Node_Str",new LineSetupPanel()));
}
Program: 185184
Project: 185184
Buggy source:
@Override public void run(){
  okButton.setEnabled(panel.isDirty() && panel.isValid());
  resetButton.setEnabled(panel.isDirty());
  PlotSettings settings=new PlotSettings();
  settings.loadFrom(managedView);
  panel.populate(settings);
  panel.reset(settings,false);
}

Fixed version (ground truth):
@Override public void run(){
  PlotSettings settings=new PlotSettings();
  settings.loadFrom(managedView);
  panel.populate(settings);
  panel.reset(settings,false);
  okButton.setEnabled(panel.isDirty() && panel.isValidated());
  resetButton.setEnabled(panel.isDirty());
}
Program: 185185
Project: 185185
Buggy source:
@Override public void populate(PlotConfiguration settings){
  for (  PlotSettingsSubPanel subPanel : subPanels) {
    subPanel.populate(settings);
  }
  dirty=false;
}

Fixed version (ground truth):
@Override public void populate(PlotConfiguration settings){
  for (  PlotSettingsSubPanel subPanel : subPanels) {
    subPanel.populate(settings);
  }
  updateState();
}
Program: 185186
Project: 185186
Buggy source:
@Override public boolean isDirty(){
  return dirty;
}

Fixed version (ground truth):
@Override public boolean isDirty(){
  updateState();
  return dirty;
}
Program: 185187
Project: 185187
Buggy source:
@Override public boolean isValidated(){
  return valid;
}

Fixed version (ground truth):
@Override public boolean isValidated(){
  updateState();
  return valid;
}
Program: 185188
Project: 185188
Buggy source:
@Override public void reset(PlotConfiguration settings,boolean hard){
  for (  PlotSettingsSubPanel subPanel : subPanels) {
    subPanel.reset(settings,hard);
  }
  if (hard)   dirty=false;
}

Fixed version (ground truth):
@Override public void reset(PlotConfiguration settings,boolean hard){
  for (  PlotSettingsSubPanel subPanel : subPanels) {
    subPanel.reset(settings,hard);
  }
  updateState();
}
Program: 185189
Project: 185189
Buggy source:
@Override public void run(){
  dirty=false;
  valid=true;
  for (  PlotSettingsSubPanel subPanel : subPanels) {
    dirty|=subPanel.isDirty();
    valid&=subPanel.isValidated();
  }
  fireCallbacks();
}

Fixed version (ground truth):
@Override public void run(){
  updateState();
  fireCallbacks();
}
Program: 185190
Project: 185190
Buggy source:
public ItemWrapper(T item){
  this.item=item;
}

Fixed version (ground truth):
public ItemWrapper(T item){
  this.item=item;
  this.text=item.toString();
}
Program: 185191
Project: 185191
Buggy source:
/** 
 * Set the selection for this group. Note that this will be considered  the "clean" selection - user changes will flag this as dirty.
 * @param object
 */
public void setSelection(T object){
  this.selection=(T)object;
  comboBox.setSelectedItem(object);
}

Fixed version (ground truth):
/** 
 * Set the selection for this group. Note that this will be considered  the "clean" selection - user changes will flag this as dirty.
 * @param object
 */
public void setSelection(T object){
  this.selection=(T)object;
  ItemWrapper<T> w=items.get(object);
  comboBox.setSelectedItem(w);
}
Program: 185192
Project: 185192
Buggy source:
public T getSelection(){
  return selection;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public T getSelection(){
  ItemWrapper<T> wrapper=((ItemWrapper<T>)comboBox.getSelectedItem());
  return wrapper == null ? null : wrapper.item;
}
Program: 185193
Project: 185193
Buggy source:
@Override public boolean isDirty(){
  return selection != comboBox.getSelectedItem();
}

Fixed version (ground truth):
@Override public boolean isDirty(){
  return !selection.equals(getSelection());
}