nus-yam/ex-repair huggingface dataset:
Program: 41034
Project: 41034
Buggy source:
/** 
 * Creates a copy of a Bit String
 * @param s the string to copy
 */
public OffsetBitVector(OffsetBitVector s){
  offset=s.offset;
  bits=new int[s.bits.length];
  copyBits(s);
}

Fixed version (ground truth):
/** 
 * Creates a copy of a Bit String
 * @param s the string to copy
 */
public OffsetBitVector(OffsetBitVector s){
  offset=s.offset;
  bits=new int[s.bits.length];
  System.arraycopy(s.bits,0,bits,0,s.bits.length);
}
Program: 41035
Project: 41035
Buggy source:
/** 
 * Compares this object against the specified object.
 * @param B the object to compare with
 * @return true if the objects are the same; false otherwise.
 */
public final boolean sameBits(OffsetBitVector B){
  if (this == B) {
    return true;
  }
  int n=Math.min(bits.length,B.bits.length);
  if (bits.length > B.bits.length) {
    for (int i=n; i < bits.length; i++) {
      if (bits[i] != 0)       return false;
    }
  }
 else   if (B.bits.length > bits.length) {
    for (int i=n; i < B.bits.length; i++) {
      if (B.bits[i] != 0)       return false;
    }
  }
  for (int i=n - 1; i >= 0; ) {
    if (bits[i] != B.bits[i]) {
      return false;
    }
    i--;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Compares this object against the specified object.
 * @param set the object to compare with
 * @return true if the objects are the same; false otherwise.
 */
public final boolean sameBits(OffsetBitVector set){
  if (this == set) {
    return true;
  }
  int wordDiff=wordDiff(offset,set.offset);
  int maxWord=Math.min(bits.length,set.bits.length - wordDiff);
  int i=0;
  if (wordDiff < 0) {
    for (; i < -wordDiff; i++) {
      if (bits[i] != 0) {
        return false;
      }
    }
  }
 else {
    for (int j=0; j < wordDiff; j++) {
      if (set.bits[j] != 0) {
        return false;
      }
    }
  }
  for (; i < maxWord; i++) {
    if (bits[i] != set.bits[i + wordDiff]) {
      return false;
    }
  }
  for (int j=maxWord + wordDiff; j < set.bits.length; j++) {
    if (set.bits[j] != 0) {
      return false;
    }
  }
  for (; i < bits.length; i++) {
    if (bits[i] != 0) {
      return false;
    }
  }
  return true;
}
Program: 41036
Project: 41036
Buggy source:
private void runBitsetTest(MutableIntSetFactory p,MutableIntSetFactory s) throws ClassHierarchyException {
  MutableIntSetFactory save=IntSetUtil.getDefaultIntSetFactory();
  IntSetUtil.setDefaultIntSetFactory(new DebuggingMutableIntSetFactory(p,s));
  graphTest.testJLex();
  IntSetUtil.setDefaultIntSetFactory(save);
}

Fixed version (ground truth):
private void runBitsetTest(MutableIntSetFactory p,MutableIntSetFactory s) throws ClassHierarchyException {
  MutableIntSetFactory save=IntSetUtil.getDefaultIntSetFactory();
  try {
    IntSetUtil.setDefaultIntSetFactory(new DebuggingMutableIntSetFactory(p,s));
    graphTest.testJLex();
  }
  finally {
    IntSetUtil.setDefaultIntSetFactory(save);
  }
}
Program: 41038
Project: 41038
Buggy source:
/** 
 * Remove an integer from this set.
 * @param i integer to remove
 * @return true iff the value of this changes.
 */
public boolean remove(int i){
  if (densePart != null && densePart.get(i)) {
    densePart.clear(i);
    return true;
  }
 else   if (sparsePart.contains(i)) {
    sparsePart.remove(i);
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Remove an integer from this set.
 * @param i integer to remove
 * @return true iff the value of this changes.
 */
public boolean remove(int i){
  if (densePart != null && densePart.get(i)) {
    densePart.clear(i);
    if (densePart.populationCount() == 0) {
      densePart=null;
    }
    return true;
  }
 else   if (sparsePart.contains(i)) {
    sparsePart.remove(i);
    return true;
  }
 else {
    return false;
  }
}
Program: 41039
Project: 41039
Buggy source:
public static int[] diffInternal(SparseIntSet A,SparseIntSet B){
  if (Assertions.verifyAssertions) {
    Assertions._assert(A != null);
    Assertions._assert(B != null);
  }
  if (A.isEmpty()) {
    return new int[0];
  }
 else   if (B.isEmpty()) {
    int[] newElts=new int[A.elements.length];
    System.arraycopy(A.elements,0,newElts,0,A.elements.length);
    return newElts;
  }
 else   if (A.equals(B)) {
    return new int[0];
  }
 else   if (A.sameValue(B)) {
    return new int[0];
  }
  int[] ar=A.elements;
  int ai=0;
  int al=A.size;
  int[] br=B.elements;
  int bi=0;
  int bl=B.size;
  int[] cr=new int[al];
  int ci=0;
  while (ai < al && bi < bl) {
    int cmp=(ar[ai] - br[bi]);
    if (cmp > 0) {
      bi++;
    }
 else     if (cmp < 0) {
      cr[ci++]=ar[ai];
      ai++;
    }
 else {
      ai++;
      bi++;
    }
  }
  if (ai < al) {
    int tail=al - ai;
    System.arraycopy(ar,ai,cr,ci,tail);
    ci+=tail;
  }
  ar=new int[ci];
  System.arraycopy(cr,0,ar,0,ci);
  return ar;
}

Fixed version (ground truth):
public static int[] diffInternal(SparseIntSet A,SparseIntSet B){
  if (Assertions.verifyAssertions) {
    Assertions._assert(A != null);
    Assertions._assert(B != null);
  }
  if (A.isEmpty()) {
    return new int[0];
  }
 else   if (B.isEmpty()) {
    int[] newElts=new int[A.size];
    System.arraycopy(A.elements,0,newElts,0,A.size);
    return newElts;
  }
 else   if (A.equals(B)) {
    return new int[0];
  }
 else   if (A.sameValue(B)) {
    return new int[0];
  }
  int[] ar=A.elements;
  int ai=0;
  int al=A.size;
  int[] br=B.elements;
  int bi=0;
  int bl=B.size;
  int[] cr=new int[al];
  int ci=0;
  while (ai < al && bi < bl) {
    int cmp=(ar[ai] - br[bi]);
    if (cmp > 0) {
      bi++;
    }
 else     if (cmp < 0) {
      cr[ci++]=ar[ai];
      ai++;
    }
 else {
      ai++;
      bi++;
    }
  }
  if (ai < al) {
    int tail=al - ai;
    System.arraycopy(ar,ai,cr,ci,tail);
    ci+=tail;
  }
  ar=new int[ci];
  System.arraycopy(cr,0,ar,0,ci);
  return ar;
}
Program: 41040
Project: 41040
Buggy source:
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 */
private static JarFileModule getFromPlugin(String fileName) throws IOException {
  URL url=FileLocator.find(CorePlugin.getDefault().getBundle(),new Path(fileName),null);
  if (url == null) {
    fileName="String_Node_Str" + fileName;
    url=FileLocator.find(CorePlugin.getDefault().getBundle(),new Path(fileName),null);
    if (url == null) {
      return null;
    }
  }
  url=FileLocator.toFileURL(url);
  return new JarFileModule(new JarFile(filePathFromURL(url)));
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 */
private static JarFileModule getFromPlugin(String fileName) throws IOException {
  URL url=getFileURLFromPlugin(fileName);
  return (url == null) ? null : new JarFileModule(new JarFile(filePathFromURL(url)));
}
Program: 41041
Project: 41041
Buggy source:
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458">bug report</a>).  For now, fails with an assertion if the url is malformed.
 * @param url 
 * @return the path name for the url
 */
public static String filePathFromURL(URL url){
  URI uri=null;
  try {
    uri=new URI(url.toString());
  }
 catch (  URISyntaxException e) {
    Assertions.UNREACHABLE();
  }
  String filePath=uri.getPath();
  return filePath;
}

Fixed version (ground truth):
/** 
 * Properly creates the String file name of a   {@link URL}. This works around a bug in the Sun implementation of   {@link URL#getFile()}, which doesn't properly handle file paths with spaces (see <a href="http://sourceforge.net/tracker/index.php?func=detail&aid=1565842&group_id=176742&atid=878458">bug report</a>). For now, fails with an assertion if the url is malformed.
 * @param url
 * @return the path name for the url
 */
public static String filePathFromURL(URL url){
  URI uri=null;
  try {
    uri=new URI(url.toString());
  }
 catch (  URISyntaxException e) {
    Assertions.UNREACHABLE();
  }
  String filePath=uri.getPath();
  return filePath;
}
Program: 41042
Project: 41042
Buggy source:
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 */
private static File getFileFromPlugin(String fileName) throws IOException {
  URL url=FileLocator.find(CorePlugin.getDefault().getBundle(),new Path(fileName),null);
  if (url == null) {
    fileName="String_Node_Str" + fileName;
    url=FileLocator.find(CorePlugin.getDefault().getBundle(),new Path(fileName),null);
    if (url == null) {
      throw new FileNotFoundException(fileName);
    }
  }
  url=FileLocator.toFileURL(url);
  return new File(filePathFromURL(url));
}

Fixed version (ground truth):
/** 
 * @param fileName
 * @return the jar file packaged with this plug-in of the given name, or nullif not found.
 */
private static File getFileFromPlugin(String fileName) throws IOException {
  URL url=getFileURLFromPlugin(fileName);
  if (url == null) {
    throw new FileNotFoundException(fileName);
  }
  return new File(filePathFromURL(url));
}
Program: 41043
Project: 41043
Buggy source:
/** 
 * create a Properties object representing the properties set by the command line args. if args[i] is "-foo" and args[i+1] is "bar", then the result will define a property with key "foo" and value "bar"
 * @throws WalaException
 */
public static Properties parse(String[] args) throws WalaException {
  Properties result=new Properties();
  for (int i=0; i < args.length - 1; i++) {
    String key=parseForKey(args[i]);
    if (key != null) {
      if (args[i].contains("String_Node_Str")) {
        result.put(key,args[i].substring(args[i].indexOf('=') + 1));
      }
 else {
        if (args[i + 1].charAt(0) == '-') {
          throw new WalaException("String_Node_Str");
        }
        result.put(key,args[i + 1]);
        i++;
      }
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * create a Properties object representing the properties set by the command line args. if args[i] is "-foo" and args[i+1] is "bar", then the result will define a property with key "foo" and value "bar"
 * @throws WalaException
 */
public static Properties parse(String[] args) throws WalaException {
  Properties result=new Properties();
  for (int i=0; i < args.length; i++) {
    String key=parseForKey(args[i]);
    if (key != null) {
      if (args[i].contains("String_Node_Str")) {
        result.put(key,args[i].substring(args[i].indexOf('=') + 1));
      }
 else {
        if ((i + 1) >= args.length || args[i + 1].charAt(0) == '-') {
          throw new WalaException("String_Node_Str");
        }
        result.put(key,args[i + 1]);
        i++;
      }
    }
  }
  return result;
}
Program: 41044
Project: 41044
Buggy source:
public String toString(){
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  for (int i=0; i < getMaxNumber(); i++) {
    Object node=getNode(i);
    if (node != null) {
      result.append(i).append("String_Node_Str").append(node).append("String_Node_Str");
    }
  }
  result.append("String_Node_Str");
  for (int i=0; i < getMaxNumber(); i++) {
    Object node=getNode(i);
    if (node != null) {
      result.append(i).append("String_Node_Str");
      for (Iterator it=getSuccNodes(node); it.hasNext(); ) {
        Object s=it.next();
        result.append(getNumber(s)).append("String_Node_Str");
      }
      result.append("String_Node_Str");
    }
  }
  return result.toString();
}

Fixed version (ground truth):
public String toString(){
  StringBuffer result=new StringBuffer();
  result.append("String_Node_Str");
  for (int i=0; i <= getMaxNumber(); i++) {
    Object node=getNode(i);
    if (node != null) {
      result.append(i).append("String_Node_Str").append(node).append("String_Node_Str");
    }
  }
  result.append("String_Node_Str");
  for (int i=0; i <= getMaxNumber(); i++) {
    Object node=getNode(i);
    if (node != null) {
      result.append(i).append("String_Node_Str");
      for (Iterator it=getSuccNodes(node); it.hasNext(); ) {
        Object s=it.next();
        result.append(getNumber(s)).append("String_Node_Str");
      }
      result.append("String_Node_Str");
    }
  }
  return result.toString();
}
Program: 41047
Project: 41047
Buggy source:
private static PList<Float> generateRandomIntList(int size){
  Random r=new Random(123412341234L);
  PList<Float> t=new FloatList();
  for (int i=0; i < size; i++) {
    t.add((float)r.nextFloat());
  }
  return t;
}

Fixed version (ground truth):
private static PList<Integer> generateRandomIntList(int size){
  Random r=new Random(123412341234L);
  PList<Integer> t=new IntList();
  for (int i=0; i < size; i++) {
    t.add((int)r.nextInt());
  }
  return t;
}
Program: 41049
Project: 41049
Buggy source:
@Override public Double map(Integer input){
  double x=2 * input / (double)(RESOLUTION) - 1;
  return 10 * Math.pow(x,6) + Math.pow(x,5) + 2 * Math.pow(x,4) + 3 * x * x* x + 2 / 5 * x * x + Math.PI * x;
}

Fixed version (ground truth):
@Override public Double map(Integer input){
  double x=2 * input / (double)(100000) - 1;
  return 10 * Math.pow(x,6) + Math.pow(x,5) + 2 * Math.pow(x,4) + 3 * x * x* x + 2 / 5 * x * x + Math.PI * x;
}
Program: 41050
Project: 41050
Buggy source:
public Application(String configFile){
  config=ConfigInitializer.getConfig(configFile);
}

Fixed version (ground truth):
public Application(String configFile){
  if (configFile == null)   config=Configuration.getDefault().clone();
 else   config=ConfigInitializer.getConfig(configFile);
  String ima=config.getProperty("String_Node_Str",Constants.STR_TRUE);
  try {
    isMacroOn=Boolean.parseBoolean(ima);
  }
 catch (  Exception e) {
    JangodLogger.warning("String_Node_Str" + ima);
  }
  parseResultManager=new ParseResultManager(this);
}
Program: 41051
Project: 41051
Buggy source:
public void setParameter(int pid,int value){
  log.debug("String_Node_Str" + pid + "String_Node_Str"+ value);
  if ((pid & 0xc3) != 0)   throw new IllegalArgumentException("String_Node_Str" + pid);
  serialWrite(new int[]{SET_PARAMETER_MESSAGE | pid | (value >> 8),value & 0xff});
}

Fixed version (ground truth):
public void setParameter(int pid,int value){
  log.debug("String_Node_Str" + pid + "String_Node_Str"+ value);
  if ((pid & 0xc3) != 0)   throw new IllegalArgumentException("String_Node_Str" + pid);
  serialWrite(new int[]{SET_PARAMETER_MESSAGE | pid | (value >> 8 & 0x3),value & 0xff});
}
Program: 41052
Project: 41052
Buggy source:
/** 
 * @param outStream: serial line connected to a BlipBox
 */
public BlipBox(OutputStream outStream){
  this.outStream=outStream;
}

Fixed version (ground truth):
/** 
 * @param outStream: serial line connected to a BlipBox
 */
public BlipBox(){
}
Program: 41053
Project: 41053
Buggy source:
public void openSerialPort(String port,int speed){
  receiver.openSerialPort(port,speed);
}

Fixed version (ground truth):
public void openSerialPort(String port,int speed){
  this.serialport=port;
  this.serialspeed=speed;
  openSerialPort();
}
Program: 41054
Project: 41054
Buggy source:
public BlipBoxApplication(String config){
  configuration=SensorConfiguration.createSensorConfiguration(config);
  receiver=new BlipBoxDataHandler();
  receiver.setSensorConfiguration(configuration);
  serialconfig=new SerialPortConfiguration(receiver);
  serialconfig.init();
  sender=new BlipBox(receiver.getOutputStream());
}

Fixed version (ground truth):
public BlipBoxApplication(String config){
  configuration=SensorConfiguration.createSensorConfiguration(config);
  receiver=new BlipBoxDataHandler();
  receiver.setSensorConfiguration(configuration);
  serialconfig=new SerialPortConfiguration(this);
  serialconfig.init();
  sender=new BlipBox();
}
Program: 41055
Project: 41055
Buggy source:
public void openSerialPort(String port,int speed){
  this.port=port;
  this.speed=speed;
  closeSerialPort();
  log.info("String_Node_Str" + port + "String_Node_Str"+ speed+ "String_Node_Str");
  try {
    CommPortIdentifier portId=CommPortIdentifier.getPortIdentifier(port);
    serialport=(SerialPort)portId.open("String_Node_Str" + port,2000);
    try {
      serialport.setSerialPortParams(speed,serialport.DATABITS_8,serialport.STOPBITS_1,serialport.PARITY_NONE);
switch (flow) {
case Hardware:
        serialport.setFlowControlMode(serialport.FLOWCONTROL_RTSCTS_IN);
      serialport.setFlowControlMode(serialport.FLOWCONTROL_RTSCTS_OUT);
    break;
case Software:
  serialport.setFlowControlMode(serialport.FLOWCONTROL_XONXOFF_IN);
serialport.setFlowControlMode(serialport.FLOWCONTROL_XONXOFF_OUT);
break;
case None:
serialport.setFlowControlMode(serialport.FLOWCONTROL_NONE);
break;
}
}
 catch (UnsupportedCommOperationException e) {
throw new RuntimeException("String_Node_Str",e);
}
try {
inStream=serialport.getInputStream();
outStream=serialport.getOutputStream();
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str",e);
}
try {
serialport.addEventListener(this);
serialport.notifyOnDataAvailable(true);
}
 catch (TooManyListenersException e) {
throw new RuntimeException("String_Node_Str",e);
}
}
 catch (Exception e) {
throw new RuntimeException("String_Node_Str",e);
}
}

Fixed version (ground truth):
public void openSerialPort(String port,int speed){
  closeSerialPort();
  log.info("String_Node_Str" + port + "String_Node_Str"+ speed+ "String_Node_Str");
  try {
    CommPortIdentifier portId=CommPortIdentifier.getPortIdentifier(port);
    serialport=(SerialPort)portId.open("String_Node_Str" + port,2000);
    try {
      serialport.setSerialPortParams(speed,serialport.DATABITS_8,serialport.STOPBITS_1,serialport.PARITY_NONE);
switch (flow) {
case Hardware:
        serialport.setFlowControlMode(serialport.FLOWCONTROL_RTSCTS_IN);
      serialport.setFlowControlMode(serialport.FLOWCONTROL_RTSCTS_OUT);
    break;
case Software:
  serialport.setFlowControlMode(serialport.FLOWCONTROL_XONXOFF_IN);
serialport.setFlowControlMode(serialport.FLOWCONTROL_XONXOFF_OUT);
break;
case None:
serialport.setFlowControlMode(serialport.FLOWCONTROL_NONE);
break;
}
}
 catch (UnsupportedCommOperationException e) {
throw new RuntimeException("String_Node_Str",e);
}
try {
inStream=serialport.getInputStream();
outStream=serialport.getOutputStream();
}
 catch (IOException e) {
throw new RuntimeException("String_Node_Str",e);
}
try {
serialport.addEventListener(this);
serialport.notifyOnDataAvailable(true);
}
 catch (TooManyListenersException e) {
throw new RuntimeException("String_Node_Str",e);
}
}
 catch (Exception e) {
throw new RuntimeException("String_Node_Str",e);
}
}
Program: 41056
Project: 41056
Buggy source:
public SerialPortConfiguration(BlipBoxDataHandler service){
  this.service=service;
}

Fixed version (ground truth):
public SerialPortConfiguration(BlipBoxApplication service){
  this.service=service;
}
Program: 41057
Project: 41057
Buggy source:
public JPanel getPanel(){
  JPanel content=new JPanel();
  content.setLayout(new MigLayout());
  List<String> ports=SerialDataHandler.getSerialPorts();
  serialport=new JComboBox(ports.toArray());
  if (ports.contains(service.getSerialPortName()))   serialport.setSelectedItem(service.getSerialPortName());
  serialspeed=new JComboBox(speeds);
  serialspeed.setSelectedItem(service.getSerialSpeed());
  JButton button=new JButton("String_Node_Str");
  button.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent event){
      serialport.removeAllItems();
      List<String> ports=SerialDataHandler.getSerialPorts();
      for (      String port : ports)       serialport.addItem(port);
      if (ports.contains(service.getSerialPortName()))       serialport.setSelectedItem(service.getSerialPortName());
    }
  }
);
  JLabel label=new JLabel("String_Node_Str");
  label.setLabelFor(serialport);
  content.add(label,"String_Node_Str");
  content.add(serialport);
  content.add(button,"String_Node_Str");
  label=new JLabel("String_Node_Str");
  label.setLabelFor(serialspeed);
  content.add(label,"String_Node_Str");
  content.add(serialspeed);
  return content;
}

Fixed version (ground truth):
public JPanel getPanel(){
  JPanel content=new JPanel();
  content.setLayout(new MigLayout());
  List<String> ports=SerialDataHandler.getSerialPorts();
  serialport=new JComboBox(ports.toArray());
  if (ports.contains(service.getSerialPort()))   serialport.setSelectedItem(service.getSerialPort());
  serialspeed=new JComboBox(speeds);
  serialspeed.setSelectedItem(service.getSerialSpeed());
  JButton button=new JButton("String_Node_Str");
  button.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent event){
      serialport.removeAllItems();
      List<String> ports=SerialDataHandler.getSerialPorts();
      for (      String port : ports)       serialport.addItem(port);
      if (ports.contains(service.getSerialPort()))       serialport.setSelectedItem(service.getSerialPort());
    }
  }
);
  JLabel label=new JLabel("String_Node_Str");
  label.setLabelFor(serialport);
  content.add(label,"String_Node_Str");
  content.add(serialport);
  content.add(button,"String_Node_Str");
  label=new JLabel("String_Node_Str");
  label.setLabelFor(serialspeed);
  content.add(label,"String_Node_Str");
  content.add(serialspeed);
  return content;
}
Program: 41058
Project: 41058
Buggy source:
public ConfigurationPanel(){
  JPanel panel=new JPanel(new MigLayout());
  add(panel);
  panel.add(new Label("String_Node_Str"),"String_Node_Str");
  JComboBox box=new JComboBox(sender.getFollowModes());
  box.setSelectedItem("String_Node_Str");
  box.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      JComboBox box=(JComboBox)e.getSource();
      String name=(String)box.getSelectedItem();
      sender.setFollowMode(name);
    }
  }
);
  panel.add(box,"String_Node_Str");
  panel.add(new Label("String_Node_Str"),"String_Node_Str");
  JSpinner spinner=new JSpinner(new SpinnerNumberModel(200,20,1200,20));
  spinner.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSpinner spinner=(JSpinner)event.getSource();
      Integer value=(Integer)spinner.getValue();
      eventhandler.setSensitivity(value);
      sender.setSensitivity(value);
    }
  }
);
  panel.add(spinner,"String_Node_Str");
  JButton button=new JButton("String_Node_Str");
  button.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      sender.clear();
    }
  }
);
  panel.add(button,"String_Node_Str");
}

