nus-yam/ex-repair huggingface dataset:
Program: 11552
Project: 11552
Buggy source:
private void createTargetProduct(){
  targetProduct=new Product(sourceProduct.getName(),sourceProduct.getProductType(),sourceProduct.getSceneRasterWidth(),sourceProduct.getSceneRasterHeight());
  final Band[] sourceBands=sourceProduct.getBands();
  for (  Band srcBand : sourceBands) {
    if ((srcBand instanceof VirtualBand)) {
      final VirtualBand srcVirtualBand=(VirtualBand)srcBand;
      final VirtualBand newVirtualBand=new VirtualBand(srcBand.getName(),srcBand.getDataType(),srcBand.getSceneRasterWidth(),srcBand.getRasterHeight(),srcVirtualBand.getExpression());
      targetProduct.addBand(newVirtualBand);
      ProductUtils.copyRasterDataNodeProperties(srcBand,newVirtualBand);
    }
    if (shouldApplyCorrection(srcBand)) {
      final Band newBand=new Band(srcBand.getName(),srcBand.getDataType(),srcBand.getSceneRasterWidth(),srcBand.getRasterHeight());
      targetProduct.addBand(newBand);
      ProductUtils.copyRasterDataNodeProperties(srcBand,newBand);
    }
 else {
      ProductUtils.copyBand(srcBand.getName(),sourceProduct,targetProduct,true);
    }
  }
  ProductUtils.copyProductNodes(sourceProduct,targetProduct);
}

Fixed version (ground truth):
private void createTargetProduct(){
  targetProduct=new Product(sourceProduct.getName(),sourceProduct.getProductType(),sourceProduct.getSceneRasterWidth(),sourceProduct.getSceneRasterHeight());
  final Band[] sourceBands=sourceProduct.getBands();
  for (  Band srcBand : sourceBands) {
    if ((srcBand instanceof VirtualBand)) {
      final VirtualBand srcVirtualBand=(VirtualBand)srcBand;
      final VirtualBand newVirtualBand=new VirtualBand(srcBand.getName(),srcBand.getDataType(),srcBand.getSceneRasterWidth(),srcBand.getRasterHeight(),srcVirtualBand.getExpression());
      targetProduct.addBand(newVirtualBand);
      ProductUtils.copyRasterDataNodeProperties(srcBand,newVirtualBand);
    }
 else     if (shouldApplyCorrection(srcBand)) {
      final Band newBand=new Band(srcBand.getName(),srcBand.getDataType(),srcBand.getSceneRasterWidth(),srcBand.getRasterHeight());
      targetProduct.addBand(newBand);
      ProductUtils.copyRasterDataNodeProperties(srcBand,newBand);
    }
 else {
      ProductUtils.copyBand(srcBand.getName(),sourceProduct,targetProduct,true);
    }
  }
  ProductUtils.copyProductNodes(sourceProduct,targetProduct);
}
Program: 11553
Project: 11553
Buggy source:
/** 
 * Compute kernel function value for a given pair of samples.
 * @param x1 The first sample.
 * @param x2 The second sample.
 * @return The kernel function value.
 * @throws Exception The exception.
 */
public double kernel(final double[] x1,final double[] x2) throws Exception {
  if (x1.length != x2.length) {
    throw new Exception("String_Node_Str");
  }
  double sum=0.0;
  for (int i=0; i < x1.length; i++) {
    final double d=x1[i] - x2[i];
    sum+=d * d;
  }
  return Math.exp(-modelParameters.gamma * sum);
}

Fixed version (ground truth):
/** 
 * Compute kernel function value for a given pair of samples.
 * @param x1 The first sample.
 * @param x2 The second sample.
 * @return The kernel function value.
 * @throws Exception The exception.
 */
public double kernel(final double[] x1,final double[] x2) throws Exception {
  if (x1.length != numFeatures || x2.length != numFeatures) {
    throw new Exception("String_Node_Str");
  }
  double sum=0.0;
  for (int i=0; i < x1.length; i++) {
    final double d=scale(i,x1[i]) - scale(i,x2[i]);
    sum+=d * d;
  }
  return Math.exp(-modelParameters.gamma * sum);
}
Program: 11557
Project: 11557
Buggy source:
public UIValidation validateParameters(){
  if (getSelectedFilter(tree) == null && kernelFile.getText().equals("String_Node_Str"))   return new UIValidation(UIValidation.State.ERROR,"String_Node_Str");
  return new UIValidation(UIValidation.State.OK,"String_Node_Str");
}

Fixed version (ground truth):
public UIValidation validateParameters(){
  if (sourceProducts != null) {
    if (getSelectedFilter(tree) == null && kernelFile.getText().equals("String_Node_Str"))     return new UIValidation(UIValidation.State.ERROR,"String_Node_Str");
  }
  return new UIValidation(UIValidation.State.OK,"String_Node_Str");
}
Program: 11558
Project: 11558
Buggy source:
/** 
 * Convert satellite position from deodetic coordinate to global cartesian coordinate.
 * @param dataRecord The data record read from delft orbit file.
 * @return The data record in cartesian coordinate.
 */
private OrbitPositionRecord computeOrbitPosition(OrbitDataRecord dataRecord){
  final double time=(double)dataRecord.time / Constants.secondsInDay;
  final double utcTime=time + days1985To2000;
  final double alt=(double)dataRecord.heightOfCenterOfMass / 1000.0;
  double lat, lon;
  if (productSpecifier.contains("String_Node_Str")) {
    lat=(double)dataRecord.latitude / Constants.oneMillion;
    lon=(double)dataRecord.longitude / Constants.oneMillion;
  }
 else   if (productSpecifier.contains("String_Node_Str")) {
    lat=(double)dataRecord.latitude / Constants.oneMillion;
    lon=(double)dataRecord.longitude / Constants.oneMillion;
    if (lon > 180) {
      lon-=360;
    }
  }
 else {
    throw new OperatorException("String_Node_Str" + productSpecifier);
  }
  final double[] xyz=new double[3];
  GeoUtils.geo2xyz(lat,lon,alt,xyz,GeoUtils.EarthModel.GRS80);
  final OrbitPositionRecord orbitPosition=new OrbitPositionRecord();
  orbitPosition.utcTime=utcTime;
  orbitPosition.xPos=xyz[0];
  orbitPosition.yPos=xyz[1];
  orbitPosition.zPos=xyz[2];
  return orbitPosition;
}

Fixed version (ground truth):
/** 
 * Convert satellite position from deodetic coordinate to global cartesian coordinate.
 * @param dataRecord The data record read from delft orbit file.
 * @return The data record in cartesian coordinate.
 */
