nus-yam/ex-repair huggingface dataset:
Program: 149230
Project: 149230
Buggy source:
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
  }
}

Fixed version (ground truth):
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
    setChilden(xsp[j],"String_Node_Str" + concept,docIndex);
  }
}
Program: 149235
Project: 149235
Buggy source:
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
  }
}

Fixed version (ground truth):
/** 
 * create an "empty" item from scratch, set every text node to empty
 * @param viewPK
 * @throws RemoteException
 * @throws Exception
 */
private void createItem(String concept,int docIndex) throws RemoteException, Exception {
  WebContext ctx=WebContextFactory.get();
  Configuration config=Configuration.getInstance();
  String xml1="String_Node_Str" + concept + "String_Node_Str"+ concept+ "String_Node_Str";
  Document d=Util.parse(xml1);
  ctx.getSession().setAttribute("String_Node_Str" + docIndex,d);
  Map<String,XSElementDecl> map=CommonDWR.getConceptMap(config.getModel());
  XSComplexType xsct=(XSComplexType)(map.get(concept).getType());
  XSParticle[] xsp=xsct.getContentType().asParticle().getTerm().asModelGroup().getChildren();
  for (int j=0; j < xsp.length; j++) {
    setChilden(xsp[j],"String_Node_Str" + concept,docIndex);
  }
}
Program: 149242
Project: 149242
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XSDTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}

Fixed version (ground truth):
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XPathTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}
Program: 149247
Project: 149247
Buggy source:
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XSDTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}

Fixed version (ground truth):
protected void provideViwerContent(XSDSchema xsdSchema){
  drillDownAdapter=new DrillDownAdapter(domViewer);
  domViewer.setLabelProvider(new XSDTreeLabelProvider());
  domViewer.setContentProvider(new XPathTreeContentProvider(site,xsdSchema));
  domViewer.addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent e){
      StructuredSelection sel=(StructuredSelection)e.getSelection();
      xpath=getXpath(sel);
      xpathText.setText(xpath);
    }
  }
);
  domViewer.getControl().setLayoutData(new GridData(SWT.FILL,SWT.FILL,false,true));
  domViewer.setSorter(new ViewerSorter(){
    public int category(    Object element){
      if (element instanceof XSDFacet)       return 100;
      if (element instanceof XSDIdentityConstraintDefinition) {
        XSDIdentityConstraintDefinition icd=(XSDIdentityConstraintDefinition)element;
        if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.UNIQUE_LITERAL))         return 300;
 else         if (icd.getIdentityConstraintCategory().equals(XSDIdentityConstraintCategory.KEY_LITERAL))         return 301;
 else         return 302;
      }
      return 200;
    }
    public int compare(    Viewer theViewer,    Object e1,    Object e2){
      int cat1=category(e1);
      int cat2=category(e2);
      return cat1 - cat2;
    }
  }
);
  domViewer.setInput(site);
}
Program: 149251
Project: 149251
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      if (keyPath.startsWith("String_Node_Str"))       keyPath=keyPath.substring(1);
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149252
Project: 149252
Buggy source:
public Object getAppendInfo(String key){
  return appendInfo.get(key);
}

Fixed version (ground truth):
public Object getAppendInfo(String key){
  if (appendInfo == null)   return null;
  return appendInfo.get(key);
}
Program: 149253
Project: 149253
Buggy source:
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString();
}

Fixed version (ground truth):
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString().replaceAll("String_Node_Str","String_Node_Str");
}
Program: 149254
Project: 149254
Buggy source:
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString();
}

Fixed version (ground truth):
/** 
 * Generates an xml string from a node with or without the xml declaration  (not pretty formatted)
 * @param n the node
 * @return the xml string
 * @throws TransformerException
 */
public static String nodeToString(Node n,boolean omitXMLDeclaration) throws TransformerException {
  StringWriter sw=new StringWriter();
  Transformer transformer=TransformerFactory.newInstance().newTransformer();
  if (omitXMLDeclaration)   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
 else   transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.setOutputProperty("String_Node_Str","String_Node_Str");
  transformer.transform(new DOMSource(n),new StreamResult(sw));
  if (sw == null)   return null;
  return sw.toString().replaceAll("String_Node_Str","String_Node_Str");
}
Program: 149256
Project: 149256
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      if (keyPath.startsWith("String_Node_Str"))       keyPath=keyPath.substring(1);
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  try {
    monitor.beginTask("String_Node_Str",toAddViewableList.size());
    for (Iterator<String> iter=toAddViewableList.iterator(); iter.hasNext(); ) {
      String keyPath=iter.next();
      viewableBEsList.add(keyPath);
      commit();
      monitor.worked(1);
    }
    monitor.done();
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(parentShell,"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149257
Project: 149257
Buggy source:
public Object getAppendInfo(String key){
  return appendInfo.get(key);
}

Fixed version (ground truth):
public Object getAppendInfo(String key){
  if (appendInfo == null)   return null;
  return appendInfo.get(key);
}
Program: 149267
Project: 149267
Buggy source:
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}

Fixed version (ground truth):
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    if (transformer.getProcessSteps()[i].getDisabled())     continue;
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}
Program: 149269
Project: 149269
Buggy source:
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}