Fixed version (ground truth):
public ConfigurationPanel(){
  JPanel panel=new JPanel(new MigLayout());
  add(panel);
  panel.add(new Label("String_Node_Str"),"String_Node_Str");
  JComboBox box=new JComboBox(sender.getFollowModes());
  box.setSelectedItem("String_Node_Str");
  box.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      JComboBox box=(JComboBox)e.getSource();
      String name=(String)box.getSelectedItem();
      sender.setFollowMode(name);
    }
  }
);
  panel.add(box,"String_Node_Str");
  panel.add(new Label("String_Node_Str"),"String_Node_Str");
  JSpinner spinner=new JSpinner(new SpinnerNumberModel(200,20,1200,20));
  spinner.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSpinner spinner=(JSpinner)event.getSource();
      Integer value=(Integer)spinner.getValue();
      eventhandler.setSensitivity(value);
      sender.setSensitivity(value);
    }
  }
);
  panel.add(spinner,"String_Node_Str");
  panel.add(new Label("String_Node_Str"),"String_Node_Str");
  spinner=new JSpinner(new SpinnerNumberModel(0xff,0,0xff,0xf));
  spinner.addChangeListener(new ChangeListener(){
    public void stateChanged(    ChangeEvent event){
      JSpinner spinner=(JSpinner)event.getSource();
      Integer value=(Integer)spinner.getValue();
      sender.setBrightness(value);
    }
  }
);
  panel.add(spinner,"String_Node_Str");
  JButton button=new JButton("String_Node_Str");
  button.addActionListener(new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      sender.clear();
    }
  }
);
  panel.add(button,"String_Node_Str");
}
Program: 41059
Project: 41059
Buggy source:
/** 
 * A representation of the current graph layering, useful for debugging. TODO: Move somewhere else?
 */
