nus-yam/ex-repair huggingface dataset:
Program: 57524
Project: 57524
Buggy source:
/** 
 * Create an UnknownDistributionChiSquareTest instance.
 * @return a new UnknownDistributionChiSquareTest instance
 */
public abstract ChiSquareTest createChiSquareTest();

Fixed version (ground truth):
/** 
 * Create a ChiSquareTest instance.
 * @return a new ChiSquareTest instance
 */
public abstract ChiSquareTest createChiSquareTest();
Program: 57525
Project: 57525
Buggy source:
/** 
 * Create an UnknownDistributionChiSquareTest instance.
 * @return a new UnknownDistributionChiSquareTest instance
 */
public ChiSquareTest createChiSquareTest(){
  return new ChiSquareTestImpl();
}

Fixed version (ground truth):
/** 
 * Create a ChiSquareTest instance.
 * @return a new ChiSquareTest instance
 */
public ChiSquareTest createChiSquareTest(){
  return new ChiSquareTestImpl();
}
Program: 57526
Project: 57526
Buggy source:
public void setUp(){
  testStatistic=TestUtils.getChiSquareTest();
}

Fixed version (ground truth):
public void setUp(){
  super.setUp();
  testStatistic=TestUtils.getChiSquareTest();
}
Program: 57527
Project: 57527
Buggy source:
public void setUp(){
  testStatistic=TestUtils.getTTest();
}

Fixed version (ground truth):
public void setUp(){
  super.setUp();
  testStatistic=TestUtils.getTTest();
}
Program: 57528
Project: 57528
Buggy source:
/** 
 * Returns true if the internal storage array has too many unused  storage positions.  
 * @return true if array satisfies the contraction criteria
 */
private synchronized boolean shouldContract(){
  if (expansionMode == MULTIPLICATIVE_MODE) {
    return (internalArray.length / numElements) > contractionCriteria;
  }
 else {
    return (internalArray.length - numElements) > contractionCriteria;
  }
}

Fixed version (ground truth):
/** 
 * Returns true if the internal storage array has too many unused  storage positions.  
 * @return true if array satisfies the contraction criteria
 */
private synchronized boolean shouldContract(){
  if (expansionMode == MULTIPLICATIVE_MODE) {
    return (internalArray.length / ((float)numElements)) > contractionCriteria;
  }
 else {
    return (internalArray.length - numElements) > contractionCriteria;
  }
}
Program: 57529
Project: 57529
Buggy source:
/** 
 * Constructs an exception with specified formatted detail message. Message formatting is delegated to   {@link java.text.MessageFormat}.
 * @param argument  the failing function argument 
 * @param pattern format specifier
 * @param arguments format arguments
 */
public MaxIterationsExceededException(int maxIterations,String pattern,Object[] arguments){
  super(pattern,arguments);
  this.maxIterations=maxIterations;
}

Fixed version (ground truth):
/** 
 * Constructs an exception with specified formatted detail message. Message formatting is delegated to   {@link java.text.MessageFormat}.
 * @param maxIterations the exceeded maximal number of iterations
 * @param pattern format specifier
 * @param arguments format arguments
 */
public MaxIterationsExceededException(int maxIterations,String pattern,Object[] arguments){
  super(pattern,arguments);
  this.maxIterations=maxIterations;
}
Program: 57530
Project: 57530
Buggy source:
/** 
 * Performs a paired t-test evaluating the null hypothesis that the  mean of the paired differences between <code>sample1</code> and <code>sample2</code> is 0 in favor of the two-sided alternative that the  mean paired difference is not equal to 0, with significance level  <code>alpha</code>. <p> Returns <code>true</code> iff the null hypothesis can be rejected with  confidence <code>1 - alpha</code>.  To perform a 1-sided test, use  <code>alpha / 2</code> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The input array lengths must be the same and their common length  must be at least 2. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sample1 array of sample data values
 * @param sample2 array of sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public abstract boolean pairedTTest(double[] sample1,double[] sample2,double alpha) throws IllegalArgumentException, MathException ;

Fixed version (ground truth):
/** 
 * Performs a paired t-test evaluating the null hypothesis that the  mean of the paired differences between <code>sample1</code> and <code>sample2</code> is 0 in favor of the two-sided alternative that the  mean paired difference is not equal to 0, with significance level  <code>alpha</code>. <p> Returns <code>true</code> iff the null hypothesis can be rejected with  confidence <code>1 - alpha</code>.  To perform a 1-sided test, use  <code>alpha * 2</code> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The input array lengths must be the same and their common length  must be at least 2. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sample1 array of sample data values
 * @param sample2 array of sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public abstract boolean pairedTTest(double[] sample1,double[] sample2,double alpha) throws IllegalArgumentException, MathException ;
Program: 57532
Project: 57532
Buggy source:
/** 
 * Performs a paired t-test evaluating the null hypothesis that the  mean of the paired differences between <code>sample1</code> and <code>sample2</code> is 0 in favor of the two-sided alternative that the  mean paired difference is not equal to 0, with significance level  <code>alpha</code>. <p> Returns <code>true</code> iff the null hypothesis can be rejected with  confidence <code>1 - alpha</code>.  To perform a 1-sided test, use  <code>alpha / 2</code> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The input array lengths must be the same and their common length  must be at least 2. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sample1 array of sample data values
 * @param sample2 array of sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean pairedTTest(double[] sample1,double[] sample2,double alpha) throws IllegalArgumentException, MathException {
  if ((alpha <= 0) || (alpha > 0.5)) {
    throw new IllegalArgumentException("String_Node_Str" + alpha);
  }
  return (pairedTTest(sample1,sample2) < alpha);
}

Fixed version (ground truth):
/** 
 * Performs a paired t-test evaluating the null hypothesis that the  mean of the paired differences between <code>sample1</code> and <code>sample2</code> is 0 in favor of the two-sided alternative that the  mean paired difference is not equal to 0, with significance level  <code>alpha</code>. <p> Returns <code>true</code> iff the null hypothesis can be rejected with  confidence <code>1 - alpha</code>.  To perform a 1-sided test, use  <code>alpha * 2</code> <p> <strong>Usage Note:</strong><br> The validity of the test depends on the assumptions of the parametric t-test procedure, as discussed  <a href="http://www.basic.nwu.edu/statguidefiles/ttest_unpaired_ass_viol.html"> here</a> <p> <strong>Preconditions</strong>: <ul> <li>The input array lengths must be the same and their common length  must be at least 2. </li> <li> <code> 0 < alpha < 0.5 </code> </li></ul>
 * @param sample1 array of sample data values
 * @param sample2 array of sample data values
 * @param alpha significance level of the test
 * @return true if the null hypothesis can be rejected with confidence 1 - alpha
 * @throws IllegalArgumentException if the preconditions are not met
 * @throws MathException if an error occurs performing the test
 */