Fixed version (ground truth):
public void setProcessStep(WSTransformerProcessStep processStep,int index){
  this.processStep=processStep;
  availableVariables.clear();
  for (int i=0; i <= index; i++) {
    if (transformer.getProcessSteps()[i].getDisabled())     continue;
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getInputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
    for (    WSTransformerVariablesMapping mapping : transformer.getProcessSteps()[i].getOutputMappings()) {
      availableVariables.add(mapping.getPipelineVariable() == null ? DEFAULT_VAR : mapping.getPipelineVariable());
    }
  }
  refreshViewers();
  refreshCombo();
}
Program: 149270
Project: 149270
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149271
Project: 149271
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationHidden_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149272
Project: 149272
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationTargetSystems_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149273
Project: 149273
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationWrite_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149274
Project: 149274
Buggy source:
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName,AMainPageV2 parentPage,int actionType){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
  this.parentPage=parentPage;
  this.xObject=parentPage.getXObject();
  this.actionType=actionType;
}
Program: 149276
Project: 149276
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirty();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 149277
Project: 149277
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}
Program: 149278
Project: 149278
Buggy source:
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
}

Fixed version (ground truth):
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
  linkDirty(page);
}
Program: 149280
Project: 149280
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 149281
Project: 149281
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}
Program: 149284
Project: 149284
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 149285
Project: 149285
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}
Program: 149288
Project: 149288
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getForeignKeyInfos().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationForeignKeyInfo_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setForeignKeyInfos(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149289
Project: 149289
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getHiddenAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationHidden_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setHiddenAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149290
Project: 149290
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getTargetSystems().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationTargetSystems_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setTargetSystems(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149291
Project: 149291
Buggy source:
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str");
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void run(){
  try {
    super.run();
    schema=((XSDTreeContentProvider)page.getTreeViewer().getContentProvider()).getXsdSchema();
    IStructuredSelection selection=(IStructuredSelection)page.getTreeViewer().getSelection();
    XSDAnnotationsStructure struc=new XSDAnnotationsStructure((XSDComponent)selection.getFirstElement());
    if (struc.getAnnotation() == null) {
      throw new RuntimeException("String_Node_Str" + selection.getFirstElement().getClass().getName());
    }
    dlg=new AnnotationOrderedListsDialog(new ArrayList(struc.getWriteAccesses().values()),new SelectionListener(){
      public void widgetDefaultSelected(      SelectionEvent e){
      }
      public void widgetSelected(      SelectionEvent e){
        dlg.close();
      }
    }
,page.getSite().getShell(),"String_Node_Str","String_Node_Str",page,AnnotationOrderedListsDialog.AnnotationWrite_ActionType);
    dlg.setBlockOnOpen(true);
    int ret=dlg.open();
    if (ret == Window.CANCEL)     return;
    struc.setWriteAccesses(dlg.getXPaths());
    if (struc.hasChanged()) {
      page.getTreeViewer().refresh(true);
      page.getTreeViewer().expandToLevel(selection.getFirstElement(),2);
      page.markDirty();
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    MessageDialog.openError(page.getSite().getShell(),"String_Node_Str","String_Node_Str" + e.getLocalizedMessage());
  }
}
Program: 149292
Project: 149292
Buggy source:
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
}

Fixed version (ground truth):
/** 
 * @param parentShell
 */
public AnnotationOrderedListsDialog(ArrayList<String> xPaths,SelectionListener caller,Shell parentShell,String title,String columnName,AMainPageV2 parentPage,int actionType){
  super(parentShell);
  setShellStyle(this.getShellStyle() | SWT.RESIZE);
  this.xPaths=xPaths;
  this.caller=caller;
  this.title=title;
  this.columnName=columnName;
  this.parentPage=parentPage;
  this.xObject=parentPage.getXObject();
  this.actionType=actionType;
}
Program: 149294
Project: 149294
Buggy source:
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirty();
}

Fixed version (ground truth):
public void markDirty(){
  if (editorPart != null)   editorPart.markDirty();
  commitChanges();
  DataModelMainPage page=((DataModelMainPage)getEditor().findPage(DataModelMainPage.class.getName()));
  if (!page.isDirty())   page.markDirtyWithoutCommit();
}
Program: 149295
Project: 149295
Buggy source:
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
  commitChanges();
}

Fixed version (ground truth):
public void textChanged(TextEvent event){
  if (this.refreshing)   return;
  markDirty();
}
Program: 149296
Project: 149296
Buggy source:
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
}

Fixed version (ground truth):
protected void pageChange(int newPageIndex){
  super.pageChange(newPageIndex);
  AFormPage page=(AFormPage)formPages.get(newPageIndex);
  page.refreshPage();
  linkDirty(page);
}