@Override public String toString(){
  String result="String_Node_Str";
  for (  int layer : new TreeSet<Integer>(layer2Nodes.keySet())) {
    result+="String_Node_Str" + layer + "String_Node_Str";
    result+="String_Node_Str";
    for (    Node n : layer2Nodes.get(layer))     result+=n + "String_Node_Str";
    result+="String_Node_Str";
  }
  return result;
}

Fixed version (ground truth):
/** 
 * A representation of the current graph layering, useful for debugging. TODO: Move somewhere else?
 */
@Override public String toString(){
  String result="String_Node_Str";
  for (int layer=0; layer <= this.maxLayer; layer++) {
    result+="String_Node_Str" + layer + "String_Node_Str";
    result+="String_Node_Str";
    Set<Node> nodes=layer2Nodes.get(layer);
    if (nodes == null)     continue;
    for (    Node n : nodes)     result+=n + "String_Node_Str";
    result+="String_Node_Str";
  }
  return result;
}
Program: 41062
Project: 41062
Buggy source:
/** 
 * <p>Example Graph G6.</p> <p><img src = "exp_graph6.png"></p>
 */
public static DummyGraph getG6(){
  if (g6 != null)   return g6;
  DummyGraph g=new DummyGraph();
  g.addChain(0,"String_Node_Str");
  g.addChain(0,"String_Node_Str");
  return g6=g;
}

