nus-yam/ex-repair huggingface dataset:
Program: 153979
Project: 153979
Buggy source:
public void setDefaultValues(Condition condition){
  String className=condition.getConditionObject().getClass().getName();
  String selectedItem=className.substring(className.lastIndexOf("String_Node_Str") + 1) + "String_Node_Str" + condition.getFunctionName();
  jcbMethods.setSelectedItem(selectedItem);
  jtfExpectedValue.setText(condition.getExpectedValue());
  for (int i=0; i < paramFields.size(); i++) {
    JTextField jTextField=paramFields.get(i);
    jTextField.setText(condition.getParams().get(i));
  }
}

Fixed version (ground truth):
public void setDefaultValues(Condition condition){
  String className=condition.getConditionObject().getClass().getName();
  String selectedItem=className.substring(className.lastIndexOf("String_Node_Str") + 1) + "String_Node_Str" + condition.getFunctionName();
  jcbMethods.setSelectedItem(selectedItem);
  jtfExpectedValue.setText(condition.getExpectedValue());
  model.setExpected(jtfExpectedValue.getText());
  model.setParams(condition.getParams());
  for (int i=0; i < paramFields.size(); i++) {
    JTextField jTextField=paramFields.get(i);
    jTextField.setText(condition.getParams().get(i));
  }
}
Program: 153980
Project: 153980
Buggy source:
@Action public void initAnalyzerDomainsToAnalyze(){
  TreeMap<String,Integer> map=getCrawledDomains();
  List<String> hosts=new ArrayList<String>();
  hosts.add("String_Node_Str");
  for (  Map.Entry<String,Integer> en : map.entrySet()) {
    hosts.add(en.getKey());
  }
  jcbAnalyzerStep1DomainsToAnalyze.setModel(new DefaultComboBoxModel(hosts.toArray()));
  jcbAnalyzerStep1DomainsToAnalyze.revalidate();
  if (hosts.size() > 0) {
    displayFlashMessage("String_Node_Str",FlashMessageType.INFO);
  }
 else {
    displayFlashMessage("String_Node_Str",FlashMessageType.INFO);
  }
}

Fixed version (ground truth):
@Action public void initAnalyzerDomainsToAnalyze(){
  TreeMap<String,Integer> map=getCrawledDomains();
  List<String> hosts=new ArrayList<String>();
  hosts.add("String_Node_Str");
  for (  Map.Entry<String,Integer> en : map.entrySet()) {
    hosts.add(en.getKey());
  }
  jcbAnalyzerStep1DomainsToAnalyze.setModel(new DefaultComboBoxModel(hosts.toArray()));
  jcbAnalyzerStep1DomainsToAnalyze.revalidate();
  if (hosts.size() > 1) {
    displayFlashMessage("String_Node_Str",FlashMessageType.INFO);
  }
 else {
    displayFlashMessage("String_Node_Str",FlashMessageType.INFO);
  }
}
Program: 153982
Project: 153982
Buggy source:
/** 
 * Saves crawled content into db
 * @param query
 */
public void processResource(Query query){
  CrawlerConsole.print("String_Node_Str" + query.getOriginalURL().toString());
  byte[] bytes=query.getResource().getBytes();
  String html=new String(bytes);
  String host=query.getHost();
  String hostUrl="String_Node_Str" + host;
  Document doc=Jsoup.parse(html,hostUrl);
  LinksExtractor extractor=new LinksExtractor(doc);
  Set<String> links=extractor.getInternalLinks(host);
  for (  String link : links) {
    pool.addURL(link);
  }
  if (!html.isEmpty()) {
    Page page=new Page(query.getOriginalURL(),host);
    HtmlContent htmlContent=new HtmlContent(html);
    page.addContent(htmlContent);
    DbConnector conn=new DbConnector();
    conn.getConnector().create(page);
  }
}

Fixed version (ground truth):
/** 
 * Saves crawled content into db
 * @param query
 */
public void processResource(Query query){
  CrawlerConsole.print("String_Node_Str" + query.getOriginalURL().toString());
  byte[] bytes=query.getResource().getBytes();
  String html=new String(bytes);
  String url=query.getOriginalURL().toString();
  String host=query.getHost();
  if (url.split("String_Node_Str").length < 4) {
    url=url + "String_Node_Str";
  }
  String baseUrl=url.substring(0,url.lastIndexOf('/') + 1);
  Document doc=Jsoup.parse(html,baseUrl);
  LinksExtractor extractor=new LinksExtractor(doc);
  Set<String> links=extractor.getInternalLinks(host);
  for (  String link : links) {
    pool.addURL(link);
  }
  if (!html.isEmpty()) {
    Page page=new Page(query.getOriginalURL(),host);
    HtmlContent htmlContent=new HtmlContent(html);
    page.addContent(htmlContent);
    DbConnector conn=new DbConnector();
    conn.getConnector().create(page);
  }
}
Program: 153983
Project: 153983
Buggy source:
private static Scene getSceneOne(JavaRayConfiguration configuration){
  Scene scene=new Scene(configuration);
  scene.add(new Sphere(new Vector3(4,3,-5),newMat(0,0,0,6,6,6,10,10,10),2.5));
  scene.add(new Sphere(new Vector3(2.75,4,-1),newMat(2,0,0,5,0,0,0,0,2),0.5));
  scene.add(new Sphere(new Vector3(5.25,4,-1),newMat(0,2,0,0,5,0,0,2,0),0.5));
  scene.add(new Light(new Vector3(4,3,10),5,1));
  return scene;
}

