Program: 163621
Project: 163621
Buggy source:
private void updateSdkMenu(final JMenu sdkMenu){
  try {
    ArrayList<AndroidSDK.SDKTarget> targets=androidMode.getSDK().getAvailableSdkTargets();
    if (targets.size() != 0)     sdkMenu.removeAll();
    AndroidSDK.SDKTarget lowestTargetAvailable=null;
    JCheckBoxMenuItem lowestTargetMenuItem=null;
    String savedSdkName=Preferences.get("String_Node_Str");
    boolean savedTargetSet=false;
    for (    final AndroidSDK.SDKTarget target : targets) {
      if (target.version < 11) {
        continue;
      }
      final JCheckBoxMenuItem item=new JCheckBoxMenuItem("String_Node_Str" + target.name + "String_Node_Str"+ target.version+ "String_Node_Str");
      if (savedTargetSet == false && (lowestTargetAvailable == null || lowestTargetAvailable.version > target.version)) {
        lowestTargetAvailable=target;
        lowestTargetMenuItem=item;
      }
      if (target.name.equals(savedSdkName)) {
        AndroidBuild.setSdkTarget(target,sketch);
        item.setState(true);
        savedTargetSet=true;
      }
      item.addChangeListener(new ChangeListener(){
        @Override public void stateChanged(        ChangeEvent e){
          if (target.name.equals(AndroidBuild.sdkName))           item.setState(true);
 else           item.setState(false);
        }
      }
);
      item.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          AndroidBuild.setSdkTarget(target,sketch);
          for (int i=0; i < sdkMenu.getItemCount(); i++) {
            ((JCheckBoxMenuItem)sdkMenu.getItem(i)).setState(false);
          }
          item.setState(true);
        }
      }
);
      sdkMenu.add(item);
    }
    if (!savedTargetSet) {
      AndroidBuild.setSdkTarget(lowestTargetAvailable,sketch);
      lowestTargetMenuItem.setState(true);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void updateSdkMenu(final JMenu sdkMenu){
  try {
    ArrayList<AndroidSDK.SDKTarget> targets=androidMode.getSDK().getAvailableSdkTargets();
    if (targets.size() != 0)     sdkMenu.removeAll();
    AndroidSDK.SDKTarget lowestTargetAvailable=null;
    JCheckBoxMenuItem lowestTargetMenuItem=null;
    String savedSdkName=Preferences.get("String_Node_Str");
    boolean savedTargetSet=false;
    for (    final AndroidSDK.SDKTarget target : targets) {
      if (target.version < 11) {
        continue;
      }
      final JCheckBoxMenuItem item=new JCheckBoxMenuItem("String_Node_Str" + target.name + "String_Node_Str"+ target.version+ "String_Node_Str");
      if (savedTargetSet == false && (lowestTargetAvailable == null || lowestTargetAvailable.version > target.version)) {
        lowestTargetAvailable=target;
        lowestTargetMenuItem=item;
      }
      if (target.name.equals(savedSdkName)) {
        AndroidBuild.setSdkTarget(target,sketch);
        item.setState(true);
        savedTargetSet=true;
      }
      item.addChangeListener(new ChangeListener(){
        @Override public void stateChanged(        ChangeEvent e){
          if (target.name.equals(AndroidBuild.sdkName))           item.setState(true);
 else           item.setState(false);
        }
      }
);
      item.addActionListener(new ActionListener(){
        @Override public void actionPerformed(        ActionEvent e){
          AndroidBuild.setSdkTarget(target,sketch);
          for (int i=0; i < sdkMenu.getItemCount(); i++) {
            ((JCheckBoxMenuItem)sdkMenu.getItem(i)).setState(false);
          }
          item.setState(true);
        }
      }
);
      sdkMenu.add(item);
    }
    if (!savedTargetSet && lowestTargetAvailable != null) {
      AndroidBuild.setSdkTarget(lowestTargetAvailable,sketch);
      lowestTargetMenuItem.setState(true);
    }
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}