Fixed version (ground truth):
/** 
 * <p>A simple test graph containing just two isolated nodes.</p>
 */
public static DummyGraph getG6(){
  if (g6 != null)   return g6;
  DummyGraph g=new DummyGraph();
  g.addChain(0,"String_Node_Str");
  g.addChain(0,"String_Node_Str");
  return g6=g;
}
Program: 41063
Project: 41063
Buggy source:
public Equivalence deserialize(JsonElement json,Type type,JsonDeserializationContext context) throws JsonParseException {
  Equivalence equivalence=new Equivalence();
  try {
    equivalence.setUri(new URI(json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonPrimitive("String_Node_Str").getAsString()));
    equivalence.setAmount(json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonPrimitive("String_Node_Str").getAsInt());
    JsonArray duplicates=json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonArray("String_Node_Str");
    List<URI> duplicatesURIs=new LinkedList<URI>();
    for (int i=0; i < duplicates.size(); i++) {
      URI uri=new URI(duplicates.get(i).getAsString());
      duplicatesURIs.add(uri);
      equivalence.setDuplicates(duplicatesURIs);
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
  return equivalence;
}

Fixed version (ground truth):
public Equivalence deserialize(JsonElement json,Type type,JsonDeserializationContext context) throws JsonParseException {
  Equivalence equivalence=new Equivalence();
  try {
    String uriString=json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonPrimitive("String_Node_Str").getAsString();
    equivalence.setUri(new URI(uriString.substring(1,uriString.length() - 1)));
    equivalence.setAmount(json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonPrimitive("String_Node_Str").getAsInt());
    JsonArray duplicates=json.getAsJsonArray().get(0).getAsJsonObject().getAsJsonArray("String_Node_Str");
    List<URI> duplicatesURIs=new LinkedList<URI>();
    for (int i=0; i < duplicates.size(); i++) {
      URI uri=new URI(duplicates.get(i).getAsString());
      duplicatesURIs.add(uri);
      equivalence.setDuplicates(duplicatesURIs);
    }
  }
 catch (  URISyntaxException e) {
    e.printStackTrace();
  }
  return equivalence;
}
Program: 41064
Project: 41064
Buggy source:
public void execute() throws MojoExecutionException {
  if (!outputDirectory.exists()) {
    outputDirectory.mkdirs();
  }
  List arguments=new ArrayList();
  if (!bytecode)   arguments.add("String_Node_Str");
  if (verbose)   arguments.add("String_Node_Str");
  arguments.add("String_Node_Str");
  arguments.add(outputDirectory.getAbsolutePath());
  try {
    List<String> compileClasspath=project.getCompileClasspathElements();
    compileClasspath.addAll(project.getRuntimeClasspathElements());
    String classpath=StringUtils.join(compileClasspath.iterator(),File.pathSeparator);
    arguments.add("String_Node_Str");
    arguments.add(classpath);
    arguments.add(sourceDirectory.getAbsolutePath());
    MirahCommand.compile(arguments);
  }
 catch (  Exception e) {
    throw new MojoExecutionException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public void execute() throws MojoExecutionException {
  if (!outputDirectory.exists()) {
    outputDirectory.mkdirs();
  }
  List arguments=new ArrayList();
  if (!bytecode)   arguments.add("String_Node_Str");
  if (verbose)   arguments.add("String_Node_Str");
  arguments.add("String_Node_Str");
  arguments.add(outputDirectory.getAbsolutePath());
  try {
    arguments.add("String_Node_Str");
    arguments.add(StringUtils.join(classpathElements.iterator(),File.pathSeparator));
    arguments.add(sourceDirectory.getAbsolutePath());
    MirahCommand.compile(arguments);
  }
 catch (  Exception e) {
    throw new MojoExecutionException(e.getMessage(),e);
  }
}
Program: 41066
Project: 41066
Buggy source:
private void updateMediaPlayer(){
  String currentTitle=KeyguardViewMediator.TrackId();
  String currentArtist=KeyguardViewMediator.Artist();
  CharSequence nowPlaying=new StringBuilder().append(currentArtist).append("String_Node_Str").append(currentTitle).toString();
  if (!mScreenOn || (currentTitle == null && currentArtist == null)) {
    mMusicInfoTextInMax.setText("String_Node_Str");
    mMusicInfoTextInMin.setText("String_Node_Str");
    mMusicInfoTextInMax.setSelected(false);
    mMusicInfoTextInMin.setSelected(false);
  }
 else {
    mMusicInfoTextInMax.setText(nowPlaying);
    mMusicInfoTextInMin.setText(nowPlaying);
    if (isMaxLayout) {
      mMusicInfoTextInMax.setSelected(true);
    }
 else {
      mMusicInfoTextInMin.setSelected(true);
    }
    Uri uri=getArtworkUri(mContext,KeyguardViewMediator.SongId(),KeyguardViewMediator.AlbumId());
    if (uri != null) {
      mAlbumArtWithImage.setImageURI(uri);
    }
 else {
      setRandomAlbumCover();
    }
  }
}

Fixed version (ground truth):
private void updateMediaPlayer(){
  String currentTitle=KeyguardViewMediator.TrackId();
  String currentArtist=KeyguardViewMediator.Artist();
  CharSequence nowPlaying=new StringBuilder().append(currentArtist).append("String_Node_Str").append(currentTitle).toString();
  if ((currentTitle == null && currentArtist == null)) {
    mMusicInfoTextInMax.setText("String_Node_Str");
    mMusicInfoTextInMin.setText("String_Node_Str");
    mMusicInfoTextInMax.setSelected(false);
    mMusicInfoTextInMin.setSelected(false);
  }
 else {
    mMusicInfoTextInMax.setText(nowPlaying);
    mMusicInfoTextInMin.setText(nowPlaying);
    if (isMaxLayout) {
      mMusicInfoTextInMax.setSelected(true);
    }
 else {
      mMusicInfoTextInMin.setSelected(true);
    }
    Uri uri=getArtworkUri(mContext,KeyguardViewMediator.SongId(),KeyguardViewMediator.AlbumId());
    if (uri != null) {
      mAlbumArtWithImage.setImageURI(uri);
    }
 else {
      setRandomAlbumCover();
    }
  }
}
Program: 41067
Project: 41067
Buggy source:
private Bitmap getBitmapFromDrawable(FastBitmapDrawable icon){
  Log.d(TAG,"String_Node_Str");
  Bitmap myBitmap=Bitmap.createBitmap(25,25,Config.ARGB_8888);
  Canvas canvas=new Canvas(myBitmap);
  Drawable drawable=icon;
  drawable.draw(canvas);
  if (myBitmap != null)   return myBitmap;
 else   if (icon instanceof BitmapDrawable)   return ((BitmapDrawable)icon).getBitmap();
 else {
    Log.d(TAG,"String_Node_Str");
    return null;
  }
}

Fixed version (ground truth):
private Bitmap getBitmapFromDrawable(Drawable icon){
  Log.d(TAG,"String_Node_Str");
  Bitmap myBitmap=Bitmap.createBitmap(25,25,Bitmap.Config.ARGB_8888);
  Canvas canvas=new Canvas(myBitmap);
  Drawable drawable=icon;
  drawable.draw(canvas);
  if (myBitmap != null)   return myBitmap;
 else   if (icon instanceof BitmapDrawable)   return ((BitmapDrawable)icon).getBitmap();
 else {
    Log.d(TAG,"String_Node_Str");
    return null;
  }
}
Program: 41068
Project: 41068
Buggy source:
/** 
 * Wrapper function associated with setting the shortcut icons. Trigger is controlled by   {@link onSenseLikeSelectorTrigger} from withthe  {@link OnSenseLikeSelectorTriggerListener}. This function must be called before the View is created or all of the shortcuts will be disabled,
 */
public void setShortCutsDrawables(FastBitmapDrawable FarLeft,FastBitmapDrawable Left,FastBitmapDrawable Right,FastBitmapDrawable FarRight){
  log("String_Node_Str");
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutOne=getBitmapFromDrawable(FarLeft);
  if (mShortCutOne != null)   mUseShortcutOne=true;
 else   mUseShortcutOne=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutTwo=getBitmapFromDrawable(Left);
  if (mShortCutTwo != null)   mUseShortcutTwo=true;
 else   mUseShortcutTwo=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutThree=getBitmapFromDrawable(Right);
  if (mShortCutThree != null)   mUseShortcutThree=true;
 else   mUseShortcutThree=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutFour=getBitmapFromDrawable(FarRight);
  if (mShortCutFour != null)   mUseShortcutFour=true;
 else   mUseShortcutFour=false;
}

Fixed version (ground truth):
/** 
 * Wrapper function associated with setting the shortcut icons. Trigger is controlled by   {@link onSenseLikeSelectorTrigger} from withthe  {@link OnSenseLikeSelectorTriggerListener}. This function must be called before the View is created or all of the shortcuts will be disabled,
 */
public void setShortCutsDrawables(Drawable FarLeft,Drawable Left,Drawable Right,Drawable FarRight){
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutOne=getBitmapFromDrawable(FarLeft);
  if (mShortCutOne != null)   mUseShortcutOne=true;
 else   mUseShortcutOne=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutTwo=getBitmapFromDrawable(Left);
  if (mShortCutTwo != null)   mUseShortcutTwo=true;
 else   mUseShortcutTwo=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutThree=getBitmapFromDrawable(Right);
  if (mShortCutThree != null)   mUseShortcutThree=true;
 else   mUseShortcutThree=false;
  log("String_Node_Str");
  if (FarLeft != null)   mShortCutFour=getBitmapFromDrawable(FarRight);
  if (mShortCutFour != null)   mUseShortcutFour=true;
 else   mUseShortcutFour=false;
}
Program: 41070
Project: 41070
Buggy source:
@Override public void onSenseLikeSelectorTrigger(View v,int Trigger){
  Vibrator vibe=(Vibrator)mContext.getSystemService(Context.VIBRATOR_SERVICE);
  long[] pattern={0,100};
switch (Trigger) {
case OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_ONE_TRIGGERED:
    vibe.vibrate(pattern,-1);
  mCustomApps[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[0]);
mCallback.goToUnlockScreen();
break;
case OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_TWO_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[1].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[1]);
mCallback.goToUnlockScreen();
break;
case OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_THREE_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[2].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[2]);
mCallback.goToUnlockScreen();
break;
case OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_FOUR_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[3].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[3]);
mCallback.goToUnlockScreen();
break;
case OnSenseLikeSelectorTriggerListener.LOCK_ICON_TRIGGERED:
mCallback.goToUnlockScreen();
break;
}
}

Fixed version (ground truth):
@Override public void onSenseLikeSelectorTrigger(View v,int Trigger){
  Vibrator vibe=(Vibrator)mContext.getSystemService(Context.VIBRATOR_SERVICE);
  long[] pattern={0,100};
switch (Trigger) {
case SenseLikeLock.OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_ONE_TRIGGERED:
    vibe.vibrate(pattern,-1);
  mCustomApps[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[0]);
mCallback.goToUnlockScreen();
break;
case SenseLikeLock.OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_TWO_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[1].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[1]);
mCallback.goToUnlockScreen();
break;
case SenseLikeLock.OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_THREE_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[2].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[2]);
mCallback.goToUnlockScreen();
break;
case SenseLikeLock.OnSenseLikeSelectorTriggerListener.LOCK_ICON_SHORTCUT_FOUR_TRIGGERED:
vibe.vibrate(pattern,-1);
mCustomApps[3].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getContext().startActivity(mCustomApps[3]);
mCallback.goToUnlockScreen();
break;
case SenseLikeLock.OnSenseLikeSelectorTriggerListener.LOCK_ICON_TRIGGERED:
mCallback.goToUnlockScreen();
break;
}
}
Program: 41071
Project: 41071
Buggy source:
/** 
 * Set this object to the system defaults.
 */