Fixed version (ground truth):
private static Scene getSceneOne(JavaRayConfiguration configuration){
  Scene scene=new Scene(configuration);
  scene.add(new Light(new Vector3(4,3,10),5,1));
  scene.add(new Sphere(new Vector3(4,3,-5),newMat(0,0,0,6,6,6,10,10,10),2.5));
  scene.add(new Sphere(new Vector3(2.75,4,-1),newMat(2,0,0,5,0,0,0,0,2),0.5));
  scene.add(new Sphere(new Vector3(5.25,4,-1),newMat(0,2,0,0,5,0,0,2,0),0.5));
  return scene;
}
Program: 153984
Project: 153984
Buggy source:
public static void main(String[] args){
  logger.info("String_Node_Str");
  ApplicationContext appContext=new ClassPathXmlApplicationContext("String_Node_Str");
  JavaRayConfiguration configuration=(JavaRayConfiguration)appContext.getBean("String_Node_Str");
  View view=new View(configuration);
  logger.debug("String_Node_Str",new Object[]{configuration.getViewWidth(),configuration.getViewHeight(),configuration.getAntiAlias()});
  Camera camera=new Camera(new Vector3(4,3,3));
  Scene scene=getSceneTwo(configuration);
  long t=new Date().getTime();
  try {
    new RayTracer(configuration).render(scene,view,camera);
  }
 catch (  Exception e) {
    logger.error("String_Node_Str",e);
  }
  logger.debug("String_Node_Str",((new Date().getTime() - t) / 1000));
}

Fixed version (ground truth):
public static void main(String[] args){
  logger.info("String_Node_Str");
  ApplicationContext appContext=new ClassPathXmlApplicationContext("String_Node_Str");
  JavaRayConfiguration configuration=(JavaRayConfiguration)appContext.getBean("String_Node_Str");
  View view=new View(configuration);
  logger.debug("String_Node_Str",new Object[]{configuration.getViewWidth(),configuration.getViewHeight(),configuration.getAntiAlias()});
  Camera camera=new Camera(new Vector3(4,3,3));
  Scene scene=getSceneThree(configuration);
  long t=new Date().getTime();
  new RayTracer(configuration).render(scene,view,camera);
  logger.debug("String_Node_Str",((new Date().getTime() - t) / 1000));
}
Program: 153985
Project: 153985
Buggy source:
public HitResult(double t,Vector3 hitPoint){
  this.t=t;
  this.hitPoint=hitPoint;
}

Fixed version (ground truth):
public HitResult(double t,Vector3 hitPoint){
  this.t=t;
  this.hitPoint=hitPoint != null ? new Vector3(hitPoint) : null;
}
Program: 153986
Project: 153986
Buggy source:
public Light(Vector3 position,double intensity,double radius){
  super(position,new Material(new ColorMagnitude(intensity,intensity,intensity)),radius);
}

Fixed version (ground truth):
public Light(Vector3 position,ColorMagnitude emissivity,double radius){
  super(position,new Material(emissivity),radius);
}
Program: 153987
Project: 153987
Buggy source:
public Vector3 getPosition(){
  return new Vector3(position);
}

Fixed version (ground truth):
public Vector3 getPosition(){
  return position;
}
Program: 153988
Project: 153988
Buggy source:
@Override public boolean equals(Object o){
  if (this == o)   return true;
  if (!(o instanceof PlaneGeometry))   return false;
  PlaneGeometry that=(PlaneGeometry)o;
  return !(planeNormal != null ? !planeNormal.equals(that.planeNormal) : that.planeNormal != null) && !(position != null ? !position.equals(that.position) : that.position != null);
}

Fixed version (ground truth):
@Override public boolean equals(Object o){
  if (this == o) {
    return true;
  }
  if (!(o instanceof PlaneGeometry)) {
    return false;
  }
  PlaneGeometry that=(PlaneGeometry)o;
  return !(planeNormal != null ? !planeNormal.equals(that.planeNormal) : that.planeNormal != null) && !(position != null ? !position.equals(that.position) : that.position != null);
}
Program: 153989
Project: 153989
Buggy source:
/** 
 * Constructs a <code>TiledImage</code> equivalent to a given <code>RenderedImage</code>.  Actual copying of the pixel data from the <code>RenderedImage</code> will be deferred until the first time they are requested from the <code>TiledImage</code>.  The tiles of the <code>TiledImage</code> may optionally share <code>DataBuffer</code>s with the tiles of the source image but it should be realized in this case that data written into the <code>TiledImage</code> will be visible in the source image.
 * @param source The source <code>RenderedImage</code>.
 * @param areBuffersShared Whether the tile <code>DataBuffer</code>sof the source are re-used in the tiles of this image.  If <code>false</code> new <code>WritableRaster</code>s will be created.
 * @since JAI 1.1
 */
public TiledImage(RenderedImage source,boolean areBuffersShared){
  this(source,source.getTileWidth(),source.getTileHeight());
  this.areBuffersShared=areBuffersShared;
}

Fixed version (ground truth):
/** 
 * Constructs a <code>TiledImage</code> equivalent to a given <code>RenderedImage</code>.  Actual copying of the pixel data from the <code>RenderedImage</code> will be deferred until the first time they are requested from the <code>TiledImage</code>.  The tiles of the <code>TiledImage</code> may optionally share <code>DataBuffer</code>s with the tiles of the source image but it should be realized in this case that data written into the <code>TiledImage</code> will be visible in the source image.
 * @param source The source <code>RenderedImage</code>.
 * @param areBuffersShared Whether the tile <code>DataBuffer</code>sof the source are re-used in the tiles of this image.  If <code>false</code> new <code>WritableRaster</code>s will be created.
 * @since JAI 1.1
 */