private OrbitPositionRecord computeOrbitPosition(OrbitDataRecord dataRecord){
  final double time=(double)dataRecord.time / Constants.secondsInDay;
  final double utcTime=time + days1985To2000;
  final double alt=(double)dataRecord.heightOfCenterOfMass / 1000.0;
  double lat, lon;
  if (productSpecifier.contains("String_Node_Str")) {
    lat=(double)dataRecord.latitude / Constants.tenMillion;
    lon=(double)dataRecord.longitude / Constants.tenMillion;
  }
 else   if (productSpecifier.contains("String_Node_Str")) {
    lat=(double)dataRecord.latitude / Constants.oneMillion;
    lon=(double)dataRecord.longitude / Constants.oneMillion;
    if (lon > 180) {
      lon-=360;
    }
  }
 else {
    throw new OperatorException("String_Node_Str" + productSpecifier);
  }
  final double[] xyz=new double[3];
  GeoUtils.geo2xyz(lat,lon,alt,xyz,GeoUtils.EarthModel.GRS80);
  final OrbitPositionRecord orbitPosition=new OrbitPositionRecord();
  orbitPosition.utcTime=utcTime;
  orbitPosition.xPos=xyz[0];
  orbitPosition.yPos=xyz[1];
  orbitPosition.zPos=xyz[2];
  return orbitPosition;
}
Program: 11559
Project: 11559
Buggy source:
/** 
 * Removes the given product from this product manager if it exists.
 * @param product the product to be removed, ignored if <code>null</code>
 * @return true, if the product was removed
 */