public void setToDefaults(){
  fontScale=0;
  mcc=mnc=0;
  locale=null;
  userSetLocale=false;
  touchscreen=TOUCHSCREEN_UNDEFINED;
  keyboard=KEYBOARD_UNDEFINED;
  keyboardHidden=KEYBOARDHIDDEN_UNDEFINED;
  hardKeyboardHidden=HARDKEYBOARDHIDDEN_UNDEFINED;
  navigation=NAVIGATION_UNDEFINED;
  navigationHidden=NAVIGATIONHIDDEN_UNDEFINED;
  orientation=ORIENTATION_UNDEFINED;
  screenLayout=SCREENLAYOUT_SIZE_UNDEFINED;
  uiMode=UI_MODE_TYPE_UNDEFINED;
  seq=0;
  customTheme=null;
}

Fixed version (ground truth):
/** 
 * Set this object to the system defaults.
 */
public void setToDefaults(){
  fontScale=1;
  mcc=mnc=0;
  locale=null;
  userSetLocale=false;
  touchscreen=TOUCHSCREEN_UNDEFINED;
  keyboard=KEYBOARD_UNDEFINED;
  keyboardHidden=KEYBOARDHIDDEN_UNDEFINED;
  hardKeyboardHidden=HARDKEYBOARDHIDDEN_UNDEFINED;
  navigation=NAVIGATION_UNDEFINED;
  navigationHidden=NAVIGATIONHIDDEN_UNDEFINED;
  orientation=ORIENTATION_UNDEFINED;
  screenLayout=SCREENLAYOUT_SIZE_UNDEFINED;
  uiMode=UI_MODE_TYPE_UNDEFINED;
  seq=0;
  customTheme=null;
}
Program: 41072
Project: 41072
Buggy source:
/** 
 * Convenience function to read all of the current configuration-related settings into a  {@link Configuration} object.
 * @param cr The ContentResolver to access.
 * @param outConfig Where to place the configuration settings.
 */