public TiledImage(RenderedImage source,boolean areBuffersShared){
  this(source,source.getTileWidth(),source.getTileHeight());
  RenderedImage sourceRendering=source instanceof RenderedOp ? ((RenderedOp)source).getRendering() : source;
  boolean suppressBufferSharing=sourceRendering instanceof OpImage && !((OpImage)sourceRendering).computesUniqueTiles();
  this.areBuffersShared=areBuffersShared && !suppressBufferSharing;
}
Program: 153991
Project: 153991
Buggy source:
/** 
 * Returns the image's bounds as a <code>Rectangle</code>. <p> The image's bounds are defined by the values returned by <code>getMinX()</code>, <code>getMinY()</code>, <code>getWidth()</code>, and <code>getHeight()</code>. A <code>Rectangle</code> is created based on these four methods and cached in this class.  Each time that this method is invoked, the bounds of this <code>Rectangle</code> are updated with the values returned by the four aforementioned accessors. <p> Because this method returns the <code>bounds</code> variable by reference, the caller should not change the settings of the <code>Rectangle</code>.  Otherwise, unexpected errors may occur. Likewise, if the caller expects this variable to be immutable it should clone the returned <code>Rectangle</code> if there is any possibility that it might be changed by the <code>PlanarImage</code>. This may generally occur only for instances of <code>RenderedOp</code>.
 */
public Rectangle getBounds(){
  if (bounds == null) {
synchronized (this) {
      bounds=new Rectangle(getMinX(),getMinY(),getWidth(),getHeight());
    }
  }
 else {
synchronized (bounds) {
      bounds.setBounds(getMinX(),getMinY(),getWidth(),getHeight());
    }
  }
  return bounds;
}

Fixed version (ground truth):
/** 
 * Returns the image's bounds as a <code>Rectangle</code>. <p> The image's bounds are defined by the values returned by <code>getMinX()</code>, <code>getMinY()</code>, <code>getWidth()</code>, and <code>getHeight()</code>. A <code>Rectangle</code> is created based on these four methods and cached in this class.  Each time that this method is invoked, the bounds of this <code>Rectangle</code> are updated with the values returned by the four aforementioned accessors. <p> Because this method returns the <code>bounds</code> variable by reference, the caller should not change the settings of the <code>Rectangle</code>.  Otherwise, unexpected errors may occur. Likewise, if the caller expects this variable to be immutable it should clone the returned <code>Rectangle</code> if there is any possibility that it might be changed by the <code>PlanarImage</code>. This may generally occur only for instances of <code>RenderedOp</code>.
 */
public Rectangle getBounds(){
synchronized (bounds) {
    bounds.setBounds(getMinX(),getMinY(),getWidth(),getHeight());
  }
  return bounds;
}
Program: 153995
Project: 153995
Buggy source:
private static void doTest(int equations,boolean print){
  for (int i=0; i < 6; i++) {
    c0[i]=myRandom.nextDouble() * 100.0F;
    c1[i]=myRandom.nextDouble() * 100.0F;
  }
  float[] destCoords=new float[2 * equations];
  for (int i=0; i < 2 * equations; i++) {
    destCoords[i]=myRandom.nextFloat() * 100.0F;
  }
  float[] sourceCoords=new float[2 * equations];
  for (int i=0; i < equations; i++) {
    sourceCoords[2 * i]=xpoly(destCoords[2 * i],destCoords[2 * i + 1]);
    sourceCoords[2 * i + 1]=ypoly(destCoords[2 * i],destCoords[2 * i + 1]);
  }
  float[] coeffs=getCoeffs(sourceCoords,0,destCoords,0,sourceCoords.length,0.5F,0.5F,2.0F,2.0F,2);
  if (print) {
    System.out.println("String_Node_Str" + equations + "String_Node_Str");
    for (int i=0; i < 6; i++) {
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ c0[i]+ "String_Node_Str"+ coeffs[i]+ "String_Node_Str"+ (c0[i] / coeffs[i])+ "String_Node_Str");
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ c1[i]+ "String_Node_Str"+ coeffs[i + 6]+ "String_Node_Str"+ (c1[i] / coeffs[i + 6])+ "String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private static void doTest(int equations,boolean print){
  for (int i=0; i < 6; i++) {
    c0[i]=myRandom.nextDouble() * 100.0F;
    c1[i]=myRandom.nextDouble() * 100.0F;
  }
  preScaleX=myRandom.nextDouble() + 2.0;
  preScaleY=myRandom.nextDouble() + 3.0;
  postScaleX=myRandom.nextDouble() + 4.0;
  postScaleY=myRandom.nextDouble() + 5.0;
  float[] destCoords=new float[2 * equations];
  for (int i=0; i < 2 * equations; i++) {
    destCoords[i]=myRandom.nextFloat() * 100.0F;
  }
  float[] sourceCoords=new float[2 * equations];
  for (int i=0; i < equations; i++) {
    sourceCoords[2 * i]=xpoly(destCoords[2 * i],destCoords[2 * i + 1]);
    sourceCoords[2 * i + 1]=ypoly(destCoords[2 * i],destCoords[2 * i + 1]);
  }
  float[] coeffs=getCoeffs(sourceCoords,0,destCoords,0,sourceCoords.length,(float)preScaleX,(float)preScaleY,(float)postScaleX,(float)postScaleY,2);
  if (print) {
    System.out.println("String_Node_Str" + equations + "String_Node_Str");
    for (int i=0; i < 6; i++) {
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ c0[i]+ "String_Node_Str"+ coeffs[i]+ "String_Node_Str"+ (c0[i] / coeffs[i])+ "String_Node_Str");
      System.out.println("String_Node_Str" + i + "String_Node_Str"+ c1[i]+ "String_Node_Str"+ coeffs[i + 6]+ "String_Node_Str"+ (c1[i] / coeffs[i + 6])+ "String_Node_Str");
    }
  }
}
Program: 153996
Project: 153996
Buggy source:
private static float ypoly(float x,float y){
  return (float)(c1[0] + c1[1] * x + c1[2] * y + c1[3] * x * x + c1[4] * x * y + c1[5] * y * y + (myRandom.nextDouble() * noise));
}