public boolean removeProduct(Product product){
  if (product != null) {
    int index=productList.indexOf(product);
    if (index >= 0) {
      if (productList.remove(product)) {
        productList.clearRemovedList();
        product.removeProductNodeListener(productNodeNameChangeListener);
        product.resetRefNo();
        clearProductManager(product);
        fireEvent(product,PRODUCT_REMOVED);
        return true;
      }
    }
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Removes the given product from this product manager if it exists.
 * @param product the product to be removed, ignored if <code>null</code>
 * @return true, if the product was removed
 */
public boolean removeProduct(Product product){
  if (product != null) {
    int index=productList.indexOf(product);
    if (index >= 0) {
      if (productList.remove(product)) {
        productList.clearRemovedList();
        product.removeProductNodeListener(productNodeNameChangeListener);
        clearProductManager(product);
        fireEvent(product,PRODUCT_REMOVED);
        product.resetRefNo();
        return true;
      }
    }
  }
  return false;
}
Program: 11562
Project: 11562
Buggy source:
@Override public void initParameters(){
  OperatorUIUtils.initParamList(bandList,getBandNames());
  regionX.setText(String.valueOf(paramMap.get("String_Node_Str")));
  regionY.setText(String.valueOf(paramMap.get("String_Node_Str")));
  Integer widthVal=(Integer)paramMap.get("String_Node_Str");
  Integer heightVal=(Integer)paramMap.get("String_Node_Str");
  if (sourceProducts != null && sourceProducts.length > 0) {
    if (widthVal == null || widthVal == 0)     widthVal=sourceProducts[0].getSceneRasterWidth();
    if (heightVal == null || heightVal == 0)     heightVal=sourceProducts[0].getSceneRasterHeight();
    worldMapUI.getModel().setAutoZoomEnabled(true);
    worldMapUI.getModel().setProducts(sourceProducts);
    worldMapUI.getModel().setSelectedProduct(sourceProducts[0]);
    worldMapUI.getWorlMapPane().zoomToProduct(sourceProducts[0]);
  }
  width.setText(String.valueOf(widthVal));
  height.setText(String.valueOf(heightVal));
  subSamplingX.setText(String.valueOf(paramMap.get("String_Node_Str")));
  subSamplingY.setText(String.valueOf(paramMap.get("String_Node_Str")));
  geoRegion=(Geometry)paramMap.get("String_Node_Str");
  if (geoRegion != null) {
    geoCoordRadio.setSelected(true);
    final Coordinate coord[]=geoRegion.getCoordinates();
    worldMapUI.setSelectionStart((float)coord[0].y,(float)coord[0].x);
    worldMapUI.setSelectionEnd((float)coord[2].y,(float)coord[2].x);
    pixelPanel.setVisible(false);
    geoPanel.setVisible(true);
  }
}

Fixed version (ground truth):
@Override public void initParameters(){
  OperatorUIUtils.initParamList(bandList,getBandNames());
  regionX.setText(String.valueOf(paramMap.get("String_Node_Str")));
  regionY.setText(String.valueOf(paramMap.get("String_Node_Str")));
  Integer widthVal=(Integer)paramMap.get("String_Node_Str");
  Integer heightVal=(Integer)paramMap.get("String_Node_Str");
  if (sourceProducts != null && sourceProducts.length > 0) {
    if (widthVal == null || widthVal == 0)     widthVal=sourceProducts[0].getSceneRasterWidth();
    if (heightVal == null || heightVal == 0)     heightVal=sourceProducts[0].getSceneRasterHeight();
    worldMapUI.getModel().setAutoZoomEnabled(true);
    worldMapUI.getModel().setProducts(sourceProducts);
    worldMapUI.getModel().setSelectedProduct(sourceProducts[0]);
    worldMapUI.getWorlMapPane().zoomToProduct(sourceProducts[0]);
  }
  width.setText(String.valueOf(widthVal));
  height.setText(String.valueOf(heightVal));
  subSamplingX.setText(String.valueOf(paramMap.get("String_Node_Str")));
  subSamplingY.setText(String.valueOf(paramMap.get("String_Node_Str")));
  geoRegion=(Geometry)paramMap.get("String_Node_Str");
  if (geoRegion != null) {
    geoCoordRadio.setSelected(true);
    final Coordinate coord[]=geoRegion.getCoordinates();
    worldMapUI.setSelectionStart((float)coord[0].y,(float)coord[0].x);
    worldMapUI.setSelectionEnd((float)coord[2].y,(float)coord[2].x);
    pixelPanel.setVisible(false);
    geoPanel.setVisible(true);
    getGeoRegion();
  }
}
Program: 11564
Project: 11564
Buggy source:
private double computeMaxShift(final int txMax){
  return absShift + Math.round(txMax * fracShift);
}

Fixed version (ground truth):
private double computeMaxShift(final int txMax,final int ty0) throws Exception {
  if (useMapreadyShiftOnly) {
    return Math.round(txMax * fracShift);
  }
 else {
    return computeShift(txMax,ty0) + Math.round(txMax * fracShift);
  }
}
Program: 11566
Project: 11566
Buggy source:
public void getPixelPos(final GeoPos geo,final PixelPos pix){
  if (geo.lon < 0) {
    geo.lon+=360;
  }
  geocoding.getPixelPos(geo,pix);
}

Fixed version (ground truth):
public void getPixelPos(final GeoPos geo,final PixelPos pix){
  if (geocoding.isCrossingMeridianAt180() && geo.lon < 0) {
    geo.lon+=360;
  }
  geocoding.getPixelPos(geo,pix);
}
Program: 11568
Project: 11568
Buggy source:
@Override public GeoPos getGeoPos(PixelPos pixelPos){
  float pixelLat=(float)((RASTER_HEIGHT - pixelPos.y) / DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 90.0);
  float pixelLon=(float)(pixelPos.x / DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 180.0);
  return new GeoPos(pixelLat,pixelLon);
}

Fixed version (ground truth):
@Override public GeoPos getGeoPos(PixelPos pixelPos){
  float pixelLat=(float)((RASTER_HEIGHT - pixelPos.y) * DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 90.0);
  float pixelLon=(float)(pixelPos.x * DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 180.0);
  return new GeoPos(pixelLat,pixelLon);
}
Program: 11569
Project: 11569
Buggy source:
public final synchronized float getElevation(final GeoPos geoPos) throws Exception {
  final double pixelY=getIndexY(geoPos);
  if (pixelY < 0) {
    return NO_DATA_VALUE;
  }
  resampling.computeIndex(getIndexX(geoPos),pixelY,RASTER_WIDTH,RASTER_HEIGHT,resamplingIndex);
  final float elevation=resampling.resample(resamplingRaster,resamplingIndex);
  return Float.isNaN(elevation) ? NO_DATA_VALUE : elevation;
}

Fixed version (ground truth):
public final synchronized float getElevation(final GeoPos geoPos) throws Exception {
  if (geoPos.lon > 180) {
    geoPos.lon-=360;
  }
  final double pixelY=getIndexY(geoPos);
  if (pixelY < 0) {
    return NO_DATA_VALUE;
  }
  resampling.computeIndex(getIndexX(geoPos),pixelY,RASTER_WIDTH,RASTER_HEIGHT,resamplingIndex);
  final float elevation=resampling.resample(resamplingRaster,resamplingIndex);
  return Float.isNaN(elevation) ? NO_DATA_VALUE : elevation;
}
Program: 11570
Project: 11570
Buggy source:
/** 
 * Get an array of rectangles for all source tiles of the image
 * @param sourceProduct the input
 * @param tileSize the rect
 * @param margin feathered area
 * @return Array of rectangles
 */
public static Rectangle[] getAllTileRectangles(final Product sourceProduct,final Dimension tileSize,final int margin){
  final int rasterHeight=sourceProduct.getSceneRasterHeight() - margin - margin;
  final int rasterWidth=sourceProduct.getSceneRasterWidth() - margin - margin;
  final Rectangle boundary=new Rectangle(rasterWidth,rasterHeight);
  final int tileCountX=MathUtils.ceilInt(boundary.width / (double)tileSize.width);
  final int tileCountY=MathUtils.ceilInt(boundary.height / (double)tileSize.height);
  final Rectangle[] rectangles=new Rectangle[tileCountX * tileCountY];
  int index=0;
  for (int tileY=0; tileY < tileCountY; tileY++) {
    for (int tileX=0; tileX < tileCountX; tileX++) {
      final Rectangle tileRectangle=new Rectangle(tileX * tileSize.width + margin,tileY * tileSize.height + margin,tileSize.width,tileSize.height);
      final Rectangle intersection=boundary.intersection(tileRectangle);
      rectangles[index]=intersection;
      index++;
    }
  }
  return rectangles;
}

Fixed version (ground truth):
/** 
 * Get an array of rectangles for all source tiles of the image
 * @param sourceProduct the input
 * @param tileSize the rect
 * @param margin feathered area
 * @return Array of rectangles
 */
public static Rectangle[] getAllTileRectangles(final Product sourceProduct,final Dimension tileSize,final int margin){
  final int rasterHeight=sourceProduct.getSceneRasterHeight() - margin - margin;
  final int rasterWidth=sourceProduct.getSceneRasterWidth() - margin - margin;
  final Rectangle boundary=new Rectangle(margin,margin,rasterWidth,rasterHeight);
  final int tileCountX=MathUtils.ceilInt(boundary.width / (double)tileSize.width);
  final int tileCountY=MathUtils.ceilInt(boundary.height / (double)tileSize.height);
  final Rectangle[] rectangles=new Rectangle[tileCountX * tileCountY];
  int index=0;
  for (int tileY=0; tileY < tileCountY; tileY++) {
    for (int tileX=0; tileX < tileCountX; tileX++) {
      final Rectangle tileRectangle=new Rectangle(tileX * tileSize.width + margin,tileY * tileSize.height + margin,tileSize.width,tileSize.height);
      final Rectangle intersection=boundary.intersection(tileRectangle);
      rectangles[index]=intersection;
      index++;
    }
  }
  return rectangles;
}
Program: 11571
Project: 11571
Buggy source:
@Override public GeoPos getGeoPos(final PixelPos pixelPos){
  final float pixelLat=(float)((RASTER_HEIGHT - pixelPos.y) / DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 90.0);
  final float pixelLon=(float)(pixelPos.x / DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 180.0);
  return new GeoPos(pixelLat,pixelLon);
}

Fixed version (ground truth):
@Override public GeoPos getGeoPos(final PixelPos pixelPos){
  final float pixelLat=(float)(90.0 - pixelPos.y * DEGREE_RES_BY_NUM_PIXELS_PER_TILE);
  final float pixelLon=(float)(pixelPos.x * DEGREE_RES_BY_NUM_PIXELS_PER_TILE - 180.0);
  return new GeoPos(pixelLat,pixelLon);
}
Program: 11572
Project: 11572
Buggy source:
@Override public double getIndexY(final GeoPos geoPos){
  return RASTER_HEIGHT - (geoPos.lat + 90.0) / DEGREE_RES_BY_NUM_PIXELS_PER_TILE;
}

Fixed version (ground truth):
@Override public double getIndexY(final GeoPos geoPos){
  return RASTER_HEIGHT - (geoPos.lat + 90.0) * DEGREE_RES_BY_NUM_PIXELS_PER_TILEinv;
}
Program: 11573
Project: 11573
Buggy source:
@Override public double getIndexX(final GeoPos geoPos){
  return (geoPos.lon + 180.0) / DEGREE_RES_BY_NUM_PIXELS_PER_TILE;
}

Fixed version (ground truth):
@Override public double getIndexX(final GeoPos geoPos){
  return (geoPos.lon + 180.0) * DEGREE_RES_BY_NUM_PIXELS_PER_TILEinv;
}
Program: 11574
Project: 11574
Buggy source:
/** 
 * Update the metadata in the target product.
 */
private void updateTargetProductMetadata(){
  final MetadataElement abs=AbstractMetadata.getAbstractedMetadata(targetProduct);
  abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true);
  final MetadataElement origProdRoot=AbstractMetadata.getOriginalProductMetadata(sourceProduct);
  origProdRoot.removeElement(origProdRoot.getElement(lutsigma));
  origProdRoot.removeElement(origProdRoot.getElement(lutgamma));
  origProdRoot.removeElement(origProdRoot.getElement(lutbeta));
}

Fixed version (ground truth):
/** 
 * Update the metadata in the target product.
 */
private void updateTargetProductMetadata(){
  final MetadataElement abs=AbstractMetadata.getAbstractedMetadata(targetProduct);
  abs.getAttribute(AbstractMetadata.abs_calibration_flag).getData().setElemBoolean(true);
  final MetadataElement origProdRoot=AbstractMetadata.getOriginalProductMetadata(targetProduct);
  origProdRoot.removeElement(origProdRoot.getElement(lutsigma));
  origProdRoot.removeElement(origProdRoot.getElement(lutgamma));
  origProdRoot.removeElement(origProdRoot.getElement(lutbeta));
}
Program: 11575
Project: 11575
Buggy source:
/** 
 * Get antenna pattern gain array from metadata.
 */
private void getLUT(){
  final MetadataElement origProdRoot=AbstractMetadata.getOriginalProductMetadata(sourceProduct);
  final MetadataElement lutSigmaElem=origProdRoot.getElement(lutsigma);
  if (lutSigmaElem != null) {
    offset=lutSigmaElem.getAttributeDouble("String_Node_Str",0);
    final MetadataAttribute gainsAttrib=lutSigmaElem.getAttribute("String_Node_Str");
    if (gainsAttrib != null) {
      gains=(double[])gainsAttrib.getData().getElems();
    }
  }
 else {
    throw new OperatorException(lutsigma + "String_Node_Str" + lutsigma+ "String_Node_Str");
  }
  if (gains.length < targetProduct.getSceneRasterWidth()) {
    throw new OperatorException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Get antenna pattern gain array from metadata.
 */
private void getLUT(){
  final MetadataElement origProdRoot=AbstractMetadata.getOriginalProductMetadata(sourceProduct);
  final MetadataElement lutSigmaElem=origProdRoot.getElement(lutsigma);
  if (lutSigmaElem != null) {
    offset=lutSigmaElem.getAttributeDouble("String_Node_Str",0);
    final MetadataAttribute gainsAttrib=lutSigmaElem.getAttribute("String_Node_Str");
    if (gainsAttrib != null) {
      gains=(double[])gainsAttrib.getData().getElems();
    }
  }
 else {
    throw new OperatorException(lutsigma + "String_Node_Str" + lutsigma+ "String_Node_Str");
  }
  if (gains.length < sourceProduct.getSceneRasterWidth()) {
    throw new OperatorException("String_Node_Str");
  }
}
Program: 11577
Project: 11577
Buggy source:
/** 
 * Reads a data product and returns a in-memory representation of it. This method was called by <code>readProductNodes(input, subsetInfo)</code> of the abstract superclass.
 * @throws IllegalArgumentException if <code>input</code> type is not one of the supported input sources.
 * @throws IOException              if an I/O error occurs
 */
@Override protected Product readProductNodesImpl() throws IOException {
  if (getInput() instanceof Product) {
    sourceProduct=(Product)getInput();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + getInput());
  }
  Debug.assertNotNull(sourceProduct);
  sceneRasterWidth=sourceProduct.getSceneRasterWidth();
  sceneRasterHeight=sourceProduct.getSceneRasterHeight();
  if (getSubsetDef() != null) {
    Dimension s=getSubsetDef().getSceneRasterSize(sceneRasterWidth,sceneRasterHeight);
    sceneRasterWidth=s.width;
    sceneRasterHeight=s.height;
  }
  final Product targetProduct=createProduct();
  updateMetadata(targetProduct,getSubsetDef());
  return targetProduct;
}

Fixed version (ground truth):
/** 
 * Reads a data product and returns a in-memory representation of it. This method was called by <code>readProductNodes(input, subsetInfo)</code> of the abstract superclass.
 * @throws IllegalArgumentException if <code>input</code> type is not one of the supported input sources.
 * @throws IOException              if an I/O error occurs
 */
@Override protected Product readProductNodesImpl() throws IOException {
  if (getInput() instanceof Product) {
    sourceProduct=(Product)getInput();
  }
 else {
    throw new IllegalArgumentException("String_Node_Str" + getInput());
  }
  Debug.assertNotNull(sourceProduct);
  sceneRasterWidth=sourceProduct.getSceneRasterWidth();
  sceneRasterHeight=sourceProduct.getSceneRasterHeight();
  if (getSubsetDef() != null) {
    Dimension s=getSubsetDef().getSceneRasterSize(sceneRasterWidth,sceneRasterHeight);
    sceneRasterWidth=s.width;
    sceneRasterHeight=s.height;
  }
  final Product targetProduct=createProduct();
  updateMetadata(sourceProduct,targetProduct,getSubsetDef());
  return targetProduct;
}
Program: 11581
Project: 11581
Buggy source:
@Parameters(name="String_Node_Str") public static Iterable<Object[]> data(){
  return new CommonsArrayList<>(new Object[]{true},new Object[]{false});
}

Fixed version (ground truth):
@Parameters(name="String_Node_Str") public static Iterable<Object[]> data(){
  return new CommonsArrayList<>(new Object[]{Boolean.TRUE},new Object[]{Boolean.FALSE});
}
Program: 11582
Project: 11582
Buggy source:
@Parameters(name="String_Node_Str") public static Iterable<Object[]> data(){
  return new CommonsArrayList<>(new Object[]{true},new Object[]{false});
}

Fixed version (ground truth):
@Parameters(name="String_Node_Str") public static Iterable<Object[]> data(){
  return new CommonsArrayList<>(new Object[]{Boolean.TRUE},new Object[]{Boolean.FALSE});
}
Program: 11584
Project: 11584
Buggy source:
/** 
 * In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&amp;W?" may be written as "B\&amp;W\?" or "B\26 W\3F".
 * @param aPattern pattern to check
 * @return The input string
 */
@Nonnull public static String validateIdentifier(@Nonnull final StringBuilder aPattern){
  final int nLength=aPattern.length();
  final char c1=aPattern.charAt(0);
  final char c2=nLength <= 1 ? 0 : aPattern.charAt(1);
  if (c1 == '-' || c1 == '$' || c1 == '*') {
    if (nLength > 1 && Character.isDigit(c2))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
 else {
    if (Character.isDigit(c1))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
  if (nLength > 1 && c1 == '-' && c2 == '-')   throw new IllegalArgumentException("String_Node_Str" + aPattern);
  return aPattern.toString();
}

Fixed version (ground truth):
/** 
 * In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&amp;W?" may be written as "B\&amp;W\?" or "B\26 W\3F".<br> CSS Variables on the other hand allow for double dashes: https://www.w3.org/TR/css-variables-1/#defining-variables
 * @param aPattern pattern to check
 * @return The input string
 */
@Nonnull public static String validateIdentifier(@Nonnull final StringBuilder aPattern){
  final int nLength=aPattern.length();
  final char c1=aPattern.charAt(0);
  final char c2=nLength <= 1 ? 0 : aPattern.charAt(1);
  if (c1 == '-' || c1 == '$' || c1 == '*') {
    if (nLength > 1 && Character.isDigit(c2))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
 else {
    if (Character.isDigit(c1))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
  if (false)   if (nLength > 1 && c1 == '-' && c2 == '-')   throw new IllegalArgumentException("String_Node_Str" + aPattern);
  return aPattern.toString();
}
Program: 11587
Project: 11587
Buggy source:
public CSSShortHandDescriptor(@Nonnull final ECSSProperty eProperty,@Nonnull @Nonempty final CSSPropertyWithDefaultValue... aSubProperties){
  ValueEnforcer.notNull(eProperty,"String_Node_Str");
  ValueEnforcer.notEmptyNoNullValue(aSubProperties,"String_Node_Str");
  m_eProperty=eProperty;
  m_aSubProperties=CollectionHelper.newList(aSubProperties);
  int nMinArgs=0;
  int nMaxArgs=0;
  final int nMax=aSubProperties.length;
  for (int i=0; i < nMax; ++i) {
    final CSSPropertyWithDefaultValue aSubProperty=aSubProperties[i];
    final ICSSProperty aProp=aSubProperty.getProperty();
    if (aProp instanceof CSSPropertyFree && i < nMax - 1)     throw new IllegalArgumentException("String_Node_Str" + aSubProperty + "String_Node_Str");
    nMinArgs+=aProp.getMinimumArgumentCount();
    nMaxArgs+=aProp.getMaximumArgumentCount();
  }
  m_nMinArgCount=nMinArgs;
  m_nMaxArgCount=nMaxArgs;
}

Fixed version (ground truth):
public CSSShortHandDescriptor(@Nonnull final ECSSProperty eProperty,@Nonnull @Nonempty final CSSPropertyWithDefaultValue... aSubProperties){
  ValueEnforcer.notNull(eProperty,"String_Node_Str");
  ValueEnforcer.notEmptyNoNullValue(aSubProperties,"String_Node_Str");
  m_eProperty=eProperty;
  m_aSubProperties=CollectionHelper.newList(aSubProperties);
  final int nMax=aSubProperties.length;
  for (int i=0; i < nMax; ++i) {
    final CSSPropertyWithDefaultValue aSubProperty=aSubProperties[i];
    final ICSSProperty aProp=aSubProperty.getProperty();
    if (aProp instanceof CSSPropertyFree && i < nMax - 1)     throw new IllegalArgumentException("String_Node_Str" + aSubProperty + "String_Node_Str");
  }
}
Program: 11589
Project: 11589
Buggy source:
public void onException(@Nonnull final com.helger.css.parser.ParseException ex){
  s_aLogger.error("String_Node_Str" + LoggingCSSParseErrorHandler.createLoggingStringParseError(ex));
}

Fixed version (ground truth):
public void onException(@Nonnull final ParseException ex){
  s_aLogger.error("String_Node_Str" + LoggingCSSParseErrorHandler.createLoggingStringParseError(ex));
}
Program: 11590
Project: 11590
Buggy source:
/** 
 * Method to adjust line and column numbers for the start of a token.
 * @param newLine line index
 * @param newCol column index
 */
public void adjustBeginLineColumn(int newLine,final int newCol){
  int start=m_nTokenBegin;
  int len;
  if (m_nBufpos >= m_nTokenBegin) {
    len=m_nBufpos - m_nTokenBegin + m_nInBuf + 1;
  }
 else {
    len=m_nBufsize - m_nTokenBegin + m_nBufpos + 1 + m_nInBuf;
  }
  int i=0, j=0, k=0;
  int nextColDiff=0, columnDiff=0;
  while (i < len && m_aBufLine[j=start % m_nBufsize] == m_aBufLine[k=++start % m_nBufsize]) {
    m_aBufLine[j]=newLine;
    nextColDiff=columnDiff + m_aBufColumn[k] - m_aBufColumn[j];
    m_aBufColumn[j]=newCol + columnDiff;
    columnDiff=nextColDiff;
    i++;
  }
  if (i < len) {
    m_aBufLine[j]=newLine++;
    m_aBufColumn[j]=newCol + columnDiff;
    while (i++ < len) {
      if (m_aBufLine[j=start % m_nBufsize] != m_aBufLine[++start % m_nBufsize])       m_aBufLine[j]=newLine++;
 else       m_aBufLine[j]=newLine;
    }
  }
  m_nLine=m_aBufLine[j];
  m_nColumn=m_aBufColumn[j];
}

Fixed version (ground truth):
/** 
 * Method to adjust line and column numbers for the start of a token.
 * @param nNewLine line index
 * @param newCol column index
 */
public void adjustBeginLineColumn(final int nNewLine,final int newCol){
  int start=m_nTokenBegin;
  int newLine=nNewLine;
  int len;
  if (m_nBufpos >= m_nTokenBegin) {
    len=m_nBufpos - m_nTokenBegin + m_nInBuf + 1;
  }
 else {
    len=m_nBufsize - m_nTokenBegin + m_nBufpos + 1 + m_nInBuf;
  }
  int i=0;
  int j=0;
  int k=0;
  int nextColDiff=0;
  int columnDiff=0;
  while (i < len && m_aBufLine[j=start % m_nBufsize] == m_aBufLine[k=++start % m_nBufsize]) {
    m_aBufLine[j]=newLine;
    nextColDiff=columnDiff + m_aBufColumn[k] - m_aBufColumn[j];
    m_aBufColumn[j]=newCol + columnDiff;
    columnDiff=nextColDiff;
    i++;
  }
  if (i < len) {
    m_aBufLine[j]=newLine++;
    m_aBufColumn[j]=newCol + columnDiff;
    while (i++ < len) {
      if (m_aBufLine[j=start % m_nBufsize] != m_aBufLine[++start % m_nBufsize])       m_aBufLine[j]=newLine++;
 else       m_aBufLine[j]=newLine;
    }
  }
  m_nLine=m_aBufLine[j];
  m_nColumn=m_aBufColumn[j];
}
Program: 11591
Project: 11591
Buggy source:
public CSSParseError(@Nonnull final Token aLastValidToken,@Nonnull final int[][] aExpectedTokenSequencesVal,@Nonnull final String[] aTokenImageVal,@Nullable final Token aLastSkippedToken){
  ValueEnforcer.notNull(aLastValidToken,"String_Node_Str");
  ValueEnforcer.notNull(aExpectedTokenSequencesVal,"String_Node_Str");
  ValueEnforcer.notNull(aTokenImageVal,"String_Node_Str");
  m_aLastValidToken=new ReadOnlyToken(aLastValidToken);
  final StringBuilder aExpected=new StringBuilder();
  for (  final int[] aExpectedTokens : aExpectedTokenSequencesVal) {
    if (aExpected.length() > 0)     aExpected.append("String_Node_Str");
    for (    final int nExpectedToken : aExpectedTokens)     aExpected.append(' ').append(aTokenImageVal[nExpectedToken]);
  }
  m_sExpectedTokens=aExpected.toString();
  m_aFirstSkippedToken=new ReadOnlyToken(aLastValidToken.next);
  m_aLastSkippedToken=aLastSkippedToken == null ? null : new ReadOnlyToken(aLastSkippedToken);
  m_sErrorMessage=LoggingCSSParseErrorHandler.createLoggingStringParseError(aLastValidToken,aExpectedTokenSequencesVal,aTokenImageVal,aLastSkippedToken);
}

Fixed version (ground truth):
public CSSParseError(@Nonnull final Token aLastValidToken,@Nonnull final int[][] aExpectedTokenSequencesVal,@Nonnull final String[] aTokenImageVal,@Nullable final Token aLastSkippedToken){
  ValueEnforcer.notNull(aLastValidToken,"String_Node_Str");
  ValueEnforcer.notNull(aExpectedTokenSequencesVal,"String_Node_Str");
  ValueEnforcer.notNull(aTokenImageVal,"String_Node_Str");
  m_aLastValidToken=new ReadOnlyToken(aLastValidToken);
  final StringBuilder aExpected=new StringBuilder();
  for (  final int[] aExpectedTokens : aExpectedTokenSequencesVal) {
    if (aExpected.length() > 0)     aExpected.append(',');
    for (    final int nExpectedToken : aExpectedTokens)     aExpected.append(' ').append(aTokenImageVal[nExpectedToken]);
  }
  m_sExpectedTokens=aExpected.toString();
  m_aFirstSkippedToken=new ReadOnlyToken(aLastValidToken.next);
  m_aLastSkippedToken=aLastSkippedToken == null ? null : new ReadOnlyToken(aLastSkippedToken);
  m_sErrorMessage=LoggingCSSParseErrorHandler.createLoggingStringParseError(aLastValidToken,aExpectedTokenSequencesVal,aTokenImageVal,aLastSkippedToken);
}
Program: 11593
Project: 11593
Buggy source:
/** 
 * In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".
 * @param aPattern pattern to check
 * @return The input string
 */
@Nonnull public static String validateIdentifier(@Nonnull final StringBuilder aPattern){
  final int nLength=aPattern.length();
  final char c1=aPattern.charAt(0);
  final char c2=nLength <= 1 ? 0 : aPattern.charAt(1);
  if (c1 == '-' || c1 == '$' || c1 == '*') {
    if (nLength > 1 && Character.isDigit(c2))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
 else {
    if (Character.isDigit(c1))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
  if (nLength > 1 && c1 == '-' && c2 == '-')   throw new IllegalArgumentException("String_Node_Str" + aPattern);
  return aPattern.toString();
}

Fixed version (ground truth):
/** 
 * In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit. Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item). For instance, the identifier "B&amp;W?" may be written as "B\&amp;W\?" or "B\26 W\3F".
 * @param aPattern pattern to check
 * @return The input string
 */
@Nonnull public static String validateIdentifier(@Nonnull final StringBuilder aPattern){
  final int nLength=aPattern.length();
  final char c1=aPattern.charAt(0);
  final char c2=nLength <= 1 ? 0 : aPattern.charAt(1);
  if (c1 == '-' || c1 == '$' || c1 == '*') {
    if (nLength > 1 && Character.isDigit(c2))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
 else {
    if (Character.isDigit(c1))     throw new IllegalArgumentException("String_Node_Str" + aPattern);
  }
  if (nLength > 1 && c1 == '-' && c2 == '-')   throw new IllegalArgumentException("String_Node_Str" + aPattern);
  return aPattern.toString();
}
Program: 11594
Project: 11594
Buggy source:
@Test public void testGetMatchingUnitExclPercentage(){
  for (  final ECSSUnit eUnit : ECSSUnit.values())   if (eUnit != ECSSUnit.PERCENTAGE) {
    String sText=eUnit.format(5);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitExclPercentage(sText));
    sText=eUnit.format(3.14159265);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitExclPercentage(sText));
  }
}

Fixed version (ground truth):
@Test public void testGetMatchingUnitExclPercentage(){
  for (  final ECSSUnit eUnit : ECSSUnit.values())   if (eUnit != ECSSUnit.PERCENTAGE) {
    String sText=eUnit.format(5);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitExclPercentage(sText));
    sText=eUnit.format(2.12345678);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitExclPercentage(sText));
  }
}
Program: 11595
Project: 11595
Buggy source:
@Test public void testGetMatchingUnitInclPercentage(){
  for (  final ECSSUnit eUnit : ECSSUnit.values()) {
    String sText=eUnit.format(5);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitInclPercentage(sText));
    sText=eUnit.format(3.14159265);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitInclPercentage(sText));
  }
}

Fixed version (ground truth):
@Test public void testGetMatchingUnitInclPercentage(){
  for (  final ECSSUnit eUnit : ECSSUnit.values()) {
    String sText=eUnit.format(5);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitInclPercentage(sText));
    sText=eUnit.format(2.12345678);
    assertSame(sText,eUnit,CSSNumberHelper.getMatchingUnitInclPercentage(sText));
  }
}
Program: 11596
Project: 11596
Buggy source:
/** 
 * Replace the URI string in the existing   {@link CSSURI} object.
 * @param sURIString The new URI string to set. May neither be <code>null</code> nor empty.
 * @return this
 */
@Nonnull public CSSExpressionMemberTermURI setURIString(@Nonnull @Nonempty final String sURIString){
  m_aURI.setURI(sURIString);
  return this;
}

Fixed version (ground truth):
/** 
 * Replace the URI string in the existing   {@link CSSURI} object.
 * @param sURIString The new URI string to set. May not be <code>null</code> but may be empty.
 * @return this
 */
@Nonnull public CSSExpressionMemberTermURI setURIString(@Nonnull final String sURIString){
  m_aURI.setURI(sURIString);
  return this;
}
Program: 11597
Project: 11597
Buggy source:
/** 
 * Set the URI of the file to be imported.
 * @param sLocationURI The location URI to use. May not be <code>null</code>.
 * @return this;
 */
@Nonnull public CSSImportRule setLocationString(@Nonnull @Nonempty final String sLocationURI){
  m_aLocation.setURI(sLocationURI);
  return this;
}

Fixed version (ground truth):
/** 
 * Set the URI of the file to be imported.
 * @param sLocationURI The location URI to use. May not be <code>null</code>.
 * @return this;
 */
@Nonnull public CSSImportRule setLocationString(@Nonnull final String sLocationURI){
  m_aLocation.setURI(sLocationURI);
  return this;
}
Program: 11598
Project: 11598
Buggy source:
public CSSURI(@Nonnull @Nonempty final String sURI){
  setURI(sURI);
}

Fixed version (ground truth):
public CSSURI(@Nonnull final String sURI){
  setURI(sURI);
}
Program: 11599
Project: 11599
Buggy source:
/** 
 * Set the URI string of this object. This may either be a regular URI or a data URL string (starting with "data:"). The passed string may not start with the prefix "url(" and end with ")".
 * @param sURI The URI to be set. May neither be <code>null</code> nor empty.
 * @return this
 */
@Nonnull public CSSURI setURI(@Nonnull @Nonempty final String sURI){
  ValueEnforcer.notEmpty(sURI,"String_Node_Str");
  if (CSSURLHelper.isURLValue(sURI))   throw new IllegalArgumentException("String_Node_Str");
  m_sURI=sURI;
  return this;
}

Fixed version (ground truth):
/** 
 * Set the URI string of this object. This may either be a regular URI or a data URL string (starting with "data:"). The passed string may not start with the prefix "url(" and end with ")".
 * @param sURI The URI to be set. May not be <code>null</code> but may be empty (even though an empty URL usually does not make sense).
 * @return this
 */
@Nonnull public CSSURI setURI(@Nonnull final String sURI){
  ValueEnforcer.notNull(sURI,"String_Node_Str");
  if (CSSURLHelper.isURLValue(sURI))   throw new IllegalArgumentException("String_Node_Str");
  m_sURI=sURI;
  return this;
}
Program: 11600
Project: 11600
Buggy source:
/** 
 * @return The URI string (without the leading "url(" and the closing ")")
 */
@Nonnull @Nonempty public String getURI(){
  return m_sURI;
}

Fixed version (ground truth):
/** 
 * @return The URI string (without the leading "url(" and the closing ")")
 */
@Nonnull public String getURI(){
  return m_sURI;
}
Program: 11601
Project: 11601
Buggy source:
/** 
 * Surround the passed URL with the CSS "url(...)". When the passed URL contains characters that require quoting, quotes are automatically added!
 * @param sURL URL to be wrapped. May neither be <code>null</code> nor empty.
 * @param bForceQuoteURL if <code>true</code> single quotes are added around the URL
 * @return <code>url(<i>sURL</i>)</code> or <code>url('<i>sURL</i>')</code>
 */
@Nonnull @Nonempty public static String getAsCSSURL(@Nonnull @Nonempty final String sURL,final boolean bForceQuoteURL){
  ValueEnforcer.notEmpty(sURL,"String_Node_Str");
  final StringBuilder aSB=new StringBuilder(CCSSValue.PREFIX_URL_OPEN);
  final boolean bAreQuotesRequired=bForceQuoteURL || isCSSURLRequiringQuotes(sURL);
  if (bAreQuotesRequired) {
    final int nIndexSingleQuote=sURL.indexOf('\'');
    final int nIndexDoubleQuote=sURL.indexOf('"');
    final char cQuote=nIndexSingleQuote >= 0 && nIndexDoubleQuote < 0 ? '"' : '\'';
    aSB.append(cQuote).append(getEscapedCSSURL(sURL,cQuote)).append(cQuote);
  }
 else {
    aSB.append(sURL);
  }
  return aSB.append(CCSSValue.SUFFIX_URL_CLOSE).toString();
}

Fixed version (ground truth):
/** 
 * Surround the passed URL with the CSS "url(...)". When the passed URL contains characters that require quoting, quotes are automatically added!
 * @param sURL URL to be wrapped. May not be <code>null</code> but maybe empty.
 * @param bForceQuoteURL if <code>true</code> single quotes are added around the URL
 * @return <code>url(<i>sURL</i>)</code> or <code>url('<i>sURL</i>')</code>
 */
@Nonnull @Nonempty public static String getAsCSSURL(@Nonnull final String sURL,final boolean bForceQuoteURL){
  ValueEnforcer.notNull(sURL,"String_Node_Str");
  final StringBuilder aSB=new StringBuilder(CCSSValue.PREFIX_URL_OPEN);
  final boolean bAreQuotesRequired=bForceQuoteURL || isCSSURLRequiringQuotes(sURL);
  if (bAreQuotesRequired) {
    final int nIndexSingleQuote=sURL.indexOf('\'');
    final int nIndexDoubleQuote=sURL.indexOf('"');
    final char cQuote=nIndexSingleQuote >= 0 && nIndexDoubleQuote < 0 ? '"' : '\'';
    aSB.append(cQuote).append(getEscapedCSSURL(sURL,cQuote)).append(cQuote);
  }
 else {
    aSB.append(sURL);
  }
  return aSB.append(CCSSValue.SUFFIX_URL_CLOSE).toString();
}
Program: 11603
Project: 11603
Buggy source:
@Override public int getCount(){
  return 7;
}

Fixed version (ground truth):
@Override public int getCount(){
  return 6;
}
Program: 11604
Project: 11604
Buggy source:
@Override public void onNavigationDrawerItemSelected(int position){
switch (position) {
case 0:
    getSupportFragmentManager().beginTransaction().replace(R.id.container,new MainFragment()).commit();
  break;
case 1:
if (PlayerController.isLoggedIn(this)) {
  getSupportFragmentManager().beginTransaction().replace(R.id.container,ProfileFragment.newInstance(PlayerController.getName())).commit();
}
 else {
  showInputDialog(ShotsFragment.MY_SHOTS);
}
break;
case 2:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.MY_SHOTS)).commit();
}
 else {
showInputDialog(ShotsFragment.MY_SHOTS);
}
break;
case 3:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.FOLLOWING)).commit();
}
 else {
showInputDialog(ShotsFragment.FOLLOWING);
}
break;
case 4:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.LIKES)).commit();
}
 else {
showInputDialog(ShotsFragment.LIKES);
}
break;
case 5:
break;
case 6:
break;
}
}

