nus-yam/ex-repair huggingface dataset:
Program: 62495
Project: 62495
Buggy source:
@Override public void actionPerformed(ActionEvent e){
  if (product != null) {
    if (product.isMultiSize()) {
      final Product resampledProduct=_MultiSizeIssue.maybeResample(this.product);
      if (resampledProduct != null) {
        product=resampledProduct;
      }
    }
    openProductSceneViewRGB(product,HELP_ID);
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent e){
  if (product != null) {
    if (product.isMultiSize()) {
      final Product resampledProduct=MultiSizeIssue.maybeResample(this.product);
      if (resampledProduct != null) {
        product=resampledProduct;
      }
    }
    openProductSceneViewRGB(product,HELP_ID);
  }
}
Program: 62496
Project: 62496
Buggy source:
@Override public void actionPerformed(ActionEvent actionEvent){
  final ProductNodeList<Product> products=new ProductNodeList<>();
  Product[] openedProducts=SnapApp.getDefault().getProductManager().getProducts();
  for (  Product prod : openedProducts) {
    products.add(prod);
  }
  Product product=SnapApp.getDefault().getSelectedProduct(EXPLORER);
  if (product == null) {
    product=products.getAt(0);
  }
  if (_MultiSizeIssue.isMultiSize(product)) {
    final Product resampledProduct=_MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      product=resampledProduct;
      products.add(resampledProduct);
    }
  }
  Collection<? extends RasterDataNode> selectedRasters=Utilities.actionsGlobalContext().lookupAll(RasterDataNode.class);
  String expression=selectedRasters.stream().map(ProductNode::getName).collect(Collectors.joining("String_Node_Str"));
  BandMathsDialog bandMathsDialog=new BandMathsDialog(product,products,expression,HELP_ID);
  bandMathsDialog.show();
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent actionEvent){
  final ProductNodeList<Product> products=new ProductNodeList<>();
  Product[] openedProducts=SnapApp.getDefault().getProductManager().getProducts();
  for (  Product prod : openedProducts) {
    products.add(prod);
  }
  Product product=SnapApp.getDefault().getSelectedProduct(EXPLORER);
  if (product == null) {
    product=products.getAt(0);
  }
  if (MultiSizeIssue.isMultiSize(product)) {
    final Product resampledProduct=MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      product=resampledProduct;
      products.add(resampledProduct);
    }
  }
  Collection<? extends RasterDataNode> selectedRasters=Utilities.actionsGlobalContext().lookupAll(RasterDataNode.class);
  String expression=selectedRasters.stream().map(ProductNode::getName).collect(Collectors.joining("String_Node_Str"));
  BandMathsDialog bandMathsDialog=new BandMathsDialog(product,products,expression,HELP_ID);
  bandMathsDialog.show();
}
Program: 62497
Project: 62497
Buggy source:
@Override public void actionPerformed(ActionEvent actionEvent){
  final Product product=virtualBand.getProduct();
  if (product != null && product.isMultiSize()) {
    virtualBand=null;
    final Product resampledProduct=_MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      final Band band=resampledProduct.getBand(virtualBand.getName());
      if (band instanceof VirtualBand) {
        virtualBand=(VirtualBand)band;
      }
    }
  }
  if (virtualBand != null) {
    PropagateUncertaintyDialog dialog=new PropagateUncertaintyDialog(virtualBand);
    dialog.show();
  }
}

Fixed version (ground truth):
@Override public void actionPerformed(ActionEvent actionEvent){
  final Product product=virtualBand.getProduct();
  if (product != null && product.isMultiSize()) {
    virtualBand=null;
    final Product resampledProduct=MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      final Band band=resampledProduct.getBand(virtualBand.getName());
      if (band instanceof VirtualBand) {
        virtualBand=(VirtualBand)band;
      }
    }
  }
  if (virtualBand != null) {
    PropagateUncertaintyDialog dialog=new PropagateUncertaintyDialog(virtualBand);
    dialog.show();
  }
}
Program: 62498
Project: 62498
Buggy source:
private static void copyMaskPixel(Mask[] selectedMasks,Product sourceProduct,Product[] maskPixelTargetProducts){
  if (_MultiSizeIssue.isMultiSize(sourceProduct)) {
    final Product resampledProduct=_MultiSizeIssue.maybeResample(sourceProduct);
    if (resampledProduct != null) {
      sourceProduct=resampledProduct;
      for (int i=0; i < selectedMasks.length; i++) {
        Mask selectedMask=selectedMasks[i];
        selectedMasks[i]=sourceProduct.getMaskGroup().get(selectedMask.getName());
      }
    }
 else {
      return;
    }
  }
  for (  Product targetProduct : maskPixelTargetProducts) {
    if (sourceProduct.isCompatibleProduct(targetProduct,1.0e-3f)) {
      copyBandData(selectedMasks,targetProduct);
    }
 else {
      reprojectBandData(selectedMasks,sourceProduct,targetProduct);
    }
  }
}

Fixed version (ground truth):
private static void copyMaskPixel(Mask[] selectedMasks,Product sourceProduct,Product[] maskPixelTargetProducts){
  if (MultiSizeIssue.isMultiSize(sourceProduct)) {
    final Product resampledProduct=MultiSizeIssue.maybeResample(sourceProduct);
    if (resampledProduct != null) {
      sourceProduct=resampledProduct;
      for (int i=0; i < selectedMasks.length; i++) {
        Mask selectedMask=selectedMasks[i];
        selectedMasks[i]=sourceProduct.getMaskGroup().get(selectedMask.getName());
      }
    }
 else {
      return;
    }
  }
  for (  Product targetProduct : maskPixelTargetProducts) {
    if (sourceProduct.isCompatibleProduct(targetProduct,1.0e-3f)) {
      copyBandData(selectedMasks,targetProduct);
    }
 else {
      reprojectBandData(selectedMasks,sourceProduct,targetProduct);
    }
  }
}
Program: 62499
Project: 62499
Buggy source:
private void checkForMultiSize(Product product){
  if (product != null && product.isMultiSize()) {
    final Product resampledProduct=_MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      selectionChanged(resampledProduct,null,null);
    }
  }
}