public static void getConfiguration(ContentResolver cr,Configuration outConfig){
  outConfig.fontScale=Settings.System.getFloat(cr,FONT_SCALE,outConfig.fontScale);
  if (!(outConfig.fontScale > 0)) {
    outConfig.fontScale=1;
  }
}

Fixed version (ground truth):
/** 
 * Convenience function to read all of the current configuration-related settings into a  {@link Configuration} object.
 * @param cr The ContentResolver to access.
 * @param outConfig Where to place the configuration settings.
 */
public static void getConfiguration(ContentResolver cr,Configuration outConfig){
  outConfig.fontScale=Settings.System.getFloat(cr,FONT_SCALE,outConfig.fontScale);
  if (outConfig.fontScale < 0) {
    outConfig.fontScale=1;
  }
}
Program: 41073
Project: 41073
Buggy source:
/** 
 * Set this object to the system defaults.
 */
public void setToDefaults(){
  fontScale=1;
  mcc=mnc=0;
  locale=null;
  userSetLocale=false;
  touchscreen=TOUCHSCREEN_UNDEFINED;
  keyboard=KEYBOARD_UNDEFINED;
  keyboardHidden=KEYBOARDHIDDEN_UNDEFINED;
  hardKeyboardHidden=HARDKEYBOARDHIDDEN_UNDEFINED;
  navigation=NAVIGATION_UNDEFINED;
  navigationHidden=NAVIGATIONHIDDEN_UNDEFINED;
  orientation=ORIENTATION_UNDEFINED;
  screenLayout=SCREENLAYOUT_SIZE_UNDEFINED;
  uiMode=UI_MODE_TYPE_UNDEFINED;
  seq=0;
  customTheme=null;
}

