nus-yam/ex-repair huggingface dataset:
Program: 29710
Project: 29710
Buggy source:
public String getFlashScript(String version,String model){
  FilenameFilter fscFilter=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return (name.toLowerCase().equals(filter.toLowerCase()));
    }
  }
;
  File mydevices=new File(this.getMyDeviceDir());
  File devices=new File(this.getDeviceDir());
  File[] fsc;
  filter=model + "String_Node_Str" + version+ "String_Node_Str";
  fsc=mydevices.listFiles(fscFilter);
  if (fsc.length > 0)   return fsc[0].getAbsolutePath();
  fsc=devices.listFiles(fscFilter);
  if (fsc.length > 0)   return fsc[0].getAbsolutePath();
  String[] vnumbers=version.split("String_Node_Str");
  for (int i=vnumbers.length; i > 0; i--) {
    filter="String_Node_Str";
    for (int j=0; j < i; j++) {
      filter=filter + (j > 0 ? "String_Node_Str" : "String_Node_Str") + vnumbers[j];
    }
    filter=filter + "String_Node_Str";
    fsc=mydevices.listFiles(fscFilter);
    if (fsc.length > 0)     return fsc[0].getAbsolutePath();
    fsc=devices.listFiles(fscFilter);
    if (fsc.length > 0)     return fsc[0].getAbsolutePath();
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getFlashScript(String version,String model){
  FilenameFilter fscFilter=new FilenameFilter(){
    public boolean accept(    File dir,    String name){
      return (name.toLowerCase().equals(filter.toLowerCase()));
    }
  }
;
  File mydevices=new File(this.getMyDeviceDir());
  File devices=new File(this.getDeviceDir());
  File[] fsc;
  filter=model + "String_Node_Str" + version+ "String_Node_Str";
  if (mydevices.exists()) {
    fsc=mydevices.listFiles(fscFilter);
    if (fsc.length > 0)     return fsc[0].getAbsolutePath();
  }
  fsc=devices.listFiles(fscFilter);
  if (fsc.length > 0)   return fsc[0].getAbsolutePath();
  String[] vnumbers=version.split("String_Node_Str");
  for (int i=vnumbers.length; i > 0; i--) {
    filter="String_Node_Str";
    for (int j=0; j < i; j++) {
      filter=filter + (j > 0 ? "String_Node_Str" : "String_Node_Str") + vnumbers[j];
    }
    filter=filter + "String_Node_Str";
    if (mydevices.exists()) {
      fsc=mydevices.listFiles(fscFilter);
      if (fsc.length > 0)       return fsc[0].getAbsolutePath();
    }
    fsc=devices.listFiles(fscFilter);
    if (fsc.length > 0)     return fsc[0].getAbsolutePath();
  }
  return "String_Node_Str";
}
Program: 29714
Project: 29714
Buggy source:
public void flashDevice(){
  try {
    logger.info("String_Node_Str");
    if (!_bundle.hasLoader() || modded_loader) {
      if (modded_loader)       logger.info("String_Node_Str");
 else       logger.info("String_Node_Str");
      String loader=getDefaultLoader();
      if (new File(loader).exists()) {
        _bundle.setLoader(new File(loader));
      }
 else       logger.info("String_Node_Str");
    }
    sendLoader();
    bc=getBootConfig();
    loadTAFiles();
    if (hasScript()) {
      if (checkScript())       runScript();
    }
 else {
      logger.info("String_Node_Str");
      oldFlashEngine();
    }
    logger.info("String_Node_Str");
    logger.info("String_Node_Str");
    logger.info("String_Node_Str");
    LogProgress.initProgress(0);
  }
 catch (  Exception ioe) {
    ioe.printStackTrace();
    closeDevice();
    logger.error(ioe.getMessage());
    logger.error("String_Node_Str");
    LogProgress.initProgress(0);
  }
}

Fixed version (ground truth):
public void flashDevice(){
  try {
    logger.info("String_Node_Str");
    sendLoader();
    bc=getBootConfig();
    loadTAFiles();
    if (hasScript()) {
      if (checkScript())       runScript();
    }
 else {
      logger.info("String_Node_Str");
      oldFlashEngine();
    }
    logger.info("String_Node_Str");
    logger.info("String_Node_Str");
    logger.info("String_Node_Str");
    LogProgress.initProgress(0);
  }
 catch (  Exception ioe) {
    ioe.printStackTrace();
    closeDevice();
    logger.error(ioe.getMessage());
    logger.error("String_Node_Str");
    LogProgress.initProgress(0);
  }
}
Program: 29716
Project: 29716
Buggy source:
public AutoExpandBrowserPrefix(MutatingVisitController visitController,ErrorManager errorManager){
  this.visitController=visitController;
  this.errorManager=errorManager;
  this.expansionRules=BrowserPrefixGenerator.getExpansionRules();
}

Fixed version (ground truth):
public AutoExpandBrowserPrefix(MutatingVisitController visitController){
  this.visitController=visitController;
  this.expansionRules=BrowserPrefixGenerator.getExpansionRules();
}
Program: 29717
Project: 29717
Buggy source:
@Override protected void runPass(){
  new CreateMixins(tree.getMutatingVisitController(),errorManager).runPass();
  new CreateConstantReferences(tree.getMutatingVisitController()).runPass();
  new CreateDefinitionNodes(tree.getMutatingVisitController(),errorManager).runPass();
  new CreateComponentNodes(tree.getMutatingVisitController(),errorManager).runPass();
  new AutoExpandBrowserPrefix(tree.getMutatingVisitController(),errorManager).runPass();
  CollectMixinDefinitions collectDefinitions=new CollectMixinDefinitions(tree.getMutatingVisitController(),errorManager);
  collectDefinitions.runPass();
  new ReplaceMixins(tree.getMutatingVisitController(),errorManager,collectDefinitions.getDefinitions()).runPass();
  new ProcessComponents<Object>(tree.getMutatingVisitController(),errorManager).runPass();
  CollectConstantDefinitions collectConstantDefinitionsPass=new CollectConstantDefinitions(tree);
  collectConstantDefinitionsPass.runPass();
  ReplaceConstantReferences replaceConstantReferences=new ReplaceConstantReferences(tree,collectConstantDefinitionsPass.getConstantDefinitions(),true,errorManager,false);
  replaceConstantReferences.runPass();
}

Fixed version (ground truth):
@Override protected void runPass(){
  new CreateMixins(tree.getMutatingVisitController(),errorManager).runPass();
  new CreateConstantReferences(tree.getMutatingVisitController()).runPass();
  new CreateDefinitionNodes(tree.getMutatingVisitController(),errorManager).runPass();
  new CreateComponentNodes(tree.getMutatingVisitController(),errorManager).runPass();
  new AutoExpandBrowserPrefix(tree.getMutatingVisitController()).runPass();
  CollectMixinDefinitions collectDefinitions=new CollectMixinDefinitions(tree.getMutatingVisitController(),errorManager);
  collectDefinitions.runPass();
  new ReplaceMixins(tree.getMutatingVisitController(),errorManager,collectDefinitions.getDefinitions()).runPass();
  new ProcessComponents<Object>(tree.getMutatingVisitController(),errorManager).runPass();
  CollectConstantDefinitions collectConstantDefinitionsPass=new CollectConstantDefinitions(tree);
  collectConstantDefinitionsPass.runPass();
  ReplaceConstantReferences replaceConstantReferences=new ReplaceConstantReferences(tree,collectConstantDefinitionsPass.getConstantDefinitions(),true,errorManager,false);
  replaceConstantReferences.runPass();
}
Program: 29718
Project: 29718
Buggy source:
/** 
 * Finishes the source mapping for the given node at the current position. This is intended to be called immediately after the whole node is written to the buffer.
 * @param node the {@link CssNode} to be processed
 * @param endLine the last character's line number when it ends writing output
 * @param endCharIndex the last character's character index when it ends writing output
 */
@Override public void endSourceMapping(CssNode node,int endLine,int endCharIndex){
  Preconditions.checkState(node != null);
  Preconditions.checkState(endLine >= 0);
  Preconditions.checkState(endCharIndex >= 0);
  if (!mappings.isEmpty() && mappings.peek().node == node) {
    Mapping mapping=mappings.pop();
    mapping.end=new FilePosition(endLine,endCharIndex);
  }
}

Fixed version (ground truth):
/** 
 * Finishes the source mapping for the given node at the current position. This is intended to be called immediately after the whole node is written to the buffer.
 * @param node the {@link CssNode} to be processed
 * @param endLine the last character's line number when it ends writing output
 * @param endCharIndex the last character's character index when it ends writing output
 */
@Override public void endSourceMapping(CssNode node,int endLine,int endCharIndex){
  Preconditions.checkState(node != null);
  Preconditions.checkState(endLine >= 0);
  Preconditions.checkState(endCharIndex >= -1);
  if (!mappings.isEmpty() && mappings.peek().node == node) {
    Mapping mapping=mappings.pop();
    mapping.end=new FilePosition(endLine,endCharIndex);
  }
}
Program: 29719
Project: 29719
Buggy source:
/** 
 * Finishes the source mapping for the given node at the current position. This is intended to be called immediately after the whole node is written to the buffer.
 * @param node the {@link CssNode} to be processed
 * @param endLine the last character's line number when it ends writing output
 * @param endCharIndex the last character's character index when it ends writing output
 */
public void endSourceMapping(CssNode node,int endLine,int endCharIndex);

Fixed version (ground truth):
/** 
 * Finishes the source mapping for the given node at the current position. This is intended to be called immediately after the whole node is written to the buffer.
 * @param node the {@link CssNode} to be processed
 * @param endLine the last character's line number when it ends writing output
 * @param endCharIndex the last character's character index when it ends writing outputor one less than the corresponding  {@link #startSourceMapping startCharIndex} ifa source mapping is empty.
 */
public void endSourceMapping(CssNode node,int endLine,int endCharIndex);
Program: 29720
Project: 29720
Buggy source:
/** 
 * @return a map from each GSS function name to the function
 */
public static Map<String,GssFunction> getFunctionMap(){
  return ImmutableMap.<String,GssFunction>builder().put("String_Node_Str",new GssFunctions.AddToNumericValue()).put("String_Node_Str",new GssFunctions.SubtractFromNumericValue()).put("String_Node_Str",new GssFunctions.Mult()).put("String_Node_Str",new GssFunctions.Div()).put("String_Node_Str",new GssFunctions.MinValue()).put("String_Node_Str",new GssFunctions.MaxValue()).put("String_Node_Str",new GssFunctions.AddScalar()).put("String_Node_Str",new GssFunctions.SubtractScalar()).put("String_Node_Str",new BlendColorsHsb()).put("String_Node_Str",new BlendColorsRgb()).put("String_Node_Str",new MakeMutedColor()).put("String_Node_Str",new AddHsbToCssColor()).put("String_Node_Str",new MakeContrastingColor()).put("String_Node_Str",new AdjustBrightness()).put("String_Node_Str",new SelectFrom()).build();
}

Fixed version (ground truth):
/** 
 * @return a map from each GSS function name to the function
 */
public static Map<String,GssFunction> getFunctionMap(){
  return ImmutableMap.<String,GssFunction>builder().put("String_Node_Str",new GssFunctions.AddToNumericValue()).put("String_Node_Str",new GssFunctions.SubtractFromNumericValue()).put("String_Node_Str",new GssFunctions.Mult()).put("String_Node_Str",new GssFunctions.Div()).put("String_Node_Str",new GssFunctions.MinValue()).put("String_Node_Str",new GssFunctions.MaxValue()).put("String_Node_Str",new BlendColorsHsb()).put("String_Node_Str",new BlendColorsRgb()).put("String_Node_Str",new MakeMutedColor()).put("String_Node_Str",new AddHsbToCssColor()).put("String_Node_Str",new MakeContrastingColor()).put("String_Node_Str",new AdjustBrightness()).put("String_Node_Str",new SelectFrom()).build();
}
Program: 29721
Project: 29721
Buggy source:
public void testMultGetCallResultString_noUnits() throws GssFunctionException {
  GssFunctions.Mult funct=new GssFunctions.Mult();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  GssFunctions.SubtractScalar subtractScalar=new GssFunctions.SubtractScalar();
  assertEquals("String_Node_Str",subtractScalar.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  GssFunctions.AddScalar addScalar=new GssFunctions.AddScalar();
  assertEquals("String_Node_Str",addScalar.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
public void testMultGetCallResultString_noUnits() throws GssFunctionException {
  GssFunctions.Mult funct=new GssFunctions.Mult();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}
Program: 29722
Project: 29722
Buggy source:
public void testAddGetCallResultString() throws GssFunctionException {
  GssFunctions.AddToNumericValue funct=new GssFunctions.AddToNumericValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
public void testAddGetCallResultString() throws GssFunctionException {
  GssFunctions.AddToNumericValue funct=new GssFunctions.AddToNumericValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}
Program: 29723
Project: 29723
Buggy source:
public void testMaxGetCallResultString() throws GssFunctionException {
  GssFunctions.MaxValue funct=new GssFunctions.MaxValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
public void testMaxGetCallResultString() throws GssFunctionException {
  GssFunctions.MaxValue funct=new GssFunctions.MaxValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}
Program: 29724
Project: 29724
Buggy source:
public void testMinGetCallResultString() throws GssFunctionException {
  GssFunctions.MinValue funct=new GssFunctions.MinValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
public void testMinGetCallResultString() throws GssFunctionException {
  GssFunctions.MinValue funct=new GssFunctions.MinValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}
Program: 29725
Project: 29725
Buggy source:
public void testSubGetCallResultString() throws GssFunctionException {
  GssFunctions.SubtractFromNumericValue funct=new GssFunctions.SubtractFromNumericValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}

Fixed version (ground truth):
public void testSubGetCallResultString() throws GssFunctionException {
  GssFunctions.SubtractFromNumericValue funct=new GssFunctions.SubtractFromNumericValue();
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
  assertEquals("String_Node_Str",funct.getCallResultString(ImmutableList.of("String_Node_Str","String_Node_Str")));
}
Program: 29726
Project: 29726
Buggy source:
private static Size parseSize(String sizeWithUnits) throws GssFunctionException {
  int unitIndex=CharMatcher.JAVA_LETTER.indexIn(sizeWithUnits);
  String size=unitIndex > 0 ? sizeWithUnits.substring(0,unitIndex) : sizeWithUnits;
  String units=unitIndex > 0 ? sizeWithUnits.substring(unitIndex) : CssNumericNode.NO_UNITS;
  checkSize(size,units,null,null);
  return new Size(size,units);
}

Fixed version (ground truth):
private static Size parseSize(String sizeWithUnits,boolean isUnitOptional) throws GssFunctionException {
  int unitIndex=CharMatcher.JAVA_LETTER.indexIn(sizeWithUnits);
  String size=unitIndex > 0 ? sizeWithUnits.substring(0,unitIndex) : sizeWithUnits;
  String units=unitIndex > 0 ? sizeWithUnits.substring(unitIndex) : CssNumericNode.NO_UNITS;
  checkSize(size,units,null,null,isUnitOptional);
  return new Size(size,units);
}
Program: 29727
Project: 29727
Buggy source:
protected CssClassSelectorNode(CssClassSelectorNode node){
  this(node.refinerName,node.getSourceCodeLocation());
}

Fixed version (ground truth):
protected CssClassSelectorNode(CssClassSelectorNode node){
  this(node.refinerName,node.getSourceCodeLocation());
  this.setComments(node.getComments());
}
Program: 29728
Project: 29728
Buggy source:
public void testDeepCopy(){
  SourceCode sourceCode=new SourceCode("String_Node_Str",null);
  SourceCodeLocation location=new SourceCodeLocation(sourceCode,1,1,1,2,1,1);
  CssSelectorNode node=new CssSelectorNode("String_Node_Str",location);
  node.setChunk("String_Node_Str");
  CssClassSelectorNode refiner=new CssClassSelectorNode("String_Node_Str",location);
  node.getRefiners().addChildToBack(refiner);
  CssSelectorNode copy=node.deepCopy();
  assertEquals(node.getChunk(),copy.getChunk());
  assertEquals(node.getSelectorName(),copy.getSelectorName());
  assertEquals(node.getSourceCodeLocation(),copy.getSourceCodeLocation());
}

Fixed version (ground truth):
public void testDeepCopy(){
  SourceCode sourceCode=new SourceCode("String_Node_Str",null);
  SourceCodeLocation location=new SourceCodeLocation(sourceCode,1,1,1,2,1,1);
  CssSelectorNode node=new CssSelectorNode("String_Node_Str",location);
  node.setChunk("String_Node_Str");
  CssClassSelectorNode refiner=new CssClassSelectorNode("String_Node_Str",location);
  node.getRefiners().addChildToBack(refiner);
  refiner.appendComment(new CssCommentNode("String_Node_Str",null));
  CssSelectorNode copy=node.deepCopy();
  assertEquals(node.getChunk(),copy.getChunk());
  assertEquals(node.getSelectorName(),copy.getSelectorName());
  assertEquals(node.getSourceCodeLocation(),copy.getSourceCodeLocation());
  assertEquals(node.getRefiners().getChildAt(0).getComments(),copy.getRefiners().getChildAt(0).getComments());
}
Program: 29729
Project: 29729
Buggy source:
public float[] getStateAsHSV(){
  if (state == null) {
    float[] result={0,0,0};
    return result;
  }
  String[] stateSplit=state.split("String_Node_Str");
  if (stateSplit.length == 3) {
    float[] result={Float.parseFloat(stateSplit[0]),Float.parseFloat(stateSplit[1]) / 100,Float.parseFloat(stateSplit[2]) / 100};
    return result;
  }
 else {
    float[] result={0,0,0};
    return result;
  }
}

Fixed version (ground truth):
public float[] getStateAsHSV(){
  if (state == null) {
    return new float[]{0,0,0};
  }
  String[] stateSplit=state.split("String_Node_Str");
  if (stateSplit.length == 3) {
    return new float[]{Float.parseFloat(stateSplit[0]),Float.parseFloat(stateSplit[1]) / 100,Float.parseFloat(stateSplit[2]) / 100};
  }
 else {
    return new float[]{0,0,0};
  }
}
Program: 29730
Project: 29730
Buggy source:
/** 
 * If fullscreen is enabled and we are on at least android 4.4 set the system visibility to fullscreen + immersive + noNav
 * @author Dan Cunningham
 */
protected void checkFullscreen(){
  if (isFullscreenEnabled()) {
    int uiOptions=getWindow().getDecorView().getSystemUiVisibility();
    uiOptions|=View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    uiOptions|=View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
    uiOptions|=View.SYSTEM_UI_FLAG_FULLSCREEN;
    getWindow().getDecorView().setSystemUiVisibility(uiOptions);
  }
}

Fixed version (ground truth):
/** 
 * If fullscreen is enabled and we are on at least android 4.4 set the system visibility to fullscreen + immersive + noNav
 * @author Dan Cunningham
 */
protected void checkFullscreen(){
  if (isFullscreenEnabled()) {
    int uiOptions=getWindow().getDecorView().getSystemUiVisibility();
    uiOptions|=View.SYSTEM_UI_FLAG_HIDE_NAVIGATION;
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
      uiOptions|=View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
      uiOptions|=View.SYSTEM_UI_FLAG_FULLSCREEN;
    }
    getWindow().getDecorView().setSystemUiVisibility(uiOptions);
  }
}
Program: 29731
Project: 29731
Buggy source:
private void loadDrawerItems(){
  mDrawerItemList.clear();
  if (mSitemapList != null) {
    mDrawerItemList.add(OpenHABDrawerItem.headerItem(getString(R.string.mainmenu_openhab_sitemaps)));
    for (    OpenHABSitemap sitemap : mSitemapList) {
      mDrawerItemList.add(new OpenHABDrawerItem(sitemap));
    }
  }
  mDrawerItemList.add(OpenHABDrawerItem.dividerItem());
  int iconColor=ContextCompat.getColor(this,R.color.colorAccent_themeDark);
  Drawable notificationDrawable=getResources().getDrawable(R.drawable.ic_notifications_black_24dp);
  notificationDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  if (getNotificationSettings() != null) {
    mDrawerItemList.add(OpenHABDrawerItem.menuItem("String_Node_Str",notificationDrawable,DRAWER_NOTIFICATIONS));
  }
  Drawable settingsDrawable=getResources().getDrawable(R.drawable.ic_settings_black_24dp);
  settingsDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  mDrawerItemList.add(OpenHABDrawerItem.menuItem(getString(R.string.mainmenu_openhab_preferences),settingsDrawable,DRAWER_PREFERENCES));
  Drawable aboutDrawable=getResources().getDrawable(R.drawable.ic_info_outline);
  aboutDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  mDrawerItemList.add(OpenHABDrawerItem.menuItem(getString(R.string.about_title),aboutDrawable,DRAWER_ABOUT));
  mDrawerAdapter.notifyDataSetChanged();
}

Fixed version (ground truth):
private void loadDrawerItems(){
  mDrawerItemList.clear();
  if (mSitemapList != null) {
    mDrawerItemList.add(OpenHABDrawerItem.headerItem(getString(R.string.mainmenu_openhab_sitemaps)));
    for (    OpenHABSitemap sitemap : mSitemapList) {
      mDrawerItemList.add(new OpenHABDrawerItem(sitemap));
    }
  }
  mDrawerItemList.add(OpenHABDrawerItem.dividerItem());
  int iconColor=ContextCompat.getColor(this,R.color.colorAccent_themeDark);
  Drawable notificationDrawable=getResources().getDrawable(R.drawable.ic_notifications_black_24dp);
  notificationDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  if (getNotificationSettings() != null) {
    mDrawerItemList.add(OpenHABDrawerItem.menuItem(getString(R.string.app_notifications),notificationDrawable,DRAWER_NOTIFICATIONS));
  }
  Drawable settingsDrawable=getResources().getDrawable(R.drawable.ic_settings_black_24dp);
  settingsDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  mDrawerItemList.add(OpenHABDrawerItem.menuItem(getString(R.string.mainmenu_openhab_preferences),settingsDrawable,DRAWER_PREFERENCES));
  Drawable aboutDrawable=getResources().getDrawable(R.drawable.ic_info_outline);
  aboutDrawable.setColorFilter(iconColor,PorterDuff.Mode.SRC_IN);
  mDrawerItemList.add(OpenHABDrawerItem.menuItem(getString(R.string.about_title),aboutDrawable,DRAWER_ABOUT));
  mDrawerAdapter.notifyDataSetChanged();
}
Program: 29733
Project: 29733
Buggy source:
@Override public boolean verify(String hostname,SSLSession session){
  return true;
}

Fixed version (ground truth):
@SuppressLint("String_Node_Str") @Override public boolean verify(String hostname,SSLSession session){
  return true;
}
Program: 29734
Project: 29734
Buggy source:
public boolean isVolumeHandled(){
  return openHABWidgetAdapter.isVolumeHandled();
}

Fixed version (ground truth):
public boolean isVolumeHandled(){
  if (openHABWidgetAdapter != null) {
    return openHABWidgetAdapter.isVolumeHandled();
  }
  return false;
}
Program: 29735
Project: 29735
Buggy source:
public boolean onVolumeDown(){
  return openHABWidgetAdapter.onVolumeDown();
}

Fixed version (ground truth):
public boolean onVolumeDown(){
  if (openHABWidgetAdapter != null) {
    return openHABWidgetAdapter.onVolumeDown();
  }
  return false;
}
Program: 29736
Project: 29736
Buggy source:
public boolean onVolumeUp(){
  return openHABWidgetAdapter.onVolumeUp();
}

Fixed version (ground truth):
public boolean onVolumeUp(){
  if (openHABWidgetAdapter != null) {
    return openHABWidgetAdapter.onVolumeUp();
  }
  return false;
}
Program: 29738
Project: 29738
Buggy source:
@Override public void onSuccess(int statusCode,Header[] headers,Document document){
  for (int i=0; i < headers.length; i++) {
    Log.i(TAG,headers[i].getName() + "String_Node_Str" + headers[i].getValue());
    if (headers[i].getName().equalsIgnoreCase("String_Node_Str")) {
      Log.i(TAG,"String_Node_Str" + headers[i].getValue());
      OpenHABWidgetListFragment.this.mAtmosphereTrackingId=headers[i].getValue();
    }
  }
  if (document != null) {
    Log.d(TAG,"String_Node_Str" + document.toString());
    if (!longPolling)     stopProgressIndicator();
    processContent(document,longPolling);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    showPage(displayPageUrl,true);
  }
}

Fixed version (ground truth):
@Override public void onSuccess(int statusCode,Header[] headers,Document document){
  for (int i=0; i < headers.length; i++) {
    if (headers[i].getName().equalsIgnoreCase("String_Node_Str")) {
      Log.i(TAG,"String_Node_Str" + headers[i].getValue());
      OpenHABWidgetListFragment.this.mAtmosphereTrackingId=headers[i].getValue();
    }
  }
  if (document != null) {
    if (!longPolling)     stopProgressIndicator();
    processContent(document,longPolling);
  }
 else {
    Log.e(TAG,"String_Node_Str");
    showPage(displayPageUrl,true);
  }
}
Program: 29741
Project: 29741
Buggy source:
public void clearSelection(){
  if (getListView() != null && this.isVisible()) {
    getListView().clearChoices();
    getListView().requestLayout();
  }
}

Fixed version (ground truth):
public void clearSelection(){
  if (getListView() != null && this.isVisible() && isAdded()) {
    getListView().clearChoices();
    getListView().requestLayout();
  }
}
Program: 29742
Project: 29742
Buggy source:
public void clearSelection(){
  getListView().clearChoices();
  getListView().requestLayout();
}

Fixed version (ground truth):
public void clearSelection(){
  if (getListView() != null) {
    getListView().clearChoices();
    getListView().requestLayout();
  }
}
Program: 29743
Project: 29743
Buggy source:
public void sendItemCommand(OpenHABItem item,String command){
  try {
    StringEntity se=new StringEntity(command);
    mAsyncHttpClient.post(getContext(),item.getLink(),se,"String_Node_Str",new AsyncHttpResponseHandler(){
      @Override public void onSuccess(      String response){
        Log.d(TAG,"String_Node_Str");
      }
      @Override public void onFailure(      Throwable error,      String errorResponse){
        Log.e(TAG,"String_Node_Str" + error.getMessage());
        if (errorResponse != null)         Log.e(TAG,"String_Node_Str" + errorResponse);
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    if (e != null)     Log.e(TAG,e.getMessage());
  }
}

Fixed version (ground truth):
public void sendItemCommand(OpenHABItem item,String command){
  try {
    if (item != null && command != null) {
      StringEntity se=new StringEntity(command);
      mAsyncHttpClient.post(getContext(),item.getLink(),se,"String_Node_Str",new AsyncHttpResponseHandler(){
        @Override public void onSuccess(        String response){
          Log.d(TAG,"String_Node_Str");
        }
        @Override public void onFailure(        Throwable error,        String errorResponse){
          Log.e(TAG,"String_Node_Str" + error.getMessage());
          if (errorResponse != null)           Log.e(TAG,"String_Node_Str" + errorResponse);
        }
      }
);
    }
  }
 catch (  UnsupportedEncodingException e) {
    if (e != null)     Log.e(TAG,e.getMessage());
  }
}
Program: 29745
Project: 29745
Buggy source:
private void showCertificateDialog(final int decisionId,String certMessage){
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(certMessage).setTitle(R.string.mtm_accept_cert);
  builder.setPositiveButton(R.string.mtm_decision_always,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ALWAYS);
    }
  }
);
  builder.setNeutralButton(R.string.mtm_decision_once,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ONCE);
    }
  }
);
  builder.setNegativeButton(R.string.mtm_decision_abort,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ABORT);
    }
  }
);
  AlertDialog certAlert=builder.create();
  certAlert.show();
}