Fixed version (ground truth):
@Override public void onNavigationDrawerItemSelected(int position){
switch (position) {
case 0:
    getSupportFragmentManager().beginTransaction().replace(R.id.container,new MainFragment()).commit();
  break;
case 1:
if (PlayerController.isLoggedIn(this)) {
  getSupportFragmentManager().beginTransaction().replace(R.id.container,ProfileFragment.newInstance(PlayerController.getName())).commit();
}
 else {
  showInputDialog(-1);
}
break;
case 2:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.MY_SHOTS)).commit();
}
 else {
showInputDialog(ShotsFragment.MY_SHOTS);
}
break;
case 3:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.FOLLOWING)).commit();
}
 else {
showInputDialog(ShotsFragment.FOLLOWING);
}
break;
case 4:
if (PlayerController.isLoggedIn(this)) {
getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(ShotsFragment.LIKES)).commit();
}
 else {
showInputDialog(ShotsFragment.LIKES);
}
break;
case 5:
break;
case 6:
break;
}
}
Program: 11605
Project: 11605
Buggy source:
@Override public void onConfirm(String username,int type){
  PlayerController.setName(MainActivity.this,username);
  getSupportFragmentManager().beginTransaction().replace(R.id.container,ShotsFragment.newInstance(type)).commit();
}