Fixed version (ground truth):
/** 
 * Set this object to the system defaults.
 */
public void setToDefaults(){
  fontScale=0;
  mcc=mnc=0;
  locale=null;
  userSetLocale=false;
  touchscreen=TOUCHSCREEN_UNDEFINED;
  keyboard=KEYBOARD_UNDEFINED;
  keyboardHidden=KEYBOARDHIDDEN_UNDEFINED;
  hardKeyboardHidden=HARDKEYBOARDHIDDEN_UNDEFINED;
  navigation=NAVIGATION_UNDEFINED;
  navigationHidden=NAVIGATIONHIDDEN_UNDEFINED;
  orientation=ORIENTATION_UNDEFINED;
  screenLayout=SCREENLAYOUT_SIZE_UNDEFINED;
  uiMode=UI_MODE_TYPE_UNDEFINED;
  seq=0;
  customTheme=null;
}
Program: 41074
Project: 41074
Buggy source:
/** 
 * Convenience function to read all of the current configuration-related settings into a  {@link Configuration} object.
 * @param cr The ContentResolver to access.
 * @param outConfig Where to place the configuration settings.
 */
public static void getConfiguration(ContentResolver cr,Configuration outConfig){
  outConfig.fontScale=Settings.System.getFloat(cr,FONT_SCALE,outConfig.fontScale);
  if (outConfig.fontScale < 0) {
    outConfig.fontScale=1;
  }
}

Fixed version (ground truth):
/** 
 * Convenience function to read all of the current configuration-related settings into a  {@link Configuration} object.
 * @param cr The ContentResolver to access.
 * @param outConfig Where to place the configuration settings.
 */
public static void getConfiguration(ContentResolver cr,Configuration outConfig){
  outConfig.fontScale=Settings.System.getFloat(cr,FONT_SCALE,outConfig.fontScale);
  if (!(outConfig.fontScale > 0)) {
    outConfig.fontScale=1;
  }
}
Program: 41077
Project: 41077
Buggy source:
/** 
 * Sets the smart-contrast feature
 * @param boolean
 */