Fixed version (ground truth):
private void checkForMultiSize(Product product){
  if (product != null && product.isMultiSize()) {
    final Product resampledProduct=MultiSizeIssue.maybeResample(product);
    if (resampledProduct != null) {
      selectionChanged(resampledProduct,null,null);
    }
  }
}
Program: 62500
Project: 62500
Buggy source:
public static void createSubset(Product sourceProduct,Rectangle bounds){
  if (_MultiSizeIssue.isMultiSize(sourceProduct)) {
    final Product resampledProduct=_MultiSizeIssue.maybeResample(sourceProduct);
    if (resampledProduct != null) {
      sourceProduct=resampledProduct;
    }
 else {
      return;
    }
  }
  final String subsetName="String_Node_Str" + CreateSubsetAction.subsetNumber + "String_Node_Str"+ sourceProduct.getName();
  final ProductSubsetDef initSubset=new ProductSubsetDef();
  initSubset.setRegion(bounds);
  initSubset.setNodeNames(sourceProduct.getBandNames());
  initSubset.addNodeNames(sourceProduct.getTiePointGridNames());
  initSubset.setIgnoreMetadata(false);
  final ProductSubsetDialog subsetDialog=new ProductSubsetDialog(SnapApp.getDefault().getMainFrame(),sourceProduct,initSubset);
  if (subsetDialog.show() != ProductSubsetDialog.ID_OK) {
    return;
  }
  final ProductSubsetDef subsetDef=subsetDialog.getProductSubsetDef();
  if (subsetDef == null) {
    Dialogs.showInformation(Bundle.CTL_CreateSubsetFromViewAction_Title(),"String_Node_Str",null);
    return;
  }
  try {
    final Product subset=sourceProduct.createSubset(subsetDef,subsetName,sourceProduct.getDescription());
    SnapApp.getDefault().getProductManager().addProduct(subset);
    CreateSubsetAction.subsetNumber++;
  }
 catch (  Exception e) {
    final String msg="String_Node_Str" + e.getMessage();
    SnapApp.getDefault().handleError(msg,e);
  }
}

Fixed version (ground truth):
public static void createSubset(Product sourceProduct,Rectangle bounds){
  if (MultiSizeIssue.isMultiSize(sourceProduct)) {
    final Product resampledProduct=MultiSizeIssue.maybeResample(sourceProduct);
    if (resampledProduct != null) {
      sourceProduct=resampledProduct;
    }
 else {
      return;
    }
  }
  final String subsetName="String_Node_Str" + CreateSubsetAction.subsetNumber + "String_Node_Str"+ sourceProduct.getName();
  final ProductSubsetDef initSubset=new ProductSubsetDef();
  initSubset.setRegion(bounds);
  initSubset.setNodeNames(sourceProduct.getBandNames());
  initSubset.addNodeNames(sourceProduct.getTiePointGridNames());
  initSubset.setIgnoreMetadata(false);
  final ProductSubsetDialog subsetDialog=new ProductSubsetDialog(SnapApp.getDefault().getMainFrame(),sourceProduct,initSubset);
  if (subsetDialog.show() != ProductSubsetDialog.ID_OK) {
    return;
  }
  final ProductSubsetDef subsetDef=subsetDialog.getProductSubsetDef();
  if (subsetDef == null) {
    Dialogs.showInformation(Bundle.CTL_CreateSubsetFromViewAction_Title(),"String_Node_Str",null);
    return;
  }
  try {
    final Product subset=sourceProduct.createSubset(subsetDef,subsetName,sourceProduct.getDescription());
    SnapApp.getDefault().getProductManager().addProduct(subset);
    CreateSubsetAction.subsetNumber++;
  }
 catch (  Exception e) {
    final String msg="String_Node_Str" + e.getMessage();
    SnapApp.getDefault().handleError(msg,e);
  }
}
Program: 62502
Project: 62502
Buggy source:
private void initialize(ToolAdapterOperatorDescriptor descriptor){
  this.operatorDescriptor=descriptor;
  this.parameterSupport=new OperatorParameterSupport(descriptor);
  form=new ToolExecutionForm(appContext,descriptor,parameterSupport.getPropertySet(),getTargetProductSelector());
  OperatorMenu operatorMenu=new OperatorMenu(this.getJDialog(),descriptor,parameterSupport,appContext,helpID);
  getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
  EscapeAction.register(getJDialog());
}

Fixed version (ground truth):
private void initialize(ToolAdapterOperatorDescriptor descriptor){
  this.operatorDescriptor=descriptor;
  this.parameterSupport=new OperatorParameterSupport(descriptor);
  form=new ToolExecutionForm(appContext,descriptor,parameterSupport.getPropertySet(),getTargetProductSelector());
  OperatorMenu operatorMenu=new OperatorMenu(this.getJDialog(),descriptor,parameterSupport,appContext,helpID);
  getJDialog().setJMenuBar(operatorMenu.createDefaultMenu());
  EscapeAction.register(getJDialog());
  updatePrimitiveZeroValuesHashMap();
}
Program: 62503
Project: 62503
Buggy source:
public synchronized void initProducts(){
  productListModel.removeAllElements();
  for (  Product product : appContext.getProductManager().getProducts()) {
    addProduct(product);
  }
  final Product selectedProduct=appContext.getSelectedProduct();
  if (selectedProduct != null && productFilter.accept(selectedProduct)) {
    productListModel.setSelectedItem(selectedProduct);
  }
  appContext.getProductManager().addListener(productManagerListener);
}

Fixed version (ground truth):
public synchronized void initProducts(){
  productListModel.removeAllElements();
  for (  Product product : appContext.getProductManager().getProducts()) {
    addProduct(product);
  }
  Product selectedProduct=appContext.getSelectedProduct();
  final ProductNode productNode=Utilities.actionsGlobalContext().lookup(ProductNode.class);
  if (productNode != null) {
    selectedProduct=productNode.getProduct();
  }
  if (selectedProduct != null && productFilter.accept(selectedProduct)) {
    productListModel.setSelectedItem(selectedProduct);
  }
  appContext.getProductManager().addListener(productManagerListener);
}
Program: 62504
Project: 62504
Buggy source:
private JComponent addBoolPropertyEditor(JPanel parent,String label,String propertyName,Boolean value,int line){
  parent.add(new JLabel(label),getConstraints(line,1,1));
  PropertyDescriptor propertyDescriptor=container.getDescriptor(propertyName);
  CheckBoxEditor boolEditor=new CheckBoxEditor();
  JComponent editorComponent=boolEditor.createEditorComponent(propertyDescriptor,context);
  ((JCheckBox)editorComponent).setSelected(value);
  editorComponent.setPreferredSize(new Dimension(30,30));
  GridBagConstraints constraints=getConstraints(line,0,1);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.LINE_END;
  parent.add(editorComponent,constraints);
  return editorComponent;
}