Fixed version (ground truth):
private static float ypoly(float x,float y){
  x*=(float)preScaleX;
  y*=(float)preScaleY;
  return (float)(postScaleY * (c1[0] + c1[1] * x + c1[2] * y + c1[3] * x * x + c1[4] * x * y + c1[5] * y * y + myRandom.nextDouble() * noise));
}
Program: 153997
Project: 153997
Buggy source:
private static float xpoly(float x,float y){
  return (float)(c0[0] + c0[1] * x + c0[2] * y + c0[3] * x * x + c0[4] * x * y + c0[5] * y * y + (myRandom.nextDouble() * noise));
}

Fixed version (ground truth):
private static float xpoly(float x,float y){
  x*=(float)preScaleX;
  y*=(float)preScaleY;
  return (float)(postScaleX * (c0[0] + c0[1] * x + c0[2] * y + c0[3] * x * x + c0[4] * x * y + c0[5] * y * y + myRandom.nextDouble() * noise));
}
Program: 153998
Project: 153998
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new BMPImage(input);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new BMPImage(input);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 153999
Project: 153999
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new FPXImage(input,(FPXDecodeParam)param);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new FPXImage(input,(FPXDecodeParam)param);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154000
Project: 154000
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new JPEGImage(input,param);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new JPEGImage(input,param);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154001
Project: 154001
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new PNGImage(input,(PNGDecodeParam)param);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new PNGImage(input,(PNGDecodeParam)param);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154002
Project: 154002
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new PNMImage(input);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if (page != 0) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new PNMImage(input);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154003
Project: 154003
Buggy source:
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if ((page < 0) || (page >= getNumPages())) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  return new TIFFImage(input,(TIFFDecodeParam)param,page);
}