Fixed version (ground truth):
@Override public void onConfirm(String username,int type){
  PlayerController.setName(MainActivity.this,username);
  Fragment fragment;
  if (type == -1) {
    fragment=ProfileFragment.newInstance(username);
  }
 else {
    fragment=ShotsFragment.newInstance(type);
  }
  getSupportFragmentManager().beginTransaction().replace(R.id.container,fragment).commit();
}
Program: 11607
Project: 11607
Buggy source:
/** 
 * Calculates the next ID number for a new window.
 * @return the next window ID
 */
private static int calculateNextId(){
  int t;
  do {
    t=ThreadLocalRandom.current().nextInt(256);
  }
 while (REGISTERED_WINDOWS.containsKey(t));
  return t;
}

Fixed version (ground truth):
/** 
 * Calculates the next ID number for a new window.
 * @return the next window ID
 */
private static int calculateNextId(){
  int t;
  do {
    t=ThreadLocalRandom.current().nextInt(255) + 1;
  }
 while (REGISTERED_WINDOWS.containsKey(t));
  return t;
}
Program: 11608
Project: 11608
Buggy source:
private PlayOutTabListItem(PlayOutTabListItem.PlayOutTabListItemActionType action){
  super(PlayOutTabListItem.class);
  this.action=action;
}