public void setSmartContrastEnabled(boolean enabled){
  set(KEY_SMART_CONTRAST,enabled ? "String_Node_Str" : "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets the smart-contrast feature
 * @param enabled SMART_CONTRAST desired status.
 */
public void setSmartContrastEnabled(boolean enabled){
  set(KEY_SMART_CONTRAST,enabled ? "String_Node_Str" : "String_Node_Str");
}
Program: 41078
Project: 41078
Buggy source:
/** 
 * After a change in the connectivity state of any network, We're mainly concerned with making sure that the list of DNS servers is setupup according to which networks are connected, and ensuring that the right routing table entries exist.
 */
private void handleConnectivityChange(int netType){
  handleDnsConfigurationChange(netType);
  if (mNetTrackers[netType].getNetworkInfo().isConnected()) {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].addDefaultRoute();
    }
 else {
      mNetTrackers[netType].addPrivateDnsRoutes();
    }
  }
 else {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].removeDefaultRoute();
    }
 else {
      mNetTrackers[netType].removePrivateDnsRoutes();
    }
  }
}

Fixed version (ground truth):
/** 
 * After a change in the connectivity state of any network, We're mainly concerned with making sure that the list of DNS servers is setupup according to which networks are connected, and ensuring that the right routing table entries exist.
 */
private void handleConnectivityChange(int netType){
  handleDnsConfigurationChange(netType);
  if (mNetTrackers[netType].getNetworkInfo().isConnected()) {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].addDefaultRoute();
    }
 else {
      if (mActiveDefaultNetwork != -1) {
        String defaultIface=mNetTrackers[mActiveDefaultNetwork].getInterfaceName();
        if (defaultIface != null && !defaultIface.equals(mNetTrackers[netType].getInterfaceName())) {
          mNetTrackers[netType].removeDefaultRoute();
        }
      }
      mNetTrackers[netType].addPrivateDnsRoutes();
    }
  }
 else {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].removeDefaultRoute();
    }
 else {
      mNetTrackers[netType].removePrivateDnsRoutes();
    }
  }
}
Program: 41079
Project: 41079
Buggy source:
/** 
 * Return NetworkInfo for the active (i.e., connected) network interface. It is assumed that at most one network is active at a time. If more than one is active, it is indeterminate which will be returned.
 * @return the info for the active network, or {@code null} if none isactive
 */
public NetworkInfo getActiveNetworkInfo(){
  enforceAccessPermission();
  for (int type=0; type <= ConnectivityManager.MAX_NETWORK_TYPE; type++) {
    if (mNetAttributes[type] == null || !mNetAttributes[type].isDefault()) {
      continue;
    }
    NetworkStateTracker t=mNetTrackers[type];
    NetworkInfo info=t.getNetworkInfo();
    if (info.isConnected()) {
      if (DBG && type != mActiveDefaultNetwork)       Slog.e(TAG,"String_Node_Str" + "String_Node_Str");
      return info;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return NetworkInfo for the active (i.e., connected) network interface. It is assumed that at most one network is active at a time. If more than one is active, it is indeterminate which will be returned.
 * @return the info for the active network, or {@code null} if none isactive
 */
public NetworkInfo getActiveNetworkInfo(){
  enforceAccessPermission();
  if (mActiveDefaultNetwork != -1) {
    return mNetTrackers[mActiveDefaultNetwork].getNetworkInfo();
  }
  return null;
}
Program: 41080
Project: 41080
Buggy source:
/** 
 * After a change in the connectivity state of any network, We're mainly concerned with making sure that the list of DNS servers is setupup according to which networks are connected, and ensuring that the right routing table entries exist.
 */
private void handleConnectivityChange(int netType){
  handleDnsConfigurationChange(netType);
  if (mNetTrackers[netType].getNetworkInfo().isConnected()) {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].addDefaultRoute();
    }
 else {
      mNetTrackers[netType].addPrivateDnsRoutes();
    }
  }
 else {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].removeDefaultRoute();
    }
 else {
      mNetTrackers[netType].removePrivateDnsRoutes();
    }
  }
}

Fixed version (ground truth):
/** 
 * After a change in the connectivity state of any network, We're mainly concerned with making sure that the list of DNS servers is setupup according to which networks are connected, and ensuring that the right routing table entries exist.
 */
private void handleConnectivityChange(int netType){
  handleDnsConfigurationChange(netType);
  if (mNetTrackers[netType].getNetworkInfo().isConnected()) {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].addDefaultRoute();
    }
 else {
      if (mActiveDefaultNetwork != -1) {
        String defaultIface=mNetTrackers[mActiveDefaultNetwork].getInterfaceName();
        if (defaultIface != null && !defaultIface.equals(mNetTrackers[netType].getInterfaceName())) {
          mNetTrackers[netType].removeDefaultRoute();
        }
      }
      mNetTrackers[netType].addPrivateDnsRoutes();
    }
  }
 else {
    if (mNetAttributes[netType].isDefault()) {
      mNetTrackers[netType].removeDefaultRoute();
    }
 else {
      mNetTrackers[netType].removePrivateDnsRoutes();
    }
  }
}
Program: 41081
Project: 41081
Buggy source:
/** 
 * Return NetworkInfo for the active (i.e., connected) network interface. It is assumed that at most one network is active at a time. If more than one is active, it is indeterminate which will be returned.
 * @return the info for the active network, or {@code null} if none isactive
 */
public NetworkInfo getActiveNetworkInfo(){
  enforceAccessPermission();
  for (int type=0; type <= ConnectivityManager.MAX_NETWORK_TYPE; type++) {
    if (mNetAttributes[type] == null || !mNetAttributes[type].isDefault()) {
      continue;
    }
    NetworkStateTracker t=mNetTrackers[type];
    NetworkInfo info=t.getNetworkInfo();
    if (info.isConnected()) {
      if (DBG && type != mActiveDefaultNetwork)       Slog.e(TAG,"String_Node_Str" + "String_Node_Str");
      return info;
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Return NetworkInfo for the active (i.e., connected) network interface. It is assumed that at most one network is active at a time. If more than one is active, it is indeterminate which will be returned.
 * @return the info for the active network, or {@code null} if none isactive
 */
public NetworkInfo getActiveNetworkInfo(){
  enforceAccessPermission();
  if (mActiveDefaultNetwork != -1) {
    return mNetTrackers[mActiveDefaultNetwork].getNetworkInfo();
  }
  return null;
}