Fixed version (ground truth):
public RenderedImage decodeAsRenderedImage(int page) throws IOException {
  if ((page < 0) || (page >= getNumPages())) {
    throw new IOException(JaiI18N.getString("String_Node_Str"));
  }
  try {
    return new TIFFImage(input,(TIFFDecodeParam)param,page);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154004
Project: 154004
Buggy source:
public int getNumPages() throws IOException {
  return TIFFDirectory.getNumDirectories(input);
}

Fixed version (ground truth):
public int getNumPages() throws IOException {
  try {
    return TIFFDirectory.getNumDirectories(input);
  }
 catch (  Exception e) {
    throw CodecUtils.toIOException(e);
  }
}
Program: 154005
Project: 154005
Buggy source:
private static ImageLayout layoutHelper(Vector sources,ImageLayout il){
  ImageLayout layout=(il == null) ? new ImageLayout() : (ImageLayout)il.clone();
  int numSources=sources.size();
  int destNumBands=totalNumBands(sources);
  int destDataType=DataBuffer.TYPE_BYTE;
  RenderedImage srci=(RenderedImage)sources.get(0);
  Rectangle destBounds=new Rectangle(srci.getMinX(),srci.getMinY(),srci.getWidth(),srci.getHeight());
  for (int i=0; i < numSources; i++) {
    srci=(RenderedImage)sources.get(i);
    destBounds=destBounds.intersection(new Rectangle(srci.getMinX(),srci.getMinY(),srci.getWidth(),srci.getHeight()));
    int typei=srci.getSampleModel().getTransferType();
    destDataType=typei > destDataType ? typei : destDataType;
  }
  SampleModel sm=layout.getSampleModel((RenderedImage)sources.get(0));
  if (sm.getNumBands() < destNumBands) {
    int[] destOffsets=new int[destNumBands];
    for (int i=0; i < destNumBands; i++) {
      destOffsets[i]=i;
    }
    sm=RasterFactory.createComponentSampleModel(sm,destDataType,destBounds.width,destBounds.height,destNumBands);
    layout.setSampleModel(sm);
  }
  ColorModel cm=layout.getColorModel(null);
  if (cm != null && !JDKWorkarounds.areCompatibleDataModels(sm,cm)) {
    layout.unsetValid(ImageLayout.COLOR_MODEL_MASK);
  }
  return layout;
}

Fixed version (ground truth):
private static ImageLayout layoutHelper(Vector sources,ImageLayout il){
  ImageLayout layout=(il == null) ? new ImageLayout() : (ImageLayout)il.clone();
  int numSources=sources.size();
  int destNumBands=totalNumBands(sources);
  int destDataType=DataBuffer.TYPE_BYTE;
  RenderedImage srci=(RenderedImage)sources.get(0);
  Rectangle destBounds=new Rectangle(srci.getMinX(),srci.getMinY(),srci.getWidth(),srci.getHeight());
  for (int i=0; i < numSources; i++) {
    srci=(RenderedImage)sources.get(i);
    destBounds=destBounds.intersection(new Rectangle(srci.getMinX(),srci.getMinY(),srci.getWidth(),srci.getHeight()));
    int typei=srci.getSampleModel().getTransferType();
    destDataType=typei > destDataType ? typei : destDataType;
  }
  SampleModel sm=layout.getSampleModel((RenderedImage)sources.get(0));
  if (sm.getNumBands() < destNumBands) {
    int[] destOffsets=new int[destNumBands];
    for (int i=0; i < destNumBands; i++) {
      destOffsets[i]=i;
    }
    int destTileWidth=sm.getWidth();
    int destTileHeight=sm.getHeight();
    if (layout.isValid(ImageLayout.TILE_WIDTH_MASK)) {
      destTileWidth=layout.getTileWidth((RenderedImage)sources.get(0));
    }
    if (layout.isValid(ImageLayout.TILE_HEIGHT_MASK)) {
      destTileHeight=layout.getTileHeight((RenderedImage)sources.get(0));
    }
    sm=RasterFactory.createComponentSampleModel(sm,destDataType,destTileWidth,destTileHeight,destNumBands);
    layout.setSampleModel(sm);
  }
  ColorModel cm=layout.getColorModel(null);
  if (cm != null && !JDKWorkarounds.areCompatibleDataModels(sm,cm)) {
    layout.unsetValid(ImageLayout.COLOR_MODEL_MASK);
  }
  return layout;
}
Program: 154007
Project: 154007
Buggy source:
public float[] fromRGB(float[] rgbvalue){
  float C=1.0F - rgbvalue[0];
  float M=1.0F - rgbvalue[1];
  float Y=1.0F - rgbvalue[2];
  float K=Math.min(C,Math.min(M,Y));
  return new float[]{C,M,Y,K};
}

Fixed version (ground truth):
public float[] fromRGB(float[] rgbvalue){
  float C=1.0F - rgbvalue[0];
  float M=1.0F - rgbvalue[1];
  float Y=1.0F - rgbvalue[2];
  float K=Math.min(C,Math.min(M,Y));
  if (K != 1.0F) {
    float K1=1.0F - K;
    C=(C - K) / K1;
    M=(M - K) / K1;
    Y=(Y - K) / K1;
  }
  return new float[]{C,M,Y,K};
}
Program: 154008
Project: 154008
Buggy source:
public float[] toRGB(float[] colorvalue){
  float K=colorvalue[3];
  float C=colorvalue[0] - K;
  float M=colorvalue[1] - K;
  float Y=colorvalue[2] - K;
  return new float[]{1.0F - C,1.0F - M,1.0F - Y};
}

Fixed version (ground truth):
public float[] toRGB(float[] colorvalue){
  float C=colorvalue[0];
  float M=colorvalue[1];
  float Y=colorvalue[2];
  float K=colorvalue[3];
  float K1=1.0F - K;
  return new float[]{K1 * (1.0F - C),K1 * (1.0F - M),K1 * (1.0F - Y)};
}
Program: 154009
Project: 154009
Buggy source:
protected boolean validateParameters(ParameterBlock args,StringBuffer msg){
  int argNumParams=args.getNumParameters();
  if (argNumParams > 0 && args.getObjectParameter(0) instanceof Integer) {
    Object obj;
    if (argNumParams < 2) {
      obj=args.getObjectParameter(0);
      if (obj instanceof Integer) {
        args.add(obj);
      }
    }
    if (argNumParams < 3) {
      obj=args.getObjectParameter(0);
      if (obj instanceof Integer) {
        args.add(((Integer)obj).intValue() / 2);
      }
    }
    if (argNumParams < 4) {
      obj=args.getObjectParameter(1);
      if (obj instanceof Integer) {
        args.add(((Integer)obj).intValue() / 2);
      }
    }
  }
  return super.validateParameters(args,msg);
}

Fixed version (ground truth):
protected boolean validateParameters(ParameterBlock args,StringBuffer msg){
  int argNumParams=args.getNumParameters();
  if (argNumParams == 0) {
    args.add(paramDefaults[0]);
    argNumParams++;
  }
  if (argNumParams > 0 && args.getObjectParameter(0) instanceof Integer) {
    Object obj;
    if (argNumParams < 2) {
      obj=args.getObjectParameter(0);
      if (obj instanceof Integer) {
        args.add(obj);
      }
    }
    if (argNumParams < 3) {
      obj=args.getObjectParameter(0);
      if (obj instanceof Integer) {
        args.add(((Integer)obj).intValue() / 2);
      }
    }
    if (argNumParams < 4) {
      obj=args.getObjectParameter(1);
      if (obj instanceof Integer) {
        args.add(((Integer)obj).intValue() / 2);
      }
    }
  }
  return super.validateParameters(args,msg);
}
Program: 154016
Project: 154016
Buggy source:
/** 
 * Stores the parameter by reference in the internal name.
 * @throws IllegalArgumentException if <code>name</code> is<code>null</code>.
 */
public void setName(String name){
  if (name == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  this.name=name;
  lowerCaseName=name.toLowerCase();
}

Fixed version (ground truth):
/** 
 * Stores the parameter by reference in the internal name.
 * @throws IllegalArgumentException if <code>name</code> is<code>null</code>.
 */
public void setName(String name){
  if (name == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  this.name=name;
  lowerCaseName=name.toLowerCase(Locale.ENGLISH);
}
Program: 154017
Project: 154017
Buggy source:
protected Rectangle backwardMapRect(Rectangle destRect,int sourceIndex){
  if (destRect == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
 else   if (sourceIndex != 0) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  Point2D p1=mapDestPoint(new Point2D.Double(destRect.x,destRect.y));
  Point2D p2=mapDestPoint(new Point2D.Double(destRect.x + destRect.width - 1,destRect.y + destRect.height - 1));
  int x1=(int)Math.floor(p1.getX());
  int y1=(int)Math.floor(p1.getY());
  int x2=(int)Math.floor(p2.getX());
  int y2=(int)Math.floor(p2.getY());
  return new Rectangle(x1,y1,x2 - x1 + 1,y2 - y1 + 1);
}

Fixed version (ground truth):
protected Rectangle backwardMapRect(Rectangle destRect,int sourceIndex){
  if (destRect == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
 else   if (sourceIndex != 0) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  Point2D p1=mapDestPoint(new Point2D.Double(destRect.x,destRect.y));
  Point2D p2=mapDestPoint(new Point2D.Double(destRect.x + destRect.width - 1,destRect.y + destRect.height - 1));
  int x1=(int)Math.floor(p1.getX());
  int y1=(int)Math.floor(p1.getY());
  int x2=(int)Math.ceil(p2.getX());
  int y2=(int)Math.ceil(p2.getY());
  return new Rectangle(x1,y1,x2 - x1 + 1,y2 - y1 + 1);
}
Program: 154018
Project: 154018
Buggy source:
protected Rectangle forwardMapRect(Rectangle sourceRect,int sourceIndex){
  if (sourceRect == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
 else   if (sourceIndex != 0) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  Point2D p1=mapSourcePoint(new Point2D.Double(sourceRect.x,sourceRect.y));
  Point2D p2=mapSourcePoint(new Point2D.Double(sourceRect.x + sourceRect.width - 1,sourceRect.y + sourceRect.height - 1));
  int x1=(int)Math.floor(p1.getX());
  int y1=(int)Math.floor(p1.getY());
  int x2=(int)Math.floor(p2.getX());
  int y2=(int)Math.floor(p2.getY());
  return new Rectangle(x1,y1,x2 - x1 + 1,y2 - y1 + 1);
}

Fixed version (ground truth):
protected Rectangle forwardMapRect(Rectangle sourceRect,int sourceIndex){
  if (sourceRect == null) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
 else   if (sourceIndex != 0) {
    throw new IllegalArgumentException(JaiI18N.getString("String_Node_Str"));
  }
  Point2D p1=mapSourcePoint(new Point2D.Double(sourceRect.x,sourceRect.y));
  Point2D p2=mapSourcePoint(new Point2D.Double(sourceRect.x + sourceRect.width - 1,sourceRect.y + sourceRect.height - 1));
  int x1=(int)Math.floor(p1.getX());
  int y1=(int)Math.floor(p1.getY());
  int x2=(int)Math.ceil(p2.getX());
  int y2=(int)Math.ceil(p2.getY());
  return new Rectangle(x1,y1,x2 - x1 + 1,y2 - y1 + 1);
}
Program: 154019
Project: 154019
Buggy source:
public boolean isFormatRecognized(byte[] header){
  return ((header[0] == (byte)0) && (header[1] & 0x9f) == 0 && (header[2] & 0x7f) != 0);
}

Fixed version (ground truth):
public boolean isFormatRecognized(byte[] header){
  return ((header[0] == (byte)0) && header[1] == 0 && ((header[2] & 0x8f) != 0 || (header[2] & 0x7f) != 0));
}
Program: 154020
Project: 154020
Buggy source:
/** 
 * Returns JAI version information as a <code>String</code>
 * @since JAI 1.1
 */
public static final String getBuildVersion(){
  try {
    InputStream is=JAI.class.getResourceAsStream("String_Node_Str");
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    StringWriter sw=new StringWriter();
    BufferedWriter writer=new BufferedWriter(sw);
    String str;
    boolean append=false;
    while ((str=reader.readLine()) != null) {
      if (append)       writer.newLine();
      writer.write(str);
      append=true;
    }
    writer.close();
    return sw.getBuffer().toString();
  }
 catch (  Exception e) {
    return JaiI18N.getString("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Returns JAI version information as a <code>String</code>
 * @since JAI 1.1
 */
public static final String getBuildVersion(){
  try {
    InputStream is=JAI.class.getResourceAsStream("String_Node_Str");
    if (is == null)     is=PropertyUtil.getFileFromClasspath("String_Node_Str");
    BufferedReader reader=new BufferedReader(new InputStreamReader(is));
    StringWriter sw=new StringWriter();
    BufferedWriter writer=new BufferedWriter(sw);
    String str;
    boolean append=false;
    while ((str=reader.readLine()) != null) {
      if (append)       writer.newLine();
      writer.write(str);
      append=true;
    }
    writer.close();
    return sw.getBuffer().toString();
  }
 catch (  Exception e) {
    return JaiI18N.getString("String_Node_Str");
  }
}
Program: 154021
Project: 154021
Buggy source:
private static void setUseMlib(){
  boolean disableMediaLib=false;
  try {
    disableMediaLib=Boolean.getBoolean("String_Node_Str");
  }
 catch (  java.security.AccessControlException e) {
  }
  if (disableMediaLib) {
    useMlibVar=false;
    return;
  }
  try {
    SecurityManager securityManager=System.getSecurityManager();
    if (securityManager != null && MediaLibAccessor.class.getClassLoader() != null) {
      String osName=System.getProperty("String_Node_Str");
      String osArch=System.getProperty("String_Node_Str");
      if ((osName.equals("String_Node_Str") || osName.equals("String_Node_Str")) && osArch.equals("String_Node_Str")) {
        FilePermission fp=new FilePermission("String_Node_Str","String_Node_Str");
        securityManager.checkPermission(fp);
      }
    }
    Boolean result=(Boolean)AccessController.doPrivileged(new PrivilegedAction(){
      public Object run(){
        return new Boolean(Image.isAvailable());
      }
    }
);
    useMlibVar=result.booleanValue();
    if (!useMlibVar) {
      System.err.println(JaiI18N.getString("String_Node_Str"));
    }
  }
 catch (  NoClassDefFoundError ncdfe) {
    useMlibVar=false;
    System.err.println(JaiI18N.getString("String_Node_Str"));
  }
catch (  ClassFormatError cfe) {
    useMlibVar=false;
    System.err.println(JaiI18N.getString("String_Node_Str"));
  }
catch (  SecurityException se) {
    useMlibVar=false;
    System.err.println(JaiI18N.getString("String_Node_Str"));
  }
  if (useMlibVar == false)   return;
}

Fixed version (ground truth):
private static void setUseMlib(){
  boolean disableMediaLib=false;
  try {
    disableMediaLib=Boolean.getBoolean("String_Node_Str");
  }
 catch (  java.security.AccessControlException e) {
  }
  if (disableMediaLib) {
    useMlibVar=false;
    return;
  }
  try {
    SecurityManager securityManager=System.getSecurityManager();
    if (securityManager != null && MediaLibAccessor.class.getClassLoader() != null) {
      String osName=System.getProperty("String_Node_Str");
      String osArch=System.getProperty("String_Node_Str");
      if ((osName.equals("String_Node_Str") || osName.equals("String_Node_Str")) && osArch.equals("String_Node_Str")) {
        FilePermission fp=new FilePermission("String_Node_Str","String_Node_Str");
        securityManager.checkPermission(fp);
      }
    }
    Boolean result=(Boolean)AccessController.doPrivileged(new PrivilegedAction(){
      public Object run(){
        return new Boolean(Image.isAvailable());
      }
    }
);
    useMlibVar=result.booleanValue();
    if (!useMlibVar) {
      forwardToListener(JaiI18N.getString("String_Node_Str"),new MediaLibLoadException());
    }
  }
 catch (  NoClassDefFoundError ncdfe) {
    useMlibVar=false;
    forwardToListener(JaiI18N.getString("String_Node_Str"),ncdfe);
  }
catch (  ClassFormatError cfe) {
    useMlibVar=false;
    forwardToListener(JaiI18N.getString("String_Node_Str"),cfe);
  }
catch (  SecurityException se) {
    useMlibVar=false;
    forwardToListener(JaiI18N.getString("String_Node_Str"),se);
  }
  if (useMlibVar == false)   return;
}
Program: 154024
Project: 154024
Buggy source:
/** 
 * Validates the input parameters. <p> In addition to the standard checks performed by the superclass method, this method by default checks that the source file exists and is readable. This check may be bypassed by setting the <code>checkFileLocally</code> parameter to <code>FALSE</code>
 */
protected boolean validateParameters(ParameterBlock args,StringBuffer msg){
  if (!super.validateParameters(args,msg)) {
    return false;
  }
  Boolean checkFile=(Boolean)args.getObjectParameter(2);
  if (checkFile.booleanValue()) {
    String filename=(String)args.getObjectParameter(0);
    File f=new File(filename);
    if (!f.exists()) {
      msg.append("String_Node_Str" + filename + "String_Node_Str"+ JaiI18N.getString("String_Node_Str"));
      return false;
    }
    if (!f.canRead()) {
      msg.append("String_Node_Str" + filename + "String_Node_Str"+ JaiI18N.getString("String_Node_Str"));
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Validates the input parameters. <p> In addition to the standard checks performed by the superclass method, this method by default checks that the source file exists and is readable. This check may be bypassed by setting the <code>checkFileLocally</code> parameter to <code>FALSE</code>
 */
protected boolean validateParameters(ParameterBlock args,StringBuffer msg){
  if (!super.validateParameters(args,msg)) {
    return false;
  }
  Boolean checkFile=(Boolean)args.getObjectParameter(2);
  if (checkFile.booleanValue()) {
    String filename=(String)args.getObjectParameter(0);
    File f=new File(filename);
    boolean fileExists=f.exists();
    if (!fileExists) {
      InputStream is=getClass().getResourceAsStream(filename);
      if (is == null) {
        msg.append("String_Node_Str" + filename + "String_Node_Str"+ JaiI18N.getString("String_Node_Str"));
        return false;
      }
    }
 else {
      if (!f.canRead()) {
        msg.append("String_Node_Str" + filename + "String_Node_Str"+ JaiI18N.getString("String_Node_Str"));
        return false;
      }
    }
  }
  return true;
}
Program: 154036
Project: 154036
Buggy source:
/** 
 * Creates a MlibDilate3PlusOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibDilate3PlusOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,config,true,extender,1,1,1,1);
}

Fixed version (ground truth):
/** 
 * Creates a MlibDilate3PlusOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibDilate3PlusOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,configHelper(config),true,extender,1,1,1,1);
}
Program: 154037
Project: 154037
Buggy source:
/** 
 * Creates a MlibDilate3SquareOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibDilate3SquareOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,config,true,extender,1,1,1,1);
}

Fixed version (ground truth):
/** 
 * Creates a MlibDilate3SquareOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibDilate3SquareOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,configHelper(config),true,extender,1,1,1,1);
}
Program: 154038
Project: 154038
Buggy source:
/** 
 * Creates a MlibErode3PlusOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibErode3PlusOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,config,true,extender,1,1,1,1);
}

Fixed version (ground truth):
/** 
 * Creates a MlibErode3PlusOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibErode3PlusOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,configHelper(config),true,extender,1,1,1,1);
}
Program: 154039
Project: 154039
Buggy source:
/** 
 * Creates a MlibErode3SquareOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibErode3SquareOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,config,true,extender,1,1,1,1);
}

Fixed version (ground truth):
/** 
 * Creates a MlibErode3SquareOpImage given the image source The image dimensions are derived from the source image.  The tile grid layout, SampleModel, and ColorModel may optionally be specified by an ImageLayout object.
 * @param source a RenderedImage.
 * @param extender a BorderExtender, or null.or null.  If null, a default cache will be used.
 * @param layout an ImageLayout optionally containing the tile grid layout,SampleModel, and ColorModel, or null.
 */
public MlibErode3SquareOpImage(RenderedImage source,BorderExtender extender,Map config,ImageLayout layout){
  super(source,layout,configHelper(config),true,extender,1,1,1,1);
}
Program: 154040
Project: 154040
Buggy source:
/** 
 * pack kernel into integers by row, aligned to the right; extra bits on the left are filled with 0 bits
 * @params  kernel - the given kernel (already rotated)
 * @returns an integer array of ints from packed kernel data
 */
private final int[] packKernel(KernelJAI kernel){
  int kw=kernel.getWidth();
  int kh=kernel.getHeight();
  int kwPack=(31 + kw) / 32;
  int kerPacked[]=new int[kwPack * kh];
  float[] kdata=kernel.getKernelData();
  for (int j=0; j < kw; j++) {
    int m=j;
    int lastCol=kwPack - 1;
    bitShiftMatrixLeft(kerPacked,kh,kwPack);
    for (int i=0; i < kh; i++, lastCol+=kwPack, m+=kh) {
      if (kdata[m] > .9F) {
        kerPacked[lastCol]|=0x1;
      }
    }
  }
  return kerPacked;
}

Fixed version (ground truth):
/** 
 * pack kernel into integers by row, aligned to the right; extra bits on the left are filled with 0 bits
 * @params  kernel - the given kernel (already rotated)
 * @returns an integer array of ints from packed kernel data
 */
private final int[] packKernel(KernelJAI kernel){
  int kw=kernel.getWidth();
  int kh=kernel.getHeight();
  int kwPack=(31 + kw) / 32;
  int kerPacked[]=new int[kwPack * kh];
  float[] kdata=kernel.getKernelData();
  for (int j=0; j < kw; j++) {
    int m=j;
    int lastCol=kwPack - 1;
    bitShiftMatrixLeft(kerPacked,kh,kwPack);
    for (int i=0; i < kh; i++, lastCol+=kwPack, m+=kw) {
      if (kdata[m] > .9F) {
        kerPacked[lastCol]|=0x1;
      }
    }
  }
  return kerPacked;
}
Program: 154041
Project: 154041
Buggy source:
/** 
 * pack kernel into integers by row, aligned to the right; extra bits on the left are filled with 0 bits
 * @params  kernel - the given kernel (already rotated)
 * @returns an integer array of ints from packed kernel data
 */
private final int[] packKernel(KernelJAI kernel){
  int kw=kernel.getWidth();
  int kh=kernel.getHeight();
  int kwPack=(31 + kw) / 32;
  int kerPacked[]=new int[kwPack * kh];
  float[] kdata=kernel.getKernelData();
  for (int j=0; j < kw; j++) {
    int m=j;
    int lastCol=kwPack - 1;
    bitShiftMatrixLeft(kerPacked,kh,kwPack);
    for (int i=0; i < kh; i++, lastCol+=kwPack, m+=kh) {
      if (kdata[m] > .9F) {
        kerPacked[lastCol]|=0x1;
      }
    }
  }
  return kerPacked;
}

Fixed version (ground truth):
/** 
 * pack kernel into integers by row, aligned to the right; extra bits on the left are filled with 0 bits
 * @params  kernel - the given kernel (already rotated)
 * @returns an integer array of ints from packed kernel data
 */
private final int[] packKernel(KernelJAI kernel){
  int kw=kernel.getWidth();
  int kh=kernel.getHeight();
  int kwPack=(31 + kw) / 32;
  int kerPacked[]=new int[kwPack * kh];
  float[] kdata=kernel.getKernelData();
  for (int j=0; j < kw; j++) {
    int m=j;
    int lastCol=kwPack - 1;
    bitShiftMatrixLeft(kerPacked,kh,kwPack);
    for (int i=0; i < kh; i++, lastCol+=kwPack, m+=kw) {
      if (kdata[m] > .9F) {
        kerPacked[lastCol]|=0x1;
      }
    }
  }
  return kerPacked;
}
Program: 154045
Project: 154045
Buggy source:
private int readEOL(boolean isFirstEOL){
  if (oneD == 0) {
    if (!seekEOL()) {
      throw new Error(JaiI18N.getString("String_Node_Str"));
    }
  }
  if (fillBits == 0) {
    int next12Bits=nextNBits(12);
    if (isFirstEOL && next12Bits == 0) {
      if (nextNBits(4) == 1) {
        fillBits=1;
        return 1;
      }
    }
    if (next12Bits != 1) {
      throw new Error(JaiI18N.getString("String_Node_Str"));
    }
  }
 else   if (fillBits == 1) {
    int bitsLeft=8 - bitPointer;
    if (nextNBits(bitsLeft) != 0) {
      throw new Error(JaiI18N.getString("String_Node_Str"));
    }
    if (bitsLeft < 4) {
      if (nextNBits(8) != 0) {
        throw new Error(JaiI18N.getString("String_Node_Str"));
      }
    }
    int next8=nextNBits(8);
    if (isFirstEOL && (next8 & 0xf0) == 0x10) {
      fillBits=0;
      updatePointer(4);
    }
 else {
      while (next8 != 1) {
        if (next8 != 0) {
          throw new Error(JaiI18N.getString("String_Node_Str"));
        }
        next8=nextNBits(8);
      }
    }
  }
  if (oneD == 0) {
    return 1;
  }
 else {
    return nextLesserThan8Bits(1);
  }
}

Fixed version (ground truth):
private int readEOL(boolean isFirstEOL){
  if (oneD == 0) {
    if (!seekEOL()) {
      throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
    }
  }
  if (fillBits == 0) {
    int next12Bits=nextNBits(12);
    if (isFirstEOL && next12Bits == 0) {
      if (nextNBits(4) == 1) {
        fillBits=1;
        return 1;
      }
    }
    if (next12Bits != 1) {
      throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
    }
  }
 else   if (fillBits == 1) {
    int bitsLeft=8 - bitPointer;
    if (nextNBits(bitsLeft) != 0) {
      throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
    }
    if (bitsLeft < 4) {
      if (nextNBits(8) != 0) {
        throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
      }
    }
    int next8=nextNBits(8);
    if (isFirstEOL && (next8 & 0xf0) == 0x10) {
      fillBits=0;
      updatePointer(4);
    }
 else {
      while (next8 != 1) {
        if (next8 != 0) {
          throw new RuntimeException(JaiI18N.getString("String_Node_Str"));
        }
        next8=nextNBits(8);
      }
    }
  }
  if (oneD == 0) {
    return 1;
  }
 else {
    return nextLesserThan8Bits(1);
  }
}