Fixed version (ground truth):
private JComponent addBoolPropertyEditor(JPanel parent,String label,String propertyName,Boolean value,int line){
  parent.add(new JLabel(label),getConstraints(line,1,1));
  PropertyDescriptor propertyDescriptor=container.getDescriptor(propertyName);
  CheckBoxEditor boolEditor=new CheckBoxEditor();
  JComponent editorComponent=boolEditor.createEditorComponent(propertyDescriptor,valuesContext);
  ((JCheckBox)editorComponent).setSelected(value);
  editorComponent.setPreferredSize(new Dimension(30,30));
  GridBagConstraints constraints=getConstraints(line,0,1);
  constraints.fill=GridBagConstraints.NONE;
  constraints.anchor=GridBagConstraints.LINE_END;
  parent.add(editorComponent,constraints);
  return editorComponent;
}
Program: 62505
Project: 62505
Buggy source:
private JComponent addTextPropertyEditor(JPanel parent,String label,String propertyName,String value,int line,boolean isRequired){
  parent.add(new JLabel(label),getConstraints(line,0,1));
  PropertyDescriptor propertyDescriptor=container.getDescriptor(propertyName);
  TextFieldEditor textEditor=new TextFieldEditor();
  JComponent editorComponent=textEditor.createEditorComponent(propertyDescriptor,context);
  ((JTextField)editorComponent).setText(value);
  if (isRequired) {
    editorComponent.setInputVerifier(new RequiredFieldValidator("String_Node_Str"));
  }
  parent.add(editorComponent,getConstraints(line,1,1));
  return editorComponent;
}

Fixed version (ground truth):
private JComponent addTextPropertyEditor(JPanel parent,String label,String propertyName,String value,int line,boolean isRequired){
  parent.add(new JLabel(label),getConstraints(line,0,1));
  PropertyDescriptor propertyDescriptor=container.getDescriptor(propertyName);
  TextFieldEditor textEditor=new TextFieldEditor();
  JComponent editorComponent=textEditor.createEditorComponent(propertyDescriptor,valuesContext);
  ((JTextField)editorComponent).setText(value);
  if (isRequired) {
    editorComponent.setInputVerifier(new RequiredFieldValidator("String_Node_Str"));
  }
  parent.add(editorComponent,getConstraints(line,1,1));
  return editorComponent;
}
Program: 62507
Project: 62507
Buggy source:
public ToolParameterEditorDialog(AppContext appContext,ToolParameterDescriptor parameter,PropertyMemberUIWrapper uiWrapper){
  super(appContext.getApplicationWindow(),parameter.getName(),ID_OK_CANCEL,helpID);
  this.oldParameter=parameter;
  this.parameter=new ToolParameterDescriptor(parameter);
  this.uiWrapper=uiWrapper;
  setContent(createMainPanel());
  getJDialog().setPreferredSize(new Dimension(500,500));
}

Fixed version (ground truth):
public ToolParameterEditorDialog(AppContext appContext,String title,ToolParameterDescriptor parameter,Object value) throws Exception {
  super(appContext.getApplicationWindow(),parameter.getName(),ID_OK_CANCEL,helpID);
  this.oldParameter=parameter;
  this.parameter=new ToolParameterDescriptor(parameter);
  if (value != null) {
    this.parameter.setDefaultValue(value.toString());
  }
  container=PropertyContainer.createObjectBacked(parameter);
  valuesContext=new BindingContext(container);
  createContextForValueEditor();
  this.logger=Logger.getLogger(ToolAdapterEditorDialog.class.getName());
  setContent(createMainPanel());
  getJDialog().setPreferredSize(new Dimension(500,500));
}
Program: 62510
Project: 62510
Buggy source:
/** 
 * Internal method to handle scaling correctly. This method must not be called by a client. Clients should always use the method </code>worked(int)</code>.
 * @param work the amount of work done
 */