Fixed version (ground truth):
private void showCertificateDialog(final int decisionId,String certMessage){
  if (this.isFinishing())   return;
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(certMessage).setTitle(R.string.mtm_accept_cert);
  builder.setPositiveButton(R.string.mtm_decision_always,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ALWAYS);
    }
  }
);
  builder.setNeutralButton(R.string.mtm_decision_once,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ONCE);
    }
  }
);
  builder.setNegativeButton(R.string.mtm_decision_abort,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ABORT);
    }
  }
);
  AlertDialog certAlert=builder.create();
  certAlert.show();
}
Program: 29746
Project: 29746
Buggy source:
@Override protected Boolean doInBackground(String... strings){
  try {
    URL url=new URL(strings[0]);
    Socket s=new Socket();
    s.connect(new InetSocketAddress(url.getHost(),url.getPort()),1000);
    Log.d(TAG,"String_Node_Str");
    s.close();
    return true;
  }
 catch (  MalformedURLException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
catch (  IOException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
@Override protected Boolean doInBackground(String... strings){
  try {
    URL url=new URL(strings[0]);
    int checkPort=url.getPort();
    if (url.getProtocol().equals("String_Node_Str") && checkPort == -1)     checkPort=80;
    if (url.getProtocol().equals("String_Node_Str") && checkPort == -1)     checkPort=443;
    Socket s=new Socket();
    s.connect(new InetSocketAddress(url.getHost(),checkPort),1000);
    Log.d(TAG,"String_Node_Str");
    s.close();
    return true;
  }
 catch (  MalformedURLException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
catch (  IOException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
}
Program: 29747
Project: 29747
Buggy source:
private boolean checkUrlReachability(String urlString){
  Log.d(TAG,"String_Node_Str" + urlString);
  try {
    return new AsyncTask<String,Void,Boolean>(){
      @Override protected Boolean doInBackground(      String... strings){
        try {
          URL url=new URL(strings[0]);
          Socket s=new Socket();
          s.connect(new InetSocketAddress(url.getHost(),url.getPort()),1000);
          Log.d(TAG,"String_Node_Str");
          s.close();
          return true;
        }
 catch (        MalformedURLException e) {
          Log.e(TAG,e.getMessage());
          return false;
        }
catch (        IOException e) {
          Log.e(TAG,e.getMessage());
          return false;
        }
      }
    }
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,urlString).get();
  }
 catch (  InterruptedException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
catch (  ExecutionException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
}

Fixed version (ground truth):
private boolean checkUrlReachability(String urlString){
  Log.d(TAG,"String_Node_Str" + urlString);
  try {
    return new AsyncTask<String,Void,Boolean>(){
      @Override protected Boolean doInBackground(      String... strings){
        try {
          URL url=new URL(strings[0]);
          int checkPort=url.getPort();
          if (url.getProtocol().equals("String_Node_Str") && checkPort == -1)           checkPort=80;
          if (url.getProtocol().equals("String_Node_Str") && checkPort == -1)           checkPort=443;
          Socket s=new Socket();
          s.connect(new InetSocketAddress(url.getHost(),checkPort),1000);
          Log.d(TAG,"String_Node_Str");
          s.close();
          return true;
        }
 catch (        MalformedURLException e) {
          Log.e(TAG,e.getMessage());
          return false;
        }
catch (        IOException e) {
          Log.e(TAG,e.getMessage());
          return false;
        }
      }
    }
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,urlString).get();
  }
 catch (  InterruptedException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
catch (  ExecutionException e) {
    Log.e(TAG,e.getMessage());
    return false;
  }
}
Program: 29748
Project: 29748
Buggy source:
public String getTitle(){
  String[] splitString;
  if (title != null) {
    splitString=title.split("String_Node_Str");
    return splitString[0];
  }
  return "String_Node_Str";
}

Fixed version (ground truth):
public String getTitle(){
  String[] splitString;
  if (title != null) {
    splitString=title.split("String_Node_Str");
    if (splitString.length > 0) {
      return splitString[0];
    }
 else {
      return title;
    }
  }
  return "String_Node_Str";
}
Program: 29749
Project: 29749
Buggy source:
@Override protected void onHandleIntent(Intent intent){
  Bundle extras=intent.getExtras();
  int notificationId;
  if (mNotificationManager == null)   mNotificationManager=(NotificationManager)this.getSystemService(Context.NOTIFICATION_SERVICE);
  GoogleCloudMessaging gcm=GoogleCloudMessaging.getInstance(this);
  String messageType=gcm.getMessageType(intent);
  Log.d(TAG,"String_Node_Str" + messageType);
  if (!extras.isEmpty()) {
    if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
      if (!intent.hasExtra("String_Node_Str")) {
        notificationId=1;
      }
 else {
        notificationId=Integer.parseInt(intent.getExtras().getString("String_Node_Str"));
      }
      if (intent.getExtras().getString("String_Node_Str").equals("String_Node_Str")) {
        sendNotification(intent.getExtras().getString("String_Node_Str"),notificationId);
      }
 else       if (intent.getExtras().getString("String_Node_Str").equals("String_Node_Str")) {
        mNotificationManager.cancel(Integer.parseInt(intent.getExtras().getString("String_Node_Str")));
      }
    }
  }
  GcmBroadcastReceiver.completeWakefulIntent(intent);
}

Fixed version (ground truth):
@Override protected void onHandleIntent(Intent intent){
  Bundle extras=intent.getExtras();
  if (extras == null)   return;
  int notificationId;
  if (mNotificationManager == null)   mNotificationManager=(NotificationManager)this.getSystemService(Context.NOTIFICATION_SERVICE);
  GoogleCloudMessaging gcm=GoogleCloudMessaging.getInstance(this);
  String messageType=gcm.getMessageType(intent);
  Log.d(TAG,"String_Node_Str" + messageType);
  if (!extras.isEmpty()) {
    if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) {
      if (!intent.hasExtra("String_Node_Str")) {
        notificationId=1;
      }
 else {
        notificationId=Integer.parseInt(intent.getExtras().getString("String_Node_Str"));
      }
      if (intent.getExtras().getString("String_Node_Str").equals("String_Node_Str")) {
        sendNotification(intent.getExtras().getString("String_Node_Str"),notificationId);
      }
 else       if (intent.getExtras().getString("String_Node_Str").equals("String_Node_Str")) {
        mNotificationManager.cancel(Integer.parseInt(intent.getExtras().getString("String_Node_Str")));
      }
    }
  }
  GcmBroadcastReceiver.completeWakefulIntent(intent);
}
Program: 29750
Project: 29750
Buggy source:
public void setSourceNode(Node rootNode){
  Log.i(TAG,"String_Node_Str");
  rootWidget=new OpenHABWidget();
  rootWidget.setType("String_Node_Str");
  if (rootNode.hasChildNodes()) {
    NodeList childNodes=rootNode.getChildNodes();
    for (int i=0; i < childNodes.getLength(); i++) {
      Node childNode=childNodes.item(i);
      if (childNode.getNodeName().equals("String_Node_Str")) {
        new OpenHABWidget(rootWidget,childNode);
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setTitle(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setId(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setIcon(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setLink(childNode.getTextContent());
      }
    }
  }
}

Fixed version (ground truth):
public void setSourceNode(Node rootNode){
  Log.i(TAG,"String_Node_Str");
  if (rootNode == null)   return;
  rootWidget=new OpenHABWidget();
  rootWidget.setType("String_Node_Str");
  if (rootNode.hasChildNodes()) {
    NodeList childNodes=rootNode.getChildNodes();
    for (int i=0; i < childNodes.getLength(); i++) {
      Node childNode=childNodes.item(i);
      if (childNode.getNodeName().equals("String_Node_Str")) {
        new OpenHABWidget(rootWidget,childNode);
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setTitle(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setId(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setIcon(childNode.getTextContent());
      }
 else       if (childNode.getNodeName().equals("String_Node_Str")) {
        this.setLink(childNode.getTextContent());
      }
    }
  }
}
Program: 29752
Project: 29752
Buggy source:
public void onItemSelected(AdapterView<?> parent,View view,int index,long id){
  Log.d(TAG,"String_Node_Str" + index);
  Spinner spinner=(Spinner)parent;
  String selectedLabel=(String)spinner.getAdapter().getItem(index);
  Log.d(TAG,"String_Node_Str" + selectedLabel);
  OpenHABWidget openHABWidget=(OpenHABWidget)parent.getTag();
  if (openHABWidget != null) {
    Log.d(TAG,"String_Node_Str" + openHABWidget.getMapping(index).getLabel());
    Iterator<OpenHABWidgetMapping> mappingIterator=openHABWidget.getMappings().iterator();
    while (mappingIterator.hasNext()) {
      OpenHABWidgetMapping openHABWidgetMapping=mappingIterator.next();
      if (openHABWidgetMapping.getLabel().equals(selectedLabel)) {
        Log.d(TAG,"String_Node_Str" + openHABWidgetMapping.getCommand());
        if (!openHABWidget.getItem().getState().equals(openHABWidgetMapping.getCommand())) {
          Log.d(TAG,"String_Node_Str");
          sendItemCommand(openHABWidget.getItem(),openHABWidgetMapping.getCommand());
        }
      }
    }
  }
}

Fixed version (ground truth):
public void onItemSelected(AdapterView<?> parent,View view,int index,long id){
  Log.d(TAG,"String_Node_Str" + index);
  Spinner spinner=(Spinner)parent;
  String selectedLabel=(String)spinner.getAdapter().getItem(index);
  Log.d(TAG,"String_Node_Str" + selectedLabel);
  OpenHABWidget openHABWidget=(OpenHABWidget)parent.getTag();
  if (openHABWidget != null) {
    Log.d(TAG,"String_Node_Str" + openHABWidget.getMapping(index).getLabel());
    Iterator<OpenHABWidgetMapping> mappingIterator=openHABWidget.getMappings().iterator();
    while (mappingIterator.hasNext()) {
      OpenHABWidgetMapping openHABWidgetMapping=mappingIterator.next();
      if (openHABWidgetMapping.getLabel().equals(selectedLabel)) {
        Log.d(TAG,"String_Node_Str" + openHABWidgetMapping.getCommand());
        if (openHABWidget.getItem().getState() != null)         if (!openHABWidget.getItem().getState().equals(openHABWidgetMapping.getCommand())) {
          Log.d(TAG,"String_Node_Str");
          sendItemCommand(openHABWidget.getItem(),openHABWidgetMapping.getCommand());
        }
      }
    }
  }
}
Program: 29753
Project: 29753
Buggy source:
public void sendItemCommand(String itemName,String command){
  try {
    StringEntity se=new StringEntity(command);
    mAsyncHttpClient.post(this,openHABBaseUrl + "String_Node_Str" + itemName,se,"String_Node_Str",new AsyncHttpResponseHandler(){
      @Override public void onSuccess(      String response){
        Log.d(TAG,"String_Node_Str");
      }
      @Override public void onFailure(      Throwable error,      String errorResponse){
        Log.e(TAG,"String_Node_Str" + error.getMessage());
        if (errorResponse != null)         Log.e(TAG,"String_Node_Str" + errorResponse);
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    if (e.getMessage() != null)     Log.e(TAG,e.getMessage());
  }
}

Fixed version (ground truth):
public void sendItemCommand(String itemName,String command){
  try {
    StringEntity se=new StringEntity(command,"String_Node_Str");
    mAsyncHttpClient.post(this,openHABBaseUrl + "String_Node_Str" + itemName,se,"String_Node_Str",new AsyncHttpResponseHandler(){
      @Override public void onSuccess(      String response){
        Log.d(TAG,"String_Node_Str");
      }
      @Override public void onFailure(      Throwable error,      String errorResponse){
        Log.e(TAG,"String_Node_Str" + error.getMessage());
        if (errorResponse != null)         Log.e(TAG,"String_Node_Str" + errorResponse);
      }
    }
);
  }
 catch (  UnsupportedEncodingException e) {
    if (e.getMessage() != null)     Log.e(TAG,e.getMessage());
  }
}
Program: 29754
Project: 29754
Buggy source:
private void showAlertDialog(String alertMessage){
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(alertMessage).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
    }
  }
);
  AlertDialog alert=builder.create();
  alert.show();
}

Fixed version (ground truth):
private void showAlertDialog(String alertMessage){
  if (this.isFinishing())   return;
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(alertMessage).setPositiveButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int id){
    }
  }
);
  AlertDialog alert=builder.create();
  alert.show();
}
Program: 29755
Project: 29755
Buggy source:
@Override public Fragment getItem(int position){
  Log.d(TAG,String.format("String_Node_Str",position));
  OpenHABWidgetListFragment fragment=fragmentList.get(position);
  return fragment;
}

Fixed version (ground truth):
@Override public Fragment getItem(int position){
  Log.d(TAG,String.format("String_Node_Str",position));
  return fragmentList.get(position);
}
Program: 29756
Project: 29756
Buggy source:
@Override public int getItemPosition(Object object){
  Log.d(TAG,"String_Node_Str");
  if (actualColumnCountChanged)   return POSITION_NONE;
  if (fragmentList.contains(object)) {
    int index=fragmentList.indexOf(object);
    return index;
  }
  return POSITION_NONE;
}

Fixed version (ground truth):
@Override public int getItemPosition(Object object){
  Log.d(TAG,"String_Node_Str");
  if (actualColumnCountChanged)   return POSITION_NONE;
  if (fragmentList.contains(object)) {
    return fragmentList.indexOf(object);
  }
  return POSITION_NONE;
}
Program: 29757
Project: 29757
Buggy source:
public void onClick(DialogInterface dialogInterface,int i){
  Log.d(TAG,"String_Node_Str");
  MemorizingTrustManager.interactResult(decisionId,MTMDecision.DECISION_ABORT);
}

Fixed version (ground truth):
public void onClick(DialogInterface dialogInterface,int i){
  Log.d(TAG,"String_Node_Str");
  sendMTMDecision(decisionId,MTMDecision.DECISION_ABORT);
}
Program: 29758
Project: 29758
Buggy source:
private void showCertificateDialog(final int decisionId,String certMessage){
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(certMessage).setTitle(R.string.mtm_accept_cert);
  builder.setPositiveButton(R.string.mtm_decision_always,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      MemorizingTrustManager.interactResult(decisionId,MTMDecision.DECISION_ALWAYS);
    }
  }
);
  builder.setNeutralButton(R.string.mtm_decision_once,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      MemorizingTrustManager.interactResult(decisionId,MTMDecision.DECISION_ONCE);
    }
  }
);
  builder.setNegativeButton(R.string.mtm_decision_abort,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      MemorizingTrustManager.interactResult(decisionId,MTMDecision.DECISION_ABORT);
    }
  }
);
  AlertDialog certAlert=builder.create();
  certAlert.show();
}

Fixed version (ground truth):
private void showCertificateDialog(final int decisionId,String certMessage){
  AlertDialog.Builder builder=new AlertDialog.Builder(OpenHABMainActivity.this);
  builder.setMessage(certMessage).setTitle(R.string.mtm_accept_cert);
  builder.setPositiveButton(R.string.mtm_decision_always,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ALWAYS);
    }
  }
);
  builder.setNeutralButton(R.string.mtm_decision_once,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ONCE);
    }
  }
);
  builder.setNegativeButton(R.string.mtm_decision_abort,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialogInterface,    int i){
      Log.d(TAG,"String_Node_Str");
      sendMTMDecision(decisionId,MTMDecision.DECISION_ABORT);
    }
  }
);
  AlertDialog certAlert=builder.create();
  certAlert.show();
}