Fixed version (ground truth):
private PlayOutTabListItem(ActionType action){
  super(PlayOutTabListItem.class);
  this.action=action;
}
Program: 11609
Project: 11609
Buggy source:
public void update(UUID uuid,ChatComponent displayName){
  PlayOutTabListItem.PlayOutTabListItemUpdateDisplayName.PlayerData data=new PlayOutTabListItem.PlayOutTabListItemUpdateDisplayName.PlayerData(uuid,displayName);
  this.updates.add(data);
}

Fixed version (ground truth):
public void update(UUID uuid,ChatComponent displayName){
  UpdateDisplayName.PlayerData data=new UpdateDisplayName.PlayerData(uuid,displayName);
  this.updates.add(data);
}
Program: 11610
Project: 11610
Buggy source:
public static PlayOutTabListItemAddPlayer addPlayerPacket(){
  return new PlayOutTabListItemAddPlayer();
}

Fixed version (ground truth):
public static AddPlayer addPlayerPacket(){
  return new AddPlayer();
}
Program: 11611
Project: 11611
Buggy source:
public static PlayOutTabListItemUpdateDisplayName updatePlayerPacket(){
  return new PlayOutTabListItemUpdateDisplayName();
}

Fixed version (ground truth):
public static UpdateDisplayName updatePlayerPacket(){
  return new UpdateDisplayName();
}
Program: 11612
Project: 11612
Buggy source:
public static PlayOutTabListItemRemovePlayer removePlayerPacket(){
  return new PlayOutTabListItemRemovePlayer();
}