public boolean pairedTTest(double[] sample1,double[] sample2,double alpha) throws IllegalArgumentException, MathException {
  if ((alpha <= 0) || (alpha > 0.5)) {
    throw new IllegalArgumentException("String_Node_Str" + alpha);
  }
  return (pairedTTest(sample1,sample2) < alpha);
}
Program: 57533
Project: 57533
Buggy source:
/** 
 * Constructor for ChiSquareDistributionTest.
 * @param name
 */
public ExponentialDistributionTest(String name){
  super(name);
}

Fixed version (ground truth):
/** 
 * Constructor for ExponentialDistributionTest.
 * @param name
 */
public ExponentialDistributionTest(String name){
  super(name);
}
Program: 57534
Project: 57534
Buggy source:
/** 
 * Returns true iff all entries of (all subarrays of) the input array are >= 0. Returns true if the array is non-null, but empty
 * @param in array to be tested
 * @return true if all entries of the array are non-negative
 * @throws NullPointerException if input array is null
 */
private boolean isNonNegative(long[][] in){
  for (int i=0; i < in.length; i++) {
    for (int j=0; j < in[i].length; j++) {
      if (in[i][j] <= 0) {
        return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns true iff all entries of (all subarrays of) the input array are >= 0. Returns true if the array is non-null, but empty
 * @param in array to be tested
 * @return true if all entries of the array are non-negative
 * @throws NullPointerException if input array is null
 */
private boolean isNonNegative(long[][] in){
  for (int i=0; i < in.length; i++) {
    for (int j=0; j < in[i].length; j++) {
      if (in[i][j] < 0) {
        return false;
      }
    }
  }
  return true;
}
Program: 57535
Project: 57535
Buggy source:
/** 
 * Returns the significance level of the slope (equiv) correlation.  <p> Specifically, the returned value is the smallest <code>alpha</code> such that the slope confidence interval with significance level equal to <code>alpha</code> does not include <code>0</code>. On regression output, this is often denoted <code>Prob(|t| > 0)</code> <p> <strong>Usage Note</strong>:<br> The validity of this statistic depends on the assumption that the  observations included in the model are drawn from a <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html"> Bivariate Normal Distribution</a>. <p> If there are fewer that <strong>three</strong> observations in the  model, or if there is no variation in x, this returns  <code>Double.NaN</code>.
 * @return significance level for slope/correlation
 * @throws MathException if the significance level can not be computed.
 */
public double getSignificance() throws MathException {
  return (1.0 - getTDistribution().cumulativeProbability(Math.abs(getSlope()) / getSlopeStdErr()));
}

Fixed version (ground truth):
/** 
 * Returns the significance level of the slope (equiv) correlation.  <p> Specifically, the returned value is the smallest <code>alpha</code> such that the slope confidence interval with significance level equal to <code>alpha</code> does not include <code>0</code>. On regression output, this is often denoted <code>Prob(|t| > 0)</code> <p> <strong>Usage Note</strong>:<br> The validity of this statistic depends on the assumption that the  observations included in the model are drawn from a <a href="http://mathworld.wolfram.com/BivariateNormalDistribution.html"> Bivariate Normal Distribution</a>. <p> If there are fewer that <strong>three</strong> observations in the  model, or if there is no variation in x, this returns  <code>Double.NaN</code>.
 * @return significance level for slope/correlation
 * @throws MathException if the significance level can not be computed.
 */
public double getSignificance() throws MathException {
  return 2d * (1.0 - getTDistribution().cumulativeProbability(Math.abs(getSlope()) / getSlopeStdErr()));
}
Program: 57536
Project: 57536
Buggy source:
public void testInference() throws Exception {
  SimpleRegression regression=new SimpleRegression();
  regression.addData(infData);
  assertEquals("String_Node_Str",0.0271,regression.getSlopeConfidenceInterval(),0.0001);
  assertEquals("String_Node_Str",0.01146,regression.getSlopeStdErr(),0.0001);
  regression=new SimpleRegression();
  regression.addData(infData2);
  assertEquals("String_Node_Str",0.023331,regression.getSignificance(),0.0001);
  assertTrue("String_Node_Str",regression.getSlopeConfidenceInterval() < regression.getSlopeConfidenceInterval(0.01));
  try {
    double x=regression.getSlopeConfidenceInterval(1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
    ;
  }
}

Fixed version (ground truth):
public void testInference() throws Exception {
  regression=new SimpleRegression();
  regression.addData(infData);
  assertEquals("String_Node_Str",0.011448491,regression.getSlopeStdErr(),1E-10);
  assertEquals("String_Node_Str",0.286036932,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",4.596e-07,regression.getSignificance(),1E-8);
  assertEquals("String_Node_Str",0.0270713794287,regression.getSlopeConfidenceInterval(),1E-8);
  regression=new SimpleRegression();
  regression.addData(infData2);
  assertEquals("String_Node_Str",1.07260253,regression.getSlopeStdErr(),1E-8);
  assertEquals("String_Node_Str",4.17718672,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",0.26183,regression.getSignificance(),1E-5);
  assertEquals("String_Node_Str",2.97802204827,regression.getSlopeConfidenceInterval(),1E-8);
  assertTrue("String_Node_Str",regression.getSlopeConfidenceInterval() < regression.getSlopeConfidenceInterval(0.01));
  try {
    double x=regression.getSlopeConfidenceInterval(1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
    ;
  }
}
Program: 57537
Project: 57537
Buggy source:
public void testInference() throws Exception {
  regression=new SimpleRegression();
  regression.addData(infData);
  assertEquals("String_Node_Str",0.011448491,regression.getSlopeStdErr(),1E-10);
  assertEquals("String_Node_Str",0.286036932,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",4.596e-07,regression.getSignificance(),1E-8);
  assertEquals("String_Node_Str",0.0270713794287,regression.getSlopeConfidenceInterval(),1E-8);
  regression=new SimpleRegression();
  regression.addData(infData2);
  assertEquals("String_Node_Str",1.07260253,regression.getSlopeStdErr(),1E-8);
  assertEquals("String_Node_Str",4.17718672,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",0.26183,regression.getSignificance(),1E-5);
  assertEquals("String_Node_Str",2.97802204827,regression.getSlopeConfidenceInterval(),1E-8);
  assertTrue("String_Node_Str",regression.getSlopeConfidenceInterval() < regression.getSlopeConfidenceInterval(0.01));
  try {
    double x=regression.getSlopeConfidenceInterval(1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
    ;
  }
}

Fixed version (ground truth):
public void testInference() throws Exception {
  SimpleRegression regression=new SimpleRegression();
  regression.addData(infData);
  assertEquals("String_Node_Str",0.011448491,regression.getSlopeStdErr(),1E-10);
  assertEquals("String_Node_Str",0.286036932,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",4.596e-07,regression.getSignificance(),1E-8);
  assertEquals("String_Node_Str",0.0270713794287,regression.getSlopeConfidenceInterval(),1E-8);
  regression=new SimpleRegression();
  regression.addData(infData2);
  assertEquals("String_Node_Str",1.07260253,regression.getSlopeStdErr(),1E-8);
  assertEquals("String_Node_Str",4.17718672,regression.getInterceptStdErr(),1E-8);
  assertEquals("String_Node_Str",0.26183,regression.getSignificance(),1E-5);
  assertEquals("String_Node_Str",2.97802204827,regression.getSlopeConfidenceInterval(),1E-8);
  assertTrue("String_Node_Str",regression.getSlopeConfidenceInterval() < regression.getSlopeConfidenceInterval(0.01));
  try {
    double x=regression.getSlopeConfidenceInterval(1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
    ;
  }
}
Program: 57538
Project: 57538
Buggy source:
/** 
 * Returns an Iterator over the set of values that have been added.
 * @return values Iterator
 */
public Iterator valuesIterator(){
  return freqTable.keySet().iterator();
}

Fixed version (ground truth):
/** 
 * Returns an Iterator over the set of values that have been added. <p> If added values are itegral (i.e., integers, longs, Integers, or Longs),  they are converted to Longs when they are added, so the objects returned by the Iterator will in this case be Longs.
 * @return values Iterator
 */
public Iterator valuesIterator(){
  return freqTable.keySet().iterator();
}
Program: 57539
Project: 57539
Buggy source:
/** 
 * test pcts 
 */
public void testPcts(){
  f.addValue(oneL);
  f.addValue(twoL);
  f.addValue(oneI);
  f.addValue(twoI);
  f.addValue(threeL);
  f.addValue(threeL);
  f.addValue(3);
  f.addValue(threeI);
  assertEquals("String_Node_Str",0.25,f.getPct(1),tolerance);
  assertEquals("String_Node_Str",0.25,f.getPct(new Long(2)),tolerance);
  assertEquals("String_Node_Str",0.5,f.getPct(threeL),tolerance);
  assertEquals("String_Node_Str",0,f.getPct(5),tolerance);
  assertEquals("String_Node_Str",0,f.getPct("String_Node_Str"),tolerance);
  assertEquals("String_Node_Str",0.25,f.getCumPct(1),tolerance);
  assertEquals("String_Node_Str",0.50,f.getCumPct(new Long(2)),tolerance);
  assertEquals("String_Node_Str",1.0,f.getCumPct(threeL),tolerance);
  assertEquals("String_Node_Str",1.0,f.getCumPct(5),tolerance);
  assertEquals("String_Node_Str",0.0,f.getCumPct(0),tolerance);
  assertEquals("String_Node_Str",0,f.getCumPct("String_Node_Str"),tolerance);
}

Fixed version (ground truth):
/** 
 * test pcts 
 */
public void testPcts(){
  f.addValue(oneL);
  f.addValue(twoL);
  f.addValue(oneI);
  f.addValue(twoI);
  f.addValue(threeL);
  f.addValue(threeL);
  f.addValue(3);
  f.addValue(threeI);
  assertEquals("String_Node_Str",0.25,f.getPct(1),tolerance);
  assertEquals("String_Node_Str",0.25,f.getPct(new Long(2)),tolerance);
  assertEquals("String_Node_Str",0.5,f.getPct(threeL),tolerance);
  assertEquals("String_Node_Str",0,f.getPct(5),tolerance);
  assertEquals("String_Node_Str",0,f.getPct("String_Node_Str"),tolerance);
  assertEquals("String_Node_Str",0.25,f.getCumPct(1),tolerance);
  assertEquals("String_Node_Str",0.50,f.getCumPct(new Long(2)),tolerance);
  assertEquals("String_Node_Str",0.50,f.getCumPct(new Integer(2)),tolerance);
  assertEquals("String_Node_Str",1.0,f.getCumPct(threeL),tolerance);
  assertEquals("String_Node_Str",1.0,f.getCumPct(5),tolerance);
  assertEquals("String_Node_Str",0.0,f.getCumPct(0),tolerance);
  assertEquals("String_Node_Str",0,f.getCumPct("String_Node_Str"),tolerance);
}
Program: 57542
Project: 57542
Buggy source:
/** 
 * Create an AbstractDescriptiveStatistics with a specific Window
 * @param window WindowSIze for stat calculation
 */
public AbstractDescriptiveStatistics(int window){
  setWindowSize(window);
}

Fixed version (ground truth):
/** 
 * Create an AbstractDescriptiveStatistics
 */
protected AbstractDescriptiveStatistics(){
  super();
}
Program: 57543
Project: 57543
Buggy source:
/** 
 * Create an instance of a <code>DescriptiveStatistics</code>
 * @return a new factory. 
 */
public static DescriptiveStatistics newInstance(){
  DescriptiveStatistics factory=null;
  try {
    DiscoverClass dc=new DiscoverClass();
    factory=(DescriptiveStatistics)dc.newInstance(DescriptiveStatistics.class,"String_Node_Str");
  }
 catch (  Exception ex) {
  }
  return factory;
}

Fixed version (ground truth):
/** 
 * Create an instance of a <code>DescriptiveStatistics</code>
 * @return a new factory. 
 */
public static DescriptiveStatistics newInstance(){
  DescriptiveStatistics factory=null;
  try {
    DiscoverClass dc=new DiscoverClass();
    factory=(DescriptiveStatistics)dc.newInstance(DescriptiveStatistics.class,"String_Node_Str");
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  return factory;
}
Program: 57544
Project: 57544
Buggy source:
/** 
 * Apply the given statistic to this univariate collection.
 * @param stat the statistic to apply
 * @return the computed value of the statistic.
 */
public double apply(UnivariateStatistic stat){
  if (eDA != null) {
    return stat.evaluate(eDA.getValues(),eDA.start(),eDA.getNumElements());
  }
  return Double.NaN;
}

Fixed version (ground truth):
/** 
 * Apply the given statistic to this univariate collection.
 * @param stat the statistic to apply
 * @return the computed value of the statistic.
 */
public double apply(UnivariateStatistic stat){
  return stat.evaluate(eDA.getValues(),eDA.start(),eDA.getNumElements());
}
Program: 57545
Project: 57545
Buggy source:
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#clear()
 */
public synchronized void clear(){
  eDA.clear();
}

Fixed version (ground truth):
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#clear()
 */
public void clear(){
  eDA.clear();
}
Program: 57546
Project: 57546
Buggy source:
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#setWindowSize(int)
 */
public synchronized void setWindowSize(int windowSize){
  this.windowSize=windowSize;
  if (windowSize < eDA.getNumElements()) {
    eDA.discardFrontElements(eDA.getNumElements() - windowSize);
  }
}

Fixed version (ground truth):
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#setWindowSize(int)
 */
public void setWindowSize(int windowSize){
  if (windowSize < 1) {
    if (windowSize != INFINITE_WINDOW) {
      throw new IllegalArgumentException("String_Node_Str");
    }
  }
  this.windowSize=windowSize;
  if (windowSize != INFINITE_WINDOW && windowSize < eDA.getNumElements()) {
    eDA.discardFrontElements(eDA.getNumElements() - windowSize);
  }
}
Program: 57547
Project: 57547
Buggy source:
/** 
 * Construct a DescriptiveStatisticsImpl with finite window
 * @param window the finite window size.
 */
public DescriptiveStatisticsImpl(int window){
  super(window);
  eDA=new ContractableDoubleArray();
}

Fixed version (ground truth):
/** 
 * Construct a DescriptiveStatisticsImpl with finite window
 * @param window the finite window size.
 */
public DescriptiveStatisticsImpl(int window){
  super();
  eDA=new ContractableDoubleArray();
  setWindowSize(window);
}
Program: 57548
Project: 57548
Buggy source:
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#addValue(double)
 */
public synchronized void addValue(double v){
  if (windowSize != INFINITE_WINDOW) {
    if (getN() == windowSize) {
      eDA.addElementRolling(v);
    }
 else     if (getN() < windowSize) {
      eDA.addElement(v);
    }
 else {
      String msg="String_Node_Str" + "String_Node_Str";
      throw new RuntimeException(msg);
    }
  }
 else {
    eDA.addElement(v);
  }
}

Fixed version (ground truth):
/** 
 * @see org.apache.commons.math.stat.univariate.DescriptiveStatistics#addValue(double)
 */
public void addValue(double v){
  if (windowSize != INFINITE_WINDOW) {
    if (getN() == windowSize) {
      eDA.addElementRolling(v);
    }
 else     if (getN() < windowSize) {
      eDA.addElement(v);
    }
  }
 else {
    eDA.addElement(v);
  }
}
Program: 57549
Project: 57549
Buggy source:
public void testTestPositive(){
  for (int j=0; j < 5; j++) {
    for (int i=1; i < (7 - j); i++) {
      assertTrue(testStatistic.test(testArray,0,i));
    }
  }
  assertTrue(testStatistic.test(singletonArray,0,1));
}

Fixed version (ground truth):
public void testTestPositive(){
  for (int j=0; j < 6; j++) {
    for (int i=1; i < (7 - j); i++) {
      assertTrue(testStatistic.test(testArray,0,i));
    }
  }
  assertTrue(testStatistic.test(singletonArray,0,1));
}
Program: 57550
Project: 57550
Buggy source:
public void testTestNegative(){
  assertFalse(testStatistic.test(singletonArray,0,0));
  assertFalse(testStatistic.test(testArray,0,0));
  try {
    testStatistic.test(singletonArray,2,1);
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,0,7);
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,-1,1);
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,0,-1);
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(nullArray,0,1);
  }
 catch (  IllegalArgumentException ex) {
  }
}

Fixed version (ground truth):
public void testTestNegative(){
  assertFalse(testStatistic.test(singletonArray,0,0));
  assertFalse(testStatistic.test(testArray,0,0));
  try {
    testStatistic.test(singletonArray,2,1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,0,7);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,-1,1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(testArray,0,-1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
  }
  try {
    testStatistic.test(nullArray,0,1);
    fail("String_Node_Str");
  }
 catch (  IllegalArgumentException ex) {
  }
}
Program: 57551
Project: 57551
Buggy source:
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected abstract double getDomainUpperBound(double p);

Fixed version (ground truth):
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected abstract double getDomainUpperBound(double p);
Program: 57552
Project: 57552
Buggy source:
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected abstract double getDomainLowerBound(double p);

Fixed version (ground truth):
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected abstract double getDomainLowerBound(double p);
Program: 57553
Project: 57553
Buggy source:
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected abstract double getInitialDomain(double p);

Fixed version (ground truth):
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected abstract double getInitialDomain(double p);
Program: 57554
Project: 57554
Buggy source:
public double value(double x) throws MathException {
  return cummulativeProbability(x) - p;
}

Fixed version (ground truth):
public double value(double x) throws MathException {
  return cumulativeProbability(x) - p;
}
Program: 57555
Project: 57555
Buggy source:
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a PDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected abstract int getDomainUpperBound(double p);

Fixed version (ground truth):
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a PDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected abstract int getDomainUpperBound(double p);
Program: 57556
Project: 57556
Buggy source:
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a PDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected abstract int getDomainLowerBound(double p);

Fixed version (ground truth):
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a PDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected abstract int getDomainLowerBound(double p);
Program: 57557
Project: 57557
Buggy source:
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected double getDomainUpperBound(double p){
  double ret;
  if (p < .5) {
    ret=getDegreesOfFreedom();
  }
 else {
    ret=Double.MAX_VALUE;
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected double getDomainUpperBound(double p){
  double ret;
  if (p < .5) {
    ret=getDegreesOfFreedom();
  }
 else {
    ret=Double.MAX_VALUE;
  }
  return ret;
}
Program: 57558
Project: 57558
Buggy source:
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected double getDomainLowerBound(double p){
  return Double.MIN_VALUE * getGamma().getBeta();
}

Fixed version (ground truth):
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected double getDomainLowerBound(double p){
  return Double.MIN_VALUE * getGamma().getBeta();
}
Program: 57559
Project: 57559
Buggy source:
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected double getInitialDomain(double p){
  double ret;
  if (p < .5) {
    ret=getDegreesOfFreedom() * .5;
  }
 else {
    ret=getDegreesOfFreedom();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected double getInitialDomain(double p){
  double ret;
  if (p < .5) {
    ret=getDegreesOfFreedom() * .5;
  }
 else {
    ret=getDegreesOfFreedom();
  }
  return ret;
}
Program: 57560
Project: 57560
Buggy source:
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected double getDomainUpperBound(double p){
  return Double.MAX_VALUE;
}

Fixed version (ground truth):
/** 
 * Access the domain value upper bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value upper bound, i.e.P(X &lt; <i>upper bound</i>) &gt; <code>p</code> 
 */
protected double getDomainUpperBound(double p){
  return Double.MAX_VALUE;
}
Program: 57561
Project: 57561
Buggy source:
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected double getDomainLowerBound(double p){
  return 0.0;
}

Fixed version (ground truth):
/** 
 * Access the domain value lower bound, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return domain value lower bound, i.e.P(X &lt; <i>lower bound</i>) &lt; <code>p</code> 
 */
protected double getDomainLowerBound(double p){
  return 0.0;
}
Program: 57562
Project: 57562
Buggy source:
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCummulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected double getInitialDomain(double p){
  return getDenominatorDegreesOfFreedom() / (getDenominatorDegreesOfFreedom() - 2.0);
}

Fixed version (ground truth):
/** 
 * Access the initial domain value, based on <code>p</code>, used to bracket a CDF root.  This method is used by  {@link #inverseCumulativeProbability(double)} to find critical values.
 * @param p the desired probability for the critical value
 * @return initial domain value
 */
protected double getInitialDomain(double p){
  return getDenominatorDegreesOfFreedom() / (getDenominatorDegreesOfFreedom() - 2.0);
}
Program: 57563
Project: 57563
Buggy source:
/** 
 */
public static Complex tan(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a2=2.0 * z.getReal();
  double b2=2.0 * z.getImaginary();
  double d=Math.cos(a2) + MathUtils.cosh(b2);
  return new Complex(Math.sin(a2) / d,MathUtils.sinh(b2) / 2);
}

Fixed version (ground truth):
/** 
 */
public static Complex tan(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a2=2.0 * z.getReal();
  double b2=2.0 * z.getImaginary();
  double d=Math.cos(a2) + MathUtils.cosh(b2);
  return new Complex(Math.sin(a2) / d,MathUtils.sinh(b2) / d);
}
Program: 57564
Project: 57564
Buggy source:
/** 
 */
public static Complex atan(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  return Complex.I.multiply(log(Complex.I.add(z).divide(Complex.I.subtract(z)))).multiply(new Complex(2.0,0.0));
}

Fixed version (ground truth):
/** 
 */
public static Complex atan(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  return Complex.I.multiply(log(Complex.I.add(z).divide(Complex.I.subtract(z)))).divide(new Complex(2.0,0.0));
}
Program: 57565
Project: 57565
Buggy source:
/** 
 */
public static Complex tanh(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a2=2.0 * z.getReal();
  double b2=2.0 * z.getImaginary();
  double d=MathUtils.cosh(a2) + Math.cos(b2);
  return new Complex(MathUtils.sinh(a2) / d,Math.sin(b2) / 2);
}

Fixed version (ground truth):
/** 
 */
public static Complex tanh(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a2=2.0 * z.getReal();
  double b2=2.0 * z.getImaginary();
  double d=MathUtils.cosh(a2) + Math.cos(b2);
  return new Complex(MathUtils.sinh(a2) / d,Math.sin(b2) / d);
}
Program: 57566
Project: 57566
Buggy source:
/** 
 */
public static Complex sqrt(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a=z.getReal();
  double b=z.getImaginary();
  double t=Math.sqrt((Math.abs(a) + z.abs()) / 2.0);
  if (a >= 0.0) {
    return new Complex(t,b / (2.0 * t));
  }
 else {
    double s=(b > 0.0 ? 1.0 : (b < 0.0 ? -1.0 : 0.0));
    return new Complex(Math.abs(z.getImaginary()) / (2.0 * t),s * t);
  }
}

Fixed version (ground truth):
/** 
 */
public static Complex sqrt(Complex z){
  if (z.isNaN()) {
    return Complex.NaN;
  }
  double a=z.getReal();
  double b=z.getImaginary();
  double t=Math.sqrt((Math.abs(a) + z.abs()) / 2.0);
  if (a >= 0.0) {
    return new Complex(t,b / (2.0 * t));
  }
 else {
    return new Complex(Math.abs(z.getImaginary()) / (2.0 * t),MathUtils.sign(b) * t);
  }
}
Program: 57567
Project: 57567
Buggy source:
public static void assertEquals(double expected,double actual,double delta){
  if (Double.isNaN(expected)) {
    Assert.assertTrue(Double.isNaN(actual));
  }
 else {
    Assert.assertEquals(expected,actual,delta);
  }
}

Fixed version (ground truth):
/** 
 */
public static void assertEquals(Complex expected,Complex actual,double delta){
  assertEquals(expected.getReal(),actual.getReal(),delta);
  assertEquals(expected.getImaginary(),actual.getImaginary(),delta);
}
Program: 57569
Project: 57569
Buggy source:
/** 
 * TEST NORMAL OPERATIONS - calling super class test and then checking internal storage 
 */
public void testAddElementRolling(){
  ra=new FixedDoubleArray(6);
  super.testAddElementRolling();
  assertEquals("String_Node_Str",6,((FixedDoubleArray)ra).internalArray.length);
}

Fixed version (ground truth):
/** 
 * TEST NORMAL OPERATIONS - calling super class test and then checking internal storage 
 */
public void testAddElementRolling(){
  ra=new FixedDoubleArray(6);
  super.testAddElementRolling();
  assertEquals("String_Node_Str",6,((FixedDoubleArray)ra).getValues().length);
}
Program: 57571
Project: 57571
Buggy source:
/** 
 * Creates new form NewJFrame
 */
public AResizerFrame(){
  initComponents();
  try {
    java.net.URL url=ClassLoader.getSystemResource("String_Node_Str");
    Toolkit kit=Toolkit.getDefaultToolkit();
    Image img=kit.createImage(url);
    this.setIconImage(img);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  OutputTxtArea.append("String_Node_Str");
  try {
    BufferedReader reader=new BufferedReader(new FileReader("String_Node_Str"));
    FileField.setText(reader.readLine());
    reader.close();
  }
 catch (  IOException ex) {
    Logger.getLogger(AResizerFrame.class.getName()).log(Level.SEVERE,null,ex);
  }
}

Fixed version (ground truth):
/** 
 * Creates new form NewJFrame
 */
public AResizerFrame(){
  initComponents();
  try {
    java.net.URL url=ClassLoader.getSystemResource("String_Node_Str");
    Toolkit kit=Toolkit.getDefaultToolkit();
    Image img=kit.createImage(url);
    this.setIconImage(img);
  }
 catch (  Exception ex) {
    ex.printStackTrace();
  }
  OutputTxtArea.append("String_Node_Str");
  try {
    BufferedReader reader=new BufferedReader(new FileReader("String_Node_Str"));
    FileField.setText(reader.readLine());
    reader.close();
  }
 catch (  IOException ex) {
    Logger.getLogger(AResizerFrame.class.getName()).log(Level.SEVERE,null,ex);
  }
  if (FileField.getText() != null) {
    File tempDirectory=new File(FileField.getText());
    originalDirectory=tempDirectory;
  }
}
Program: 57573
Project: 57573
Buggy source:
private boolean doRead(SelectionKey selectionKey){
  boolean result=false;
  SocketChannel client=(SocketChannel)selectionKey.channel();
  RpcNioConnector connector=connectorCache.get(client);
  if (connector != null) {
    try {
      RpcNioBuffer connectorReadBuf=connector.getRpcNioReadBuffer();
      ByteBuffer channelReadBuf=connector.getChannelReadBuffer();
      while (!stop) {
        int read=0;
        while ((read=client.read(channelReadBuf)) > 0) {
          channelReadBuf.flip();
          byte[] readBytes=new byte[read];
          channelReadBuf.get(readBytes);
          connectorReadBuf.write(readBytes);
          channelReadBuf.clear();
          while (connectorReadBuf.hasRpcObject()) {
            RpcObject rpc=connectorReadBuf.readRpcObject();
            System.out.println("String_Node_Str" + rpc);
            this.fireRpc(connector,rpc);
          }
        }
        if (read < 1) {
          if (read < 0) {
            this.handSelectionKeyException(selectionKey,new RpcException());
          }
          break;
        }
      }
    }
 catch (    Exception e) {
      this.handSelectionKeyException(selectionKey,e);
    }
  }
  return result;
}

Fixed version (ground truth):
private boolean doRead(SelectionKey selectionKey){
  boolean result=false;
  SocketChannel client=(SocketChannel)selectionKey.channel();
  RpcNioConnector connector=connectorCache.get(client);
  if (connector != null) {
    try {
      RpcNioBuffer connectorReadBuf=connector.getRpcNioReadBuffer();
      ByteBuffer channelReadBuf=connector.getChannelReadBuffer();
      while (!stop) {
        int read=0;
        while ((read=client.read(channelReadBuf)) > 0) {
          channelReadBuf.flip();
          byte[] readBytes=new byte[read];
          channelReadBuf.get(readBytes);
          connectorReadBuf.write(readBytes);
          channelReadBuf.clear();
          while (connectorReadBuf.hasRpcObject()) {
            RpcObject rpc=connectorReadBuf.readRpcObject();
            this.fireRpc(connector,rpc);
          }
        }
        if (read < 1) {
          if (read < 0) {
            this.handSelectionKeyException(selectionKey,new RpcException());
          }
          break;
        }
      }
    }
 catch (    Exception e) {
      this.handSelectionKeyException(selectionKey,e);
    }
  }
  return result;
}
Program: 57574
Project: 57574
Buggy source:
private boolean doWrite(SelectionKey selectionKey){
  boolean result=false;
  SocketChannel channel=(SocketChannel)selectionKey.channel();
  RpcNioConnector connector=connectorCache.get(channel);
  if (connector.isNeedToSend()) {
    try {
      RpcNioBuffer connectorWriteBuf=connector.getRpcNioWriteBuffer();
      ByteBuffer channelWriteBuf=connector.getChannelWriteBuffer();
      while (connector.isNeedToSend()) {
        RpcObject rpc=connector.getToSend();
        System.out.println("String_Node_Str" + rpc);
        connectorWriteBuf.writeRpcObject(rpc);
        channelWriteBuf.put(connectorWriteBuf.readBytes());
        channelWriteBuf.flip();
        int wantWrite=channelWriteBuf.limit() - channelWriteBuf.position();
        int write=0;
        while (write < wantWrite) {
          write+=channel.write(channelWriteBuf);
        }
        channelWriteBuf.clear();
        result=true;
      }
      if (!connector.isNeedToSend()) {
        selectionKey.interestOps(READ_OP);
      }
    }
 catch (    Exception e) {
      this.handSelectionKeyException(selectionKey,e);
    }
  }
  return result;
}

Fixed version (ground truth):
private boolean doWrite(SelectionKey selectionKey){
  boolean result=false;
  SocketChannel channel=(SocketChannel)selectionKey.channel();
  RpcNioConnector connector=connectorCache.get(channel);
  if (connector.isNeedToSend()) {
    try {
      RpcNioBuffer connectorWriteBuf=connector.getRpcNioWriteBuffer();
      ByteBuffer channelWriteBuf=connector.getChannelWriteBuffer();
      while (connector.isNeedToSend()) {
        RpcObject rpc=connector.getToSend();
        connectorWriteBuf.writeRpcObject(rpc);
        channelWriteBuf.put(connectorWriteBuf.readBytes());
        channelWriteBuf.flip();
        int wantWrite=channelWriteBuf.limit() - channelWriteBuf.position();
        int write=0;
        while (write < wantWrite) {
          write+=channel.write(channelWriteBuf);
        }
        channelWriteBuf.clear();
        result=true;
      }
      if (!connector.isNeedToSend()) {
        selectionKey.interestOps(READ_OP);
      }
    }
 catch (    Exception e) {
      this.handSelectionKeyException(selectionKey,e);
    }
  }
  return result;
}
Program: 57575
Project: 57575
Buggy source:
protected void fireCall(final RpcObject rpc){
  executor.execute(new Runnable(){
    @Override public void run(){
      try {
        fireCallListeners(rpc,AbstractRpcConnector.this);
      }
 catch (      Exception e) {
        e.printStackTrace();
        logger.error("String_Node_Str" + e.getMessage());
      }
    }
  }
);
}

Fixed version (ground truth):
public void fireCall(final RpcObject rpc){
  executor.execute(new Runnable(){
    @Override public void run(){
      try {
        fireCallListeners(rpc,AbstractRpcConnector.this);
      }
 catch (      Exception e) {
        e.printStackTrace();
        logger.error("String_Node_Str" + e.getMessage());
      }
    }
  }
);
}
Program: 57576
Project: 57576
Buggy source:
protected void startListeners(){
  for (  RpcCallListener listener : callListeners) {
    if (listener instanceof Service) {
      Service service=(Service)listener;
      service.startService();
    }
  }
}

Fixed version (ground truth):
public void startListeners(){
  for (  RpcCallListener listener : callListeners) {
    if (listener instanceof Service) {
      Service service=(Service)listener;
      service.startService();
    }
  }
}
Program: 57577
Project: 57577
Buggy source:
protected void stopListeners(){
  for (  RpcCallListener listener : callListeners) {
    if (listener instanceof Service) {
      Service service=(Service)listener;
      service.stopService();
    }
  }
}

Fixed version (ground truth):
public void stopListeners(){
  for (  RpcCallListener listener : callListeners) {
    if (listener instanceof Service) {
      Service service=(Service)listener;
      service.stopService();
    }
  }
}
Program: 57578
Project: 57578
Buggy source:
protected void addConnectorListeners(AbstractRpcConnector connector){
  for (  RpcCallListener listener : callListeners) {
    connector.addRpcCallListener(listener);
  }
}

Fixed version (ground truth):
public void addConnectorListeners(AbstractRpcConnector connector){
  for (  RpcCallListener listener : callListeners) {
    connector.addRpcCallListener(listener);
  }
}
Program: 57579
Project: 57579
Buggy source:
public RpcNioAcceptor(){
  try {
    serverSocketChannel=ServerSocketChannel.open();
    serverSocketChannel.configureBlocking(false);
    selection=new RpcNioSelection();
  }
 catch (  IOException e) {
    throw new RpcException(e);
  }
}

Fixed version (ground truth):
public RpcNioAcceptor(){
  try {
    serverSocketChannel=ServerSocketChannel.open();
    serverSocketChannel.configureBlocking(false);
    selection=new RpcNioSelection(this);
  }
 catch (  IOException e) {
    throw new RpcException(e);
  }
}