public void internalWorked(final double work){
  currentWork+=work;
  currentWorkUI=(int)(totalWorkUI * currentWork / totalWork);
  if (currentWorkUI > lastWorkUI) {
    runInUI(new Runnable(){
      public void run(){
        if (progressBar != null) {
          final int progress=progressBar.getMinimum() + currentWorkUI;
          progressBar.setValue(progress);
          setVisibility(true);
        }
        lastWorkUI=currentWorkUI;
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * Internal method to handle scaling correctly. This method must not be called by a client. Clients should always use the method <code>worked(int)</code>.
 * @param work the amount of work done
 */
public void internalWorked(final double work){
  currentWork+=work;
  currentWorkUI=(int)(totalWorkUI * currentWork / totalWork);
  if (currentWorkUI > lastWorkUI) {
    runInUI(new Runnable(){
      public void run(){
        if (progressBar != null) {
          final int progress=progressBar.getMinimum() + currentWorkUI;
          progressBar.setValue(progress);
          setVisibility(true);
        }
        lastWorkUI=currentWorkUI;
      }
    }
);
  }
}
Program: 62511
Project: 62511
Buggy source:
/** 
 * Action factory method used in NetBeans   {@code layer.xml} file, e.g.<p> <pre> &lt;file name="org-esa-snap-csv-dataio-ExportCSVProduct.instance"&gt; &lt;attr name="instanceCreate" methodvalue="org.openide.awt.Actions.context"/&gt; &lt;attr name="type" stringvalue="org.esa.snap.framework.datamodel.ProductNode"/&gt; &lt;attr name="delegate" methodvalue="ExportProductAction.create"/&gt; &lt;attr name="selectionType" stringvalue="EXACTLY_ONE"/&gt; &lt;attr name="displayName" stringvalue="CSV Product"/&gt; &lt;attr name="formatName" stringvalue="CSV"/&gt; &lt;attr name="useAllFileFilter" boolvalue="true"/&gt; &lt;attr name="helpId" stringvalue="exportCsvProduct"/&gt; &lt;attr name="ShortDescription" stringvalue=">Writes a product in CSV format."/&gt; &lt;/file&gt; </pre>
 * @param configuration Configuration attributes from layer.xml.
 * @return The action.
 * @since SNAP 2
 */
public static ExportProductAction create(Map<String,Object> configuration){
  ExportProductAction exportProductAction=new ExportProductAction();
  exportProductAction.setFormatName((String)configuration.get(PROPERTY_FORMAT_NAME));
  exportProductAction.setHelpCtx((String)configuration.get("String_Node_Str"));
  exportProductAction.setUseAllFileFilter((Boolean)configuration.get(PROPERTY_USE_ALL_FILE_FILTER));
  return exportProductAction;
}

Fixed version (ground truth):
/** 
 * Action factory method used in NetBeans   {@code layer.xml} file, e.g.<p> <pre> &lt;file name="org-esa-snap-csv-dataio-ExportCSVProduct.instance"&gt; &lt;attr name="instanceCreate" methodvalue="org.openide.awt.Actions.context"/&gt; &lt;attr name="type" stringvalue="org.esa.snap.framework.datamodel.ProductNode"/&gt; &lt;attr name="delegate" methodvalue="ExportProductAction.create"/&gt; &lt;attr name="selectionType" stringvalue="EXACTLY_ONE"/&gt; &lt;attr name="displayName" stringvalue="CSV Product"/&gt; &lt;attr name="formatName" stringvalue="CSV"/&gt; &lt;attr name="useAllFileFilter" boolvalue="true"/&gt; &lt;attr name="helpId" stringvalue="exportCsvProduct"/&gt; &lt;attr name="ShortDescription" stringvalue="Writes a product in CSV format."/&gt; &lt;/file&gt; </pre>
 * @param configuration Configuration attributes from layer.xml.
 * @return The action.
 * @since SNAP 2
 */
public static ExportProductAction create(Map<String,Object> configuration){
  ExportProductAction exportProductAction=new ExportProductAction();
  exportProductAction.setFormatName((String)configuration.get(PROPERTY_FORMAT_NAME));
  exportProductAction.setHelpCtx((String)configuration.get("String_Node_Str"));
  exportProductAction.setUseAllFileFilter((Boolean)configuration.get(PROPERTY_USE_ALL_FILE_FILTER));
  return exportProductAction;
}
Program: 62512
Project: 62512
Buggy source:
/** 
 * Sets the filter to be used to filter the displayed bands. <p/>
 * @param displayFilter the filter, can be null
 */
public void setDisplayFilter(DisplayFilter displayFilter){
  if (this.displayFilter != displayFilter) {
    if (this.displayFilter != null) {
      this.displayFilter.removePropertyChangeListener(displayFilterListener);
    }
    this.displayFilter=displayFilter;
    this.displayFilter.addPropertyChangeListener(displayFilterListener);
  }
}

Fixed version (ground truth):
/** 
 * Sets the filter to be used to filter the displayed bands. <p>
 * @param displayFilter the filter, can be null
 */
public void setDisplayFilter(DisplayFilter displayFilter){
  if (this.displayFilter != displayFilter) {
    if (this.displayFilter != null) {
      this.displayFilter.removePropertyChangeListener(displayFilterListener);
    }
    this.displayFilter=displayFilter;
    this.displayFilter.addPropertyChangeListener(displayFilterListener);
  }
}
Program: 62513
Project: 62513
Buggy source:
/** 
 * Sets the current help set. If the current help broker is not null, the help set will be assigned to it. Otherwise, a help broker will be created from the given help set. <p/> This method can be used to switch to an other helpset.
 * @param helpSet the help set to be set
 */
private static void set(HelpSet helpSet){
  if (helpBroker == null) {
    helpBroker=new DefaultHelpBroker(helpSet);
  }
  helpBroker.setHelpSet(helpSet);
}

Fixed version (ground truth):
/** 
 * Sets the current help set. If the current help broker is not null, the help set will be assigned to it. Otherwise, a help broker will be created from the given help set. <p> This method can be used to switch to an other helpset.
 * @param helpSet the help set to be set
 */
private static void set(HelpSet helpSet){
  if (helpBroker == null) {
    helpBroker=new DefaultHelpBroker(helpSet);
  }
  helpBroker.setHelpSet(helpSet);
}
Program: 62514
Project: 62514
Buggy source:
/** 
 * Adds a new JavaHelp   {@link javax.help.HelpSet} to the existing help.The helpset is as a resource path to the JavaHelp helpset XML file (*.hs). The helpset and associated resources must be accessible by the given class-loader. <p/> Note that you also can add help-set instances directly to the BEAM help system by using the static  {@link HelpSys#add(javax.help.HelpSet)} method.</p> <p/> For more information on the JavaHelp architecture and API please refer to the <a href="http://java.sun.com/products/javahelp/">JavaHelp home page</a>. </p>
 * @param classLoader         the class loader used to load the help resources
 * @param helpsetResourcePath the resource path to the helpset file (*.hs)
 */
public final void addHelp(final ClassLoader classLoader,final String helpsetResourcePath){
  Guardian.assertNotNull("String_Node_Str",classLoader);
  Guardian.assertNotNullOrEmpty("String_Node_Str",helpsetResourcePath);
  final URL url=HelpSet.findHelpSet(classLoader,helpsetResourcePath);
  if (url == null) {
    getLogger().log(Level.SEVERE,"String_Node_Str" + helpsetResourcePath);
    return;
  }
  try {
    final HelpSet helpSet=new HelpSet(classLoader,url);
    HelpSys.add(helpSet);
  }
 catch (  HelpSetException e) {
    getLogger().log(Level.SEVERE,"String_Node_Str" + helpsetResourcePath,e);
  }
}

Fixed version (ground truth):
/** 
 * Adds a new JavaHelp   {@link javax.help.HelpSet} to the existing help.The helpset is as a resource path to the JavaHelp helpset XML file (*.hs). The helpset and associated resources must be accessible by the given class-loader. <p> Note that you also can add help-set instances directly to the BEAM help system by using the static  {@link HelpSys#add(javax.help.HelpSet)} method.</p> <p> For more information on the JavaHelp architecture and API please refer to the <a href="http://java.sun.com/products/javahelp/">JavaHelp home page</a>. </p>
 * @param classLoader         the class loader used to load the help resources
 * @param helpsetResourcePath the resource path to the helpset file (*.hs)
 */
public final void addHelp(final ClassLoader classLoader,final String helpsetResourcePath){
  Guardian.assertNotNull("String_Node_Str",classLoader);
  Guardian.assertNotNullOrEmpty("String_Node_Str",helpsetResourcePath);
  final URL url=HelpSet.findHelpSet(classLoader,helpsetResourcePath);
  if (url == null) {
    getLogger().log(Level.SEVERE,"String_Node_Str" + helpsetResourcePath);
    return;
  }
  try {
    final HelpSet helpSet=new HelpSet(classLoader,url);
    HelpSys.add(helpSet);
  }
 catch (  HelpSetException e) {
    getLogger().log(Level.SEVERE,"String_Node_Str" + helpsetResourcePath,e);
  }
}
Program: 62515
Project: 62515
Buggy source:
/** 
 * This method should be called after prefernces that affect the current look & feel have changed.
 */
protected final void applyLookAndFeelPreferences(){
  boolean startingUp=!isStartedUp();
  if (startingUp && uiDefaultsInitialized) {
    return;
  }
  boolean mustUpdateComponentTreeUI=initLookAndFeel();
  final UIDefaults uiDefaults=UIManager.getLookAndFeel().getDefaults();
  final boolean currentUseSystemFontSettings=uiDefaults.getBoolean("String_Node_Str");
  final boolean useSystemFontSettings=getPreferences().getPropertyBool(PROPERTY_KEY_APP_UI_USE_SYSTEM_FONT_SETTINGS,currentUseSystemFontSettings);
  if (currentUseSystemFontSettings != useSystemFontSettings) {
    uiDefaults.put("String_Node_Str",useSystemFontSettings);
    mustUpdateComponentTreeUI=true;
  }
  if (!useSystemFontSettings) {
    final Font currentMenuFont=uiDefaults.getFont("String_Node_Str");
    final String fontName=getPreferences().getPropertyString(PROPERTY_KEY_APP_UI_FONT_NAME,currentMenuFont.getName());
    final int fontSize=getPreferences().getPropertyInt(PROPERTY_KEY_APP_UI_FONT_SIZE,currentMenuFont.getSize());
    if (!currentMenuFont.getName().equalsIgnoreCase(fontName) || currentMenuFont.getSize() != fontSize) {
      changeUIDefaultsFonts(uiDefaults,fontName,fontSize);
      mustUpdateComponentTreeUI=true;
    }
  }
  if (mustUpdateComponentTreeUI && getMainFrame().isVisible()) {
    updateComponentTreeUI();
  }
  uiDefaultsInitialized=true;
}

Fixed version (ground truth):
/** 
 * This method should be called after preferences that affect the current look &amp; feel have changed.
 */
protected final void applyLookAndFeelPreferences(){
  boolean startingUp=!isStartedUp();
  if (startingUp && uiDefaultsInitialized) {
    return;
  }
  boolean mustUpdateComponentTreeUI=initLookAndFeel();
  final UIDefaults uiDefaults=UIManager.getLookAndFeel().getDefaults();
  final boolean currentUseSystemFontSettings=uiDefaults.getBoolean("String_Node_Str");
  final boolean useSystemFontSettings=getPreferences().getPropertyBool(PROPERTY_KEY_APP_UI_USE_SYSTEM_FONT_SETTINGS,currentUseSystemFontSettings);
  if (currentUseSystemFontSettings != useSystemFontSettings) {
    uiDefaults.put("String_Node_Str",useSystemFontSettings);
    mustUpdateComponentTreeUI=true;
  }
  if (!useSystemFontSettings) {
    final Font currentMenuFont=uiDefaults.getFont("String_Node_Str");
    final String fontName=getPreferences().getPropertyString(PROPERTY_KEY_APP_UI_FONT_NAME,currentMenuFont.getName());
    final int fontSize=getPreferences().getPropertyInt(PROPERTY_KEY_APP_UI_FONT_SIZE,currentMenuFont.getSize());
    if (!currentMenuFont.getName().equalsIgnoreCase(fontName) || currentMenuFont.getSize() != fontSize) {
      changeUIDefaultsFonts(uiDefaults,fontName,fontSize);
      mustUpdateComponentTreeUI=true;
    }
  }
  if (mustUpdateComponentTreeUI && getMainFrame().isVisible()) {
    updateComponentTreeUI();
  }
  uiDefaultsInitialized=true;
}
Program: 62516
Project: 62516
Buggy source:
/** 
 * Starts up the client application. <p/>Called from   {@link #startUp(com.bc.ceres.core.ProgressMonitor)} before{@link #initClientUI(com.bc.ceres.core.ProgressMonitor)} is called.<p/>Clients should override this method in order to initialize non-UI components, e.g. load plugins. <p/>The default implementation does nothing.
 * @param pm a progress monitor, can be used to signal progress
 * @throws Exception if an error occurs
 */
protected void initClient(ProgressMonitor pm) throws Exception {
}

Fixed version (ground truth):
/** 
 * Starts up the client application. <p>Called from   {@link #startUp(com.bc.ceres.core.ProgressMonitor)} before{@link #initClientUI(com.bc.ceres.core.ProgressMonitor)} is called.<p>Clients should override this method in order to initialize non-UI components, e.g. load plugins. <p>The default implementation does nothing.
 * @param pm a progress monitor, can be used to signal progress
 * @throws Exception if an error occurs
 */
protected void initClient(ProgressMonitor pm) throws Exception {
}
Program: 62518
Project: 62518
Buggy source:
/** 
 * Initializes the client user interface. <p/>Called from   {@link #startUp(com.bc.ceres.core.ProgressMonitor)} after{@link #initClient(com.bc.ceres.core.ProgressMonitor)} is called.<p/>Clients should override this method in order to initialize their UI components. <p/>The default implementation does nothing.
 * @param pm a progress monitor, can be used to signal progress
 * @throws Exception if an error occurs
 */
protected void initClientUI(ProgressMonitor pm) throws Exception {
}

Fixed version (ground truth):
/** 
 * Initializes the client user interface. <p>Called from   {@link #startUp(com.bc.ceres.core.ProgressMonitor)} after{@link #initClient(com.bc.ceres.core.ProgressMonitor)} is called.<p>Clients should override this method in order to initialize their UI components. <p>The default implementation does nothing.
 * @param pm a progress monitor, can be used to signal progress
 * @throws Exception if an error occurs
 */
protected void initClientUI(ProgressMonitor pm) throws Exception {
}
Program: 62519
Project: 62519
Buggy source:
/** 
 * Creates a default frame icon list for this application. <p/> Override this method if you want another behaviour.
 * @return the frame icon list, or <code>null</code> if no icon is used
 */
protected List<Image> createFrameIcons(){
  final String paths=applicationDescriptor.getFrameIconPaths();
  if (paths == null) {
    return null;
  }
  String[] pathParts=paths.split("String_Node_Str");
  ArrayList<Image> images=new ArrayList<>(pathParts.length);
  for (  String pathPart : pathParts) {
    pathPart=pathPart.trim();
    URL iconURL=getClass().getResource(pathPart);
    if (iconURL == null) {
      SystemUtils.LOG.severe("String_Node_Str" + pathPart);
      continue;
    }
    images.add(new ImageIcon(iconURL).getImage());
  }
  return images;
}

Fixed version (ground truth):
/** 
 * Creates a default frame icon list for this application. <p> Override this method if you want another behaviour.
 * @return the frame icon list, or <code>null</code> if no icon is used
 */
protected List<Image> createFrameIcons(){
  final String paths=applicationDescriptor.getFrameIconPaths();
  if (paths == null) {
    return null;
  }
  String[] pathParts=paths.split("String_Node_Str");
  ArrayList<Image> images=new ArrayList<>(pathParts.length);
  for (  String pathPart : pathParts) {
    pathPart=pathPart.trim();
    URL iconURL=getClass().getResource(pathPart);
    if (iconURL == null) {
      SystemUtils.LOG.severe("String_Node_Str" + pathPart);
      continue;
    }
    images.add(new ImageIcon(iconURL).getImage());
  }
  return images;
}
Program: 62520
Project: 62520
Buggy source:
/** 
 * Called after the look & feel has changed. The method simply calls <code>SwingUtilities.updateComponentTreeUI(getMainFrame())</code> in order to reflect changes of the look-and-feel. <p>You might want to override this method in order to call <code>SwingUtilities.updateComponentTreeUI()</code> on other top-level containers beside the main frame.
 */
protected void updateComponentTreeUI(){
  mainFrame.getDockableBarManager().updateComponentTreeUI();
  mainFrame.getDockingManager().updateComponentTreeUI();
  SwingUtilities.updateComponentTreeUI(getMainFrame());
}

Fixed version (ground truth):
/** 
 * Called after the look &amp; feel has changed. The method simply calls <code>SwingUtilities.updateComponentTreeUI(getMainFrame())</code> in order to reflect changes of the look-and-feel. <p>You might want to override this method in order to call <code>SwingUtilities.updateComponentTreeUI()</code> on other top-level containers beside the main frame.
 */
protected void updateComponentTreeUI(){
  mainFrame.getDockableBarManager().updateComponentTreeUI();
  mainFrame.getDockingManager().updateComponentTreeUI();
  SwingUtilities.updateComponentTreeUI(getMainFrame());
}
Program: 62521
Project: 62521
Buggy source:
private Path getColorPalettesDir(){
  return Places.getUserDirectory().toPath().resolve("String_Node_Str");
}

Fixed version (ground truth):
private Path getColorPalettesDir(){
  return SystemUtils.getApplicationDataDir().toPath().resolve("String_Node_Str");
}
Program: 62522
Project: 62522
Buggy source:
private void installDefaultColorPalettes(){
  Path sourceBasePath=ResourceInstaller.findModuleCodeBasePath(BeamUiActivator.class);
  final Path auxdataDir=Places.getUserDirectory().toPath();
  final ResourceInstaller resourceInstaller=new ResourceInstaller(sourceBasePath,"String_Node_Str",auxdataDir);
  ProgressMonitorSwingWorker swingWorker=new ProgressMonitorSwingWorker(toolView,"String_Node_Str"){
    @Override protected Object doInBackground(    ProgressMonitor progressMonitor) throws Exception {
      resourceInstaller.install("String_Node_Str",progressMonitor);
      defaultColorPalettesInstalled=true;
      return Boolean.TRUE;
    }
    @Override protected void done(){
      try {
        get();
      }
 catch (      Exception e) {
        SnapApp.getDefault().getLogger().log(Level.SEVERE,"String_Node_Str",e);
      }
    }
  }
;
  swingWorker.executeWithBlocking();
}

Fixed version (ground truth):
private void installDefaultColorPalettes(){
  Path sourceBasePath=ResourceInstaller.findModuleCodeBasePath(BeamUiActivator.class);
  final Path auxdataDir=getColorPalettesDir();
  final ResourceInstaller resourceInstaller=new ResourceInstaller(sourceBasePath,"String_Node_Str",auxdataDir);
  ProgressMonitorSwingWorker swingWorker=new ProgressMonitorSwingWorker(toolView,"String_Node_Str"){
    @Override protected Object doInBackground(    ProgressMonitor progressMonitor) throws Exception {
      resourceInstaller.install("String_Node_Str",progressMonitor);
      defaultColorPalettesInstalled=true;
      return Boolean.TRUE;
    }
    @Override protected void done(){
      try {
        get();
      }
 catch (      Exception e) {
        SnapApp.getDefault().getLogger().log(Level.SEVERE,"String_Node_Str",e);
      }
    }
  }
;
  swingWorker.executeWithBlocking();
}
Program: 62523
Project: 62523
Buggy source:
private void setProductSceneView(final ProductSceneView productSceneView){
  ProductSceneView productSceneViewOld=getFormModel().getProductSceneView();
  if (productSceneViewOld != null) {
    productSceneViewOld.getProduct().removeProductNodeListener(productNodeListener);
    productSceneViewOld.removePropertyChangeListener(sceneViewChangeListener);
  }
  getFormModel().setProductSceneView(productSceneView);
  if (getFormModel().isValid()) {
    getFormModel().getProductSceneView().getProduct().addProductNodeListener(productNodeListener);
    getFormModel().getProductSceneView().addPropertyChangeListener(sceneViewChangeListener);
  }
  if (getFormModel().isValid()) {
    getFormModel().setModifiedImageInfo(getFormModel().getOriginalImageInfo());
  }
  installChildForm();
  updateToolButtons();
  updateMultiApplyState();
}

Fixed version (ground truth):
private void setProductSceneView(final ProductSceneView productSceneView){
  ProductSceneView productSceneViewOld=getFormModel().getProductSceneView();
  if (productSceneViewOld != null) {
    productSceneViewOld.getProduct().removeProductNodeListener(productNodeListener);
    productSceneViewOld.removePropertyChangeListener(sceneViewChangeListener);
  }
  getFormModel().setProductSceneView(productSceneView);
  if (getFormModel().isValid()) {
    getFormModel().getProductSceneView().getProduct().addProductNodeListener(productNodeListener);
    getFormModel().getProductSceneView().addPropertyChangeListener(sceneViewChangeListener);
  }
  if (getFormModel().isValid()) {
    getFormModel().setModifiedImageInfo(getFormModel().getOriginalImageInfo());
  }
  installChildForm();
  updateTitle();
  updateToolButtons();
  updateMultiApplyState();
}
Program: 62524
Project: 62524
Buggy source:
@Override public void nodeChanged(final ProductNodeEvent event){
  final RasterDataNode[] rasters=childForm.getRasters();
  RasterDataNode raster=null;
  for (  RasterDataNode dataNode : rasters) {
    if (event.getSourceNode() == dataNode) {
      raster=(RasterDataNode)event.getSourceNode();
    }
  }
  if (raster != null) {
    final String propertyName=event.getPropertyName();
    if (ProductNode.PROPERTY_NAME_NAME.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_ANCILLARY_BANDS.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_UNIT.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_STX.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.isValidMaskProperty(propertyName)) {
      getStx(raster);
    }
  }
}

Fixed version (ground truth):
@Override public void nodeChanged(final ProductNodeEvent event){
  final RasterDataNode[] rasters=childForm.getRasters();
  RasterDataNode raster=null;
  for (  RasterDataNode dataNode : rasters) {
    if (event.getSourceNode() == dataNode) {
      raster=(RasterDataNode)event.getSourceNode();
    }
  }
  if (raster != null) {
    final String propertyName=event.getPropertyName();
    if (ProductNode.PROPERTY_NAME_NAME.equalsIgnoreCase(propertyName)) {
      updateTitle();
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_ANCILLARY_BANDS.equalsIgnoreCase(propertyName)) {
      updateTitle();
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_UNIT.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.PROPERTY_NAME_STX.equalsIgnoreCase(propertyName)) {
      childForm.handleRasterPropertyChange(event,raster);
    }
 else     if (RasterDataNode.isValidMaskProperty(propertyName)) {
      getStx(raster);
    }
  }
}
Program: 62525
Project: 62525
Buggy source:
public ColorManipulationForm(TopComponent colorManipulationToolView,FormModel formModel){
  Assert.notNull(colorManipulationToolView);
  Assert.notNull(formModel);
  this.toolView=colorManipulationToolView;
  this.formModel=formModel;
  preferences=SnapApp.getDefault().getPreferences();
  productNodeListener=new ColorManipulationPNL();
  sceneViewChangeListener=new SceneViewImageInfoChangeListener();
  titlePrefix=this.formModel.getTitlePrefix();
  emptyForm=new EmptyImageInfoForm(this);
  toolView.setDisplayName(titlePrefix);
}

Fixed version (ground truth):
public ColorManipulationForm(TopComponent colorManipulationToolView,FormModel formModel){
  Assert.notNull(colorManipulationToolView);
  Assert.notNull(formModel);
  this.toolView=colorManipulationToolView;
  this.formModel=formModel;
  preferences=SnapApp.getDefault().getPreferences();
  productNodeListener=new ColorManipulationPNL();
  sceneViewChangeListener=new SceneViewImageInfoChangeListener();
  titlePrefix=this.formModel.getTitlePrefix();
  emptyForm=new EmptyImageInfoForm(this);
}
Program: 62527
Project: 62527
Buggy source:
/** 
 * 短信模版消息通知
 * @param phoneNumber 接收通知的电话号码
 * @param notifyType  通知类别，通过该枚举值在配置文件中获取相应的模版ID
 * @param params      通知模版内容里的参数，类似"您的验证码为{1}"中{1}的值
 */
@Async public void notifySmsTemplate(String phoneNumber,NotifyType notifyType,String[] params){
  if (wxTemplateSender == null)   return;
  int templateId=Integer.parseInt(getTemplateId(notifyType,smsTemplate));
  smsSender.sendWithTemplate(phoneNumber,templateId,params);
}

Fixed version (ground truth):
/** 
 * 短信模版消息通知
 * @param phoneNumber 接收通知的电话号码
 * @param notifyType  通知类别，通过该枚举值在配置文件中获取相应的模版ID
 * @param params      通知模版内容里的参数，类似"您的验证码为{1}"中{1}的值
 */
@Async public void notifySmsTemplate(String phoneNumber,NotifyType notifyType,String[] params){
  if (smsSender == null)   return;
  int templateId=Integer.parseInt(getTemplateId(notifyType,smsTemplate));
  smsSender.sendWithTemplate(phoneNumber,templateId,params);
}
Program: 62528
Project: 62528
Buggy source:
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_usage:
    if (usageDialogFragment == null) {
      usageDialogFragment=new UsageDialogFragment();
    }
  if (usageDialogFragment.isAdded()) {
    usageDialogFragment.dismiss();
  }
usageDialogFragment.show(getSupportFragmentManager(),"String_Node_Str");
break;
case R.id.action_search:
if (searchDialogFragment == null) {
searchDialogFragment=new SearchDialogFragment();
}
if (searchDialogFragment.isAdded()) {
searchDialogFragment.dismiss();
}
searchDialogFragment.show(getSupportFragmentManager(),"String_Node_Str");
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}

Fixed version (ground truth):
@Override public boolean onOptionsItemSelected(MenuItem item){
switch (item.getItemId()) {
case R.id.action_usage:
    if (usageDialogFragment == null) {
      usageDialogFragment=new UsageDialogFragment();
    }
  if (!isDestroyed() && usageDialogFragment.isAdded()) {
    usageDialogFragment.dismiss();
  }
usageDialogFragment.show(getSupportFragmentManager(),"String_Node_Str");
break;
case R.id.action_search:
if (searchDialogFragment == null) {
searchDialogFragment=new SearchDialogFragment();
}
if (!isDestroyed() && searchDialogFragment.isAdded()) {
searchDialogFragment.dismiss();
}
searchDialogFragment.show(getSupportFragmentManager(),"String_Node_Str");
break;
default :
break;
}
return super.onOptionsItemSelected(item);
}
Program: 62529
Project: 62529
Buggy source:
@Override public void onDestroyView(){
  mPresenter.setProjectCurrentPage(currentPage);
  super.onDestroyView();
}

Fixed version (ground truth):
@Override public void onDestroyView(){
  if (mPresenter != null) {
    mPresenter.setProjectCurrentPage(currentPage);
  }
  super.onDestroyView();
}
Program: 62530
Project: 62530
Buggy source:
@Nullable @Override public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View view=inflater.inflate(getLayoutId(),container,false);
  unBinder=ButterKnife.bind(this,view);
  return view;
}

Fixed version (ground truth):
@Nullable @Override public View onCreateView(LayoutInflater inflater,@Nullable ViewGroup container,@Nullable Bundle savedInstanceState){
  View view=inflater.inflate(getLayoutId(),container,false);
  unBinder=ButterKnife.bind(this,view);
  initView();
  return view;
}
Program: 62531
Project: 62531
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  initRecyclerView();
  mPresenter.getKnowledgeHierarchyData(true);
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  setRefresh();
  mPresenter.getKnowledgeHierarchyData(true);
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62532
Project: 62532
Buggy source:
private void initRecyclerView(){
  mAdapter=new KnowledgeHierarchyAdapter(R.layout.item_knowledge_hierarchy,mKnowledgeHierarchyDataList);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startDetailPager(view,position));
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initRecyclerView(){
  mKnowledgeHierarchyDataList=new ArrayList<>();
  mAdapter=new KnowledgeHierarchyAdapter(R.layout.item_knowledge_hierarchy,mKnowledgeHierarchyDataList);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startDetailPager(view,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
  mRecyclerView.setAdapter(mAdapter);
}
Program: 62533
Project: 62533
Buggy source:
private void startArticleDetailPager(View view,int position){
  if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
    return;
  }
  articlePosition=position;
  mOptions=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
  JudgeUtils.startArticleDetailActivity(_mActivity,mOptions,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle().trim(),mAdapter.getData().get(position).getLink().trim(),mAdapter.getData().get(position).isCollect(),false,false);
}

Fixed version (ground truth):
private void startArticleDetailPager(View view,int position){
  if (mAdapter.getData().size() <= 0 || mAdapter.getData().size() <= position) {
    return;
  }
  articlePosition=position;
  ActivityOptions options=ActivityOptions.makeSceneTransitionAnimation(_mActivity,view,getString(R.string.share_view));
  JudgeUtils.startArticleDetailActivity(_mActivity,options,mAdapter.getData().get(position).getId(),mAdapter.getData().get(position).getTitle().trim(),mAdapter.getData().get(position).getLink().trim(),mAdapter.getData().get(position).isCollect(),false,false);
}
Program: 62534
Project: 62534
Buggy source:
@Override protected void initEventAndData(){
  super.initEventAndData();
  isInnerFragment=true;
  setRefresh();
  Bundle bundle=getArguments();
  id=bundle.getInt(Constants.ARG_PARAM1,0);
  if (id == 0) {
    return;
  }
  mCurrentPage=0;
  mPresenter.getKnowledgeHierarchyDetailData(mCurrentPage,id,true);
  initRecyclerView();
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}

Fixed version (ground truth):
@Override protected void initEventAndData(){
  super.initEventAndData();
  isInnerFragment=true;
  setRefresh();
  Bundle bundle=getArguments();
  id=bundle.getInt(Constants.ARG_PARAM1,0);
  if (id == 0) {
    return;
  }
  mCurrentPage=0;
  mPresenter.getKnowledgeHierarchyDetailData(mCurrentPage,id,true);
  if (CommonUtils.isNetworkConnected()) {
    showLoading();
  }
}
Program: 62535
Project: 62535
Buggy source:
private void initRecyclerView(){
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,mArticles);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startArticleDetailPager(view,position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setAdapter(mAdapter);
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
}

Fixed version (ground truth):
private void initRecyclerView(){
  mAdapter=new ArticleListAdapter(R.layout.item_search_pager,null);
  mAdapter.setOnItemClickListener((adapter,view,position) -> startArticleDetailPager(view,position));
  mAdapter.setOnItemChildClickListener((adapter,view,position) -> clickChildEvent(view,position));
  mRecyclerView.setLayoutManager(new LinearLayoutManager(_mActivity));
  mRecyclerView.setHasFixedSize(true);
  mRecyclerView.setAdapter(mAdapter);
}
Program: 62536
Project: 62536
Buggy source:
@Override public void showKnowledgeHierarchyDetailData(FeedArticleListData feedArticleListData){
  mArticles=feedArticleListData.getDatas();
  if (isRefresh) {
    mAdapter.replaceData(mArticles);
  }
 else {
    if (mArticles.size() > 0) {
      mAdapter.addData(mArticles);
    }
 else {
      CommonUtils.showMessage(_mActivity,getString(R.string.load_more_no_data));
    }
  }
  showNormal();
}

Fixed version (ground truth):
@Override public void showKnowledgeHierarchyDetailData(FeedArticleListData feedArticleListData){
  if (isRefresh) {
    mAdapter.replaceData(feedArticleListData.getDatas());
  }
 else {
    if (feedArticleListData.getDatas().size() > 0) {
      mAdapter.addData(feedArticleListData.getDatas());
    }
 else {
      CommonUtils.showMessage(_mActivity,getString(R.string.load_more_no_data));
    }
  }
  showNormal();
}