Fixed version (ground truth):
public static RemovePlayer removePlayerPacket(){
  return new RemovePlayer();
}
Program: 11613
Project: 11613
Buggy source:
public static PlayOutTabListItemUpdateGamemode updateGamemodePacket(){
  return new PlayOutTabListItemUpdateGamemode();
}

Fixed version (ground truth):
public static UpdateGameMode updateGamemodePacket(){
  return new UpdateGameMode();
}
Program: 11614
Project: 11614
Buggy source:
public static PlayOutTabListItemUpdateLatency updateLatencyPacket(){
  return new PlayOutTabListItemUpdateLatency();
}

Fixed version (ground truth):
public static UpdateLatency updateLatencyPacket(){
  return new UpdateLatency();
}
Program: 11615
Project: 11615
Buggy source:
@Override public void setDisplayName(ChatComponent displayName){
  if (displayName != null && displayName.getText() == null)   throw new IllegalArgumentException("String_Node_Str");
  this.displayName=displayName != null ? displayName : ChatComponent.text(this.name);
  this.featuredTabLists.forEach(TabList::update);
}

Fixed version (ground truth):
@Override public void setDisplayName(ChatComponent displayName){
  if (displayName != null && displayName.getText() == null)   throw new IllegalArgumentException("String_Node_Str");
  this.displayName=displayName != null ? displayName : ChatComponent.text(this.name);
synchronized (this.featuredTabLists) {
    this.featuredTabLists.forEach(TabList::update);
  }
}