nus-yam/ex-repair huggingface dataset:
Program: 19500
Project: 19500
Buggy source:
private void setCameraLight(String cameraFlashMode){
  Parameters parameters=mCamera.getParameters();
  parameters.setFlashMode(cameraFlashMode);
  mCamera.setParameters(parameters);
  if (cameraFlashMode.equals(Camera.Parameters.FLASH_MODE_TORCH))   mControlBar.setButtonLight(true);
 else   mControlBar.setButtonLight(false);
}

Fixed version (ground truth):
private void setCameraLight(String cameraFlashMode){
  Parameters parameters=mCamera.getParameters();
  parameters.setFlashMode(cameraFlashMode);
  mCamera.setParameters(parameters);
  mControlBar.setButtonLight(cameraFlashMode.equals(Camera.Parameters.FLASH_MODE_TORCH));
}
Program: 19501
Project: 19501
Buggy source:
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  super.onPause();
  mOrientationEventListener.disable();
  mSurfaceView.setVisibility(View.GONE);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  printLivecycleStatus("String_Node_Str");
  if (mShowLoadingScreenTask != null) {
    printLivecycleStatus("String_Node_Str");
    mShowLoadingScreenTask.cancel(false);
    mShowLoadingScreenTask=null;
  }
  mOrientationEventListener.disable();
  mSurfaceView.setVisibility(View.GONE);
  super.onPause();
}
Program: 19502
Project: 19502
Buggy source:
/** 
 * {@inheritDoc}Show the application menu on menu button.
 */
@Override public boolean onPrepareOptionsMenu(Menu menu){
  if (menuIsShowing()) {
    dismissMenus();
    return false;
  }
 else {
    stopCameraPreview();
    inflateMenu(mAppMenu);
    return true;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Show the application menu on menu button.
 */
@Override public boolean onPrepareOptionsMenu(Menu menu){
  printLivecycleStatus("String_Node_Str");
  if (menuIsShowing()) {
    dismissMenus();
    return false;
  }
 else {
    stopCameraPreview();
    inflateMenu(mAppMenu);
    return true;
  }
}
Program: 19503
Project: 19503
Buggy source:
/** 
 * {@inheritDoc}Called when the activity is first created.
 */
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mLoadingScreen=findViewById(R.id.hsr_loading_screen);
  mColorView=(ColorView)findViewById(R.id.cameraSurface);
  mColorView.setActivityHandler(mHandler);
  mControlBar=(ControlBar)findViewById(R.id.controlBar);
  mControlBar.setActivityHandler(mHandler);
  mControlBar.enableOnClickListeners();
  mControlBar.rotate(Orientation.UNKNOW);
  mPrimaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSecondaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSurfaceView=(SurfaceView)findViewById(id.cameraSurface_dummy);
  mSurfaceView.getHolder().addCallback(this);
  getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  createMenus();
  setToastSizes();
  initOrientationEventListener();
  mOrientationEventListener.enable();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.main);
  mLoadingScreen=findViewById(R.id.hsr_loading_screen);
  mColorView=(ColorView)findViewById(R.id.cameraSurface);
  mColorView.setActivityHandler(mHandler);
  mControlBar=(ControlBar)findViewById(R.id.controlBar);
  mControlBar.setActivityHandler(mHandler);
  mControlBar.enableOnClickListeners();
  mControlBar.rotate(Orientation.UNKNOW);
  mPrimaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSecondaryFilterToast=new ToastBubble(getApplicationContext(),mColorView);
  mSurfaceView=(SurfaceView)findViewById(id.cameraSurface_dummy);
  mSurfaceView.getHolder().addCallback(this);
  getWindowManager().getDefaultDisplay().getMetrics(mMetrics);
  createMenus();
  setToastSizes();
  initOrientationEventListener();
}
Program: 19504
Project: 19504
Buggy source:
/** 
 * {@inheritDoc}Called whenever the activity will be shut down.
 */
@Override protected void onDestroy(){
  mOrientationEventListener.disable();
  mColorView.dismissPopup();
  super.onDestroy();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called whenever the activity will be shut down.
 */
@Override protected void onDestroy(){
  printLivecycleStatus("String_Node_Str");
  super.onDestroy();
}
Program: 19505
Project: 19505
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  startCameraPreview();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void surfaceChanged(SurfaceHolder holder,int format,int width,int height){
  printLivecycleStatus("String_Node_Str");
  startCameraPreview();
}
Program: 19506
Project: 19506
Buggy source:
private Size getOptimalSize(List<Size> sizeList){
  if (sizeList == null)   return null;
  int targetWidth=mMetrics.widthPixels;
  int targetHeight=mMetrics.heightPixels;
  int diffSize=Integer.MAX_VALUE;
  Size optSize=null;
  for (  Size size : sizeList) {
    int tmpDiffSize=(size.height - targetHeight) + (size.width - targetWidth);
    if (tmpDiffSize < 0)     continue;
    if (tmpDiffSize < diffSize) {
      optSize=size;
      diffSize=tmpDiffSize;
      if (diffSize == 0)       return optSize;
    }
  }
  return optSize;
}

Fixed version (ground truth):
private Size getOptimalSize(List<Size> sizeList){
  if (sizeList == null)   return null;
  int targetWidth=mMetrics.widthPixels;
  int targetHeight=mMetrics.heightPixels;
  double targetRatio=(double)targetWidth / targetHeight;
  double diffSize=Double.MAX_VALUE;
  int upperWidthBound=1000;
  int lowerWidthBound=targetWidth / 2;
  Size optSize=null;
  for (  Size size : sizeList) {
    if (size.width > upperWidthBound || size.width < lowerWidthBound)     continue;
    double tmpRatio=(double)size.width / size.height;
    double tmpDiff=tmpRatio * (size.height + size.width) - targetRatio * (targetHeight + targetWidth);
    tmpDiff=Math.abs(tmpDiff);
    if (tmpDiff < diffSize) {
      optSize=size;
      diffSize=tmpDiff;
      if (diffSize == 0)       return optSize;
    }
  }
  return optSize;
}
Program: 19507
Project: 19507
Buggy source:
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  super.onPause();
  releaseCamera();
  mWakeLock.release();
  mOrientationEventListener.disable();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called whenever the Activity will be sent to the background.
 */
@Override protected void onPause(){
  super.onPause();
  mWakeLock.release();
  mOrientationEventListener.disable();
}
Program: 19508
Project: 19508
Buggy source:
private void startCameraPreview(){
  makeSureCameraPreviewStarts();
  mCamera.addCallbackBuffer(mCallBackBuffer);
  mCamera.setPreviewCallbackWithBuffer((PreviewCallback)mColorView);
  mCamera.startPreview();
  mCamIsPreviewing=true;
  mControlBar.setButtonPlay(mCamIsPreviewing);
  mColorView.dismissPopup();
}

Fixed version (ground truth):
private void startCameraPreview(){
  mCamera.addCallbackBuffer(mCallBackBuffer);
  mCamera.setPreviewCallbackWithBuffer((PreviewCallback)mColorView);
  mCamera.startPreview();
  mCamIsPreviewing=true;
  mControlBar.setButtonPlay(mCamIsPreviewing);
  mColorView.dismissPopup();
}
Program: 19509
Project: 19509
Buggy source:
@Override public void surfaceCreated(SurfaceHolder holder){
}

Fixed version (ground truth):
@Override public void surfaceCreated(SurfaceHolder holder){
  makeSureCameraPreviewStarts();
}
Program: 19510
Project: 19510
Buggy source:
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  super.onResume();
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  openCamera();
  configEnvByCameraParams();
  initSavedPreferences();
  mControlBar.initState();
  mWakeLock.acquire();
  mOrientationEventListener.enable();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Called after onCreate() and onStart()
 */
@Override protected void onResume(){
  super.onResume();
  openCamera();
  mShowLoadingScreenTask=new ShowLoadingScreenTask();
  mShowLoadingScreenTask.execute();
  configEnvByCameraParams();
  initSavedPreferences();
  mControlBar.initState();
  mWakeLock.acquire();
  mOrientationEventListener.enable();
}
Program: 19511
Project: 19511
Buggy source:
@Override public void surfaceDestroyed(SurfaceHolder holder){
}

Fixed version (ground truth):
@Override public void surfaceDestroyed(SurfaceHolder holder){
  releaseCamera();
}
Program: 19512
Project: 19512
Buggy source:
private void initBitmap(){
  mBitmap=Bitmap.createBitmap(mPreviewWidth,mPreviewHeight,Bitmap.Config.RGB_565);
  Debug.msg(LOG_TAG,"String_Node_Str" + mPreviewWidth + "String_Node_Str"+ mPreviewHeight);
}

Fixed version (ground truth):
private void initBitmap(){
  mBitmap=Bitmap.createBitmap(mPreviewWidth,mPreviewHeight,Bitmap.Config.RGB_565);
  Debug.msg(LOG_TAG,"String_Node_Str" + mPreviewWidth + "String_Node_Str"+ mPreviewHeight);
  scaleBitmapToFillScreen();
}
Program: 19513
Project: 19513
Buggy source:
/** 
 * {@inheritDoc}Redraws the Bitmap containing the transformed picture on each call.
 */
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.drawBitmap(mBitmap,0,0,null);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}Redraws the Bitmap containing the transformed picture on each call.
 */
@Override protected void onDraw(Canvas canvas){
  super.onDraw(canvas);
  canvas.drawBitmap(mBitmap,0,0,null);
  if (mIsScaled)   canvas.scale(mScaleFactor,mScaleFactor);
}
Program: 19514
Project: 19514
Buggy source:
public SurfaceViewDummy(Context context,AttributeSet arg1,int arg2){
  super(context,arg1,arg2);
}

Fixed version (ground truth):
public SurfaceViewDummy(Context context,AttributeSet arg1,int arg2){
  super(context,arg1,arg2);
  getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
Program: 19515
Project: 19515
Buggy source:
/** 
 * Check if <code>queueName</code> identifies a RQS <code>Queue</code> on this server.
 * @return true iff there is a database with that name, <strong>and</strong> that databaseis a queue, as determined by the existence of a RQS design document in that database.
 * @throws RQSException	wraps any exception thrown by the underlying CouchDB layer
 */
public boolean isQueue(String queueName) throws RQSException {
  if (isNameAvailable(queueName))   return false;
  Database db=new Database(this.couchDB,queueName);
  try {
    db.designDocumentInfo(Queue.RQS_DESIGN_DOC_NAME);
    return true;
  }
 catch (  CouchDBException cdbe) {
    if (cdbe.getStatusCode() == 404)     return false;
 else     throw new RQSException(cdbe);
  }
catch (  Exception e) {
    throw new RQSException(e);
  }
}

Fixed version (ground truth):
/** 
 * Check if <code>queueName</code> identifies a RQS <code>Queue</code> on this server.
 * @return true iff there is a database with that name, <strong>and</strong> that databaseis a queue, as determined by the existence of a RQS design document in that database.
 * @throws RQSException	wraps any exception thrown by the underlying CouchDB layer
 */
public boolean isQueue(String queueName) throws RQSException {
  if (!isNameValid(queueName))   return false;
  if (isNameAvailable(queueName))   return false;
  Database db=new Database(this.couchDB,queueName);
  try {
    db.designDocumentInfo(Queue.RQS_DESIGN_DOC_NAME);
    return true;
  }
 catch (  CouchDBException cdbe) {
    if (cdbe.getStatusCode() == 404)     return false;
 else     throw new RQSException(cdbe);
  }
catch (  Exception e) {
    throw new RQSException(e);
  }
}
Program: 19516
Project: 19516
Buggy source:
/** 
 * Check if <code>queueName</code> can be used to create a new queue.
 * @return true iff there exists no database on the CoudhDB server with this name
 */
private boolean isNameAvailable(String queueName) throws RQSException {
  try {
    Database db=new Database(this.couchDB,queueName);
    return !db.exists();
  }
 catch (  Exception e) {
    throw new RQSException(e);
  }
}

Fixed version (ground truth):
/** 
 * Check if <code>queueName</code> can be used to create a new queue.
 * @return true iff there exists no database on the CoudhDB server with this name
 */
private boolean isNameAvailable(String queueName) throws RQSException {
  if (!isNameValid(queueName))   return false;
  try {
    Database db=new Database(this.couchDB,queueName);
    return !db.exists();
  }
 catch (  Exception e) {
    throw new RQSException(e);
  }
}
Program: 19517
Project: 19517
Buggy source:
/** 
 * Create the Properties file for Felix to launch.
 * @param defaultDirectory
 * @param logger
 * @param activators
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 */
private static Properties createFelixProperties(File defaultDirectory,KnapsackLogger logger,List<BundleActivator> activators) throws FileNotFoundException, IOException {
  Properties felixConfig=new Properties();
  felixConfig.load(getFelixConfigFileInputStream(defaultDirectory));
  felixConfig.put(FELIX_LOGGER_INSTANCE,logger);
  felixConfig.put(FELIX_BUNDLE_INSTANCES,activators);
  return felixConfig;
}

Fixed version (ground truth):
/** 
 * Create the Properties file for Felix to launch.
 * @param defaultDirectory
 * @param logger
 * @param activators
 * @return
 * @throws FileNotFoundException
 * @throws IOException
 */
private static Properties createFelixProperties(File defaultDirectory,KnapsackLogger logger,List<BundleActivator> activators) throws FileNotFoundException, IOException {
  Properties felixConfig=new Properties();
  felixConfig.load(getFelixConfigFileInputStream(defaultDirectory));
  for (  Entry e : felixConfig.entrySet())   felixConfig.put(e.getKey(),LoadPropertiesFunction.evalSubsitutions(e.getValue().toString()));
  felixConfig.put(FELIX_LOGGER_INSTANCE,logger);
  felixConfig.put(FELIX_BUNDLE_INSTANCES,activators);
  return felixConfig;
}
Program: 19518
Project: 19518
Buggy source:
/** 
 * A recursive function to replace variables with values from System.properties. Variable is defined in ${var} style with 'var' being a system property.
 * @param ins
 * @return
 * @throws IOException
 */
private String evalSubsitutions(final String ins) throws IOException {
  int si=ins.indexOf("String_Node_Str");
  if (si > -1) {
    int ti=ins.indexOf('}',si + 2);
    if (ti == -1)     throw new IOException("String_Node_Str" + ins);
    String varName=ins.substring(si + 2,ti);
    String varVal=System.getProperty(varName);
    String varLiteral="String_Node_Str" + varName + "String_Node_Str";
    String subLine=ins.replaceAll(varLiteral,varVal);
    return evalSubsitutions(subLine);
  }
  return ins;
}

Fixed version (ground truth):
/** 
 * A recursive function to replace variables with values from System.properties. Variable is defined in ${var} style with 'var' being a system property.
 * @param ins
 * @return
 * @throws IOException
 */
public static String evalSubsitutions(final String ins) throws IOException {
  int si=ins.indexOf("String_Node_Str");
  if (si > -1) {
    int ti=ins.indexOf('}',si + 2);
    if (ti == -1)     throw new IOException("String_Node_Str" + ins);
    String varName=ins.substring(si + 2,ti);
    String varVal=System.getProperty(varName);
    String varLiteral="String_Node_Str" + varName + "String_Node_Str";
    String subLine=ins.replaceAll(varLiteral,varVal);
    return evalSubsitutions(subLine);
  }
  return ins;
}
Program: 19519
Project: 19519
Buggy source:
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  if (config == null)   config=Config.getRef();
  managedServiceRef=bundleContext.registerService(ManagedService.class.getName(),this,getManagedServiceProperties());
  context.addFrameworkListener(this);
  if (embeddedMode && defaultDirExists()) {
    ServiceReference sr=bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
    if (sr != null) {
      ConfigurationAdmin ca=(ConfigurationAdmin)bundleContext.getService(sr);
      loadDefaults(getDefaultDir(),ca);
    }
  }
}

Fixed version (ground truth):
public void start(BundleContext bundleContext) throws Exception {
  Activator.context=bundleContext;
  managedServiceRef=bundleContext.registerService(ManagedService.class.getName(),this,getManagedServiceProperties());
  context.addFrameworkListener(this);
  if (embeddedMode) {
    ServiceReference sr=bundleContext.getServiceReference(ConfigurationAdmin.class.getName());
    if (sr != null) {
      ConfigurationAdmin ca=(ConfigurationAdmin)bundleContext.getService(sr);
      loadDefaults(new File(config.get(Config.CONFIG_KEY_ROOT_DIR).toString(),Config.CONFIGADMIN_DIRECTORY_NAME),ca);
    }
  }
}
Program: 19520
Project: 19520
Buggy source:
/** 
 * Constructor for running as an embedded bundle in the Knapsack bootstrap.
 * @param logger instance of framework logger.
 * @throws IOException Upon configuration error.
 * @throws InterruptedException Upon interruption.
 */
public Activator(Logger logger,int port) throws IOException, InterruptedException {
  ref=this;
  this.port=port;
  Activator.frameworkLogger=logger;
  embeddedMode=true;
  config=Config.getRef();
}

Fixed version (ground truth):
/** 
 * Constructor for running as an embedded bundle in the Knapsack bootstrap.
 * @param logger instance of framework logger.
 * @throws IOException Upon configuration error.
 * @throws InterruptedException Upon interruption.
 */
public Activator(Config config,Logger logger,int port) throws IOException, InterruptedException {
  ref=this;
  this.port=port;
  Activator.frameworkLogger=logger;
  embeddedMode=true;
  this.config=config;
}
Program: 19521
Project: 19521
Buggy source:
private static void createKnapsackLayout(File baseDirectory,Logger logger,int port) throws IOException {
  File confFile=new File(baseDirectory,Config.CONFIGURATION_FILENAME);
  scriptDir=new File(baseDirectory,Config.SCRIPT_DIRECTORY_NAME);
  FSHelper.validateFile(scriptDir,true,true,false,true);
  if (!confFile.exists()) {
    logger.log(LogService.LOG_INFO,"String_Node_Str" + confFile);
    FSHelper.copyDefaultConfiguration(Config.CONFIGURATION_RESOURCE_FILENAME,confFile,baseDirectory);
  }
  if (FSHelper.directoryHasFiles(scriptDir))   FSHelper.deleteFilesInDir(scriptDir);
  FSHelper.copyScripts(confFile.getParentFile(),port);
}

Fixed version (ground truth):
private static void createKnapsackLayout(File baseDirectory,Logger logger,int port) throws IOException {
  File confFile=new File(baseDirectory,Config.CONFIGURATION_FILENAME);
  scriptDir=new File(baseDirectory,Config.SCRIPT_DIRECTORY_NAME);
  FSHelper.validateFile(scriptDir,true,true,false,true);
  if (!confFile.exists()) {
    logger.log(LogService.LOG_INFO,"String_Node_Str" + confFile);
    FSHelper.copyDefaultConfiguration(Config.CONFIGURATION_RESOURCE_FILENAME,confFile,baseDirectory);
  }
  if (FSHelper.directoryHasFiles(scriptDir))   FSHelper.deleteFilesInDir(scriptDir);
  FSHelper.copyScripts(confFile.getParentFile(),port);
  File defaultDir=new File(baseDirectory,Config.DEFAULT_DIRECTORY_NAME);
  FSHelper.validateFile(defaultDir,true,true,false,true);
  File configAdminDir=new File(baseDirectory,Config.CONFIGADMIN_DIRECTORY_NAME);
  FSHelper.validateFile(configAdminDir,true,true,false,true);
}
Program: 19523
Project: 19523
Buggy source:
/** 
 * Generate the default configuration.
 * @param targetConfFile
 * @return
 * @throws IOException
 */
public static void copyDefaultConfiguration(String sourceResourceFilename,File targetConfFile,File baseDirectory) throws IOException {
  InputStream istream=Config.class.getResourceAsStream(sourceResourceFilename);
  if (istream == null)   throw new IOException("String_Node_Str" + sourceResourceFilename);
  OutputStream fos=new FileOutputStream(targetConfFile);
  IOUtils.copy(istream,fos);
  if (baseDirectory != null) {
    File configAdminDir=new File(baseDirectory,Activator.CONFIGADMIN_FILENAME);
    validateFile(configAdminDir,true,true,false,true);
    IOUtils.write(LS + "String_Node_Str" + configAdminDir,fos);
  }
  istream.close();
  fos.close();
}

Fixed version (ground truth):
/** 
 * Generate the default configuration.
 * @param targetConfFile
 * @return
 * @throws IOException
 */
public static void copyDefaultConfiguration(String sourceResourceFilename,File targetConfFile,File baseDirectory) throws IOException {
  InputStream istream=Config.class.getResourceAsStream(sourceResourceFilename);
  if (istream == null)   throw new IOException("String_Node_Str" + sourceResourceFilename);
  OutputStream fos=new FileOutputStream(targetConfFile);
  IOUtils.copy(istream,fos);
  if (baseDirectory != null) {
    File configAdminDir=new File(baseDirectory,Config.CONFIGADMIN_DIRECTORY_NAME);
    validateFile(configAdminDir,true,true,false,true);
    IOUtils.write(LS + "String_Node_Str" + configAdminDir,fos);
  }
  istream.close();
  fos.close();
}
Program: 19524
Project: 19524
Buggy source:
/** 
 * Assume all files in default directory are property files.
 * @param f
 * @return
 */
private boolean isDefaultFile(File f){
  return f.getParentFile().getName().equals(Activator.DEFAULT_FILENAME);
}

Fixed version (ground truth):
/** 
 * Assume all files in default directory are property files.
 * @param f
 * @return
 */
private boolean isDefaultFile(File f){
  return f.getParentFile().getName().equals(Config.DEFAULT_DIRECTORY_NAME);
}
Program: 19525
Project: 19525
Buggy source:
/** 
 * Initialize state
 * @throws IOException
 * @throws InterruptedException 
 */
protected Config(File baseDirectory) throws IOException {
  this.baseDirectory=baseDirectory;
  load(new FileInputStream(getConfigFile()));
  if (!this.containsKey(CONFIG_KEY_ROOT_DIR))   this.put(CONFIG_KEY_ROOT_DIR,baseDirectory);
  if (!this.containsKey(CONFIG_KEY_BUNDLE_DIRS))   this.put(CONFIG_KEY_BUNDLE_DIRS,DEFAULT_BUNDLE_DIRECTORY);
}

Fixed version (ground truth):
/** 
 * Initialize state
 * @throws IOException
 * @throws InterruptedException 
 */
protected Config(File baseDirectory) throws IOException {
  for (  Object key : System.getProperties().keySet())   this.put(key,System.getProperty(key.toString()));
  this.baseDirectory=baseDirectory;
  load(new FileInputStream(getConfigFile()));
  if (!this.containsKey(CONFIG_KEY_ROOT_DIR))   this.put(CONFIG_KEY_ROOT_DIR,baseDirectory);
  if (!this.containsKey(CONFIG_KEY_BUNDLE_DIRS))   this.put(CONFIG_KEY_BUNDLE_DIRS,DEFAULT_BUNDLE_DIRECTORY);
}
Program: 19526
Project: 19526
Buggy source:
@Override public File apply(String element){
  File f=new File(baseDir,element);
  if (!f.exists() || !f.isDirectory())   return null;
  return f;
}

Fixed version (ground truth):
@Override public File apply(String element){
  return new File(baseDir,element.trim());
}
Program: 19527
Project: 19527
Buggy source:
@Override public Collection<File> getBundleDirectories(){
  if (bundleDirs == null)   bundleDirs=Fn.map(new Fn.Function<String,File>(){
    @Override public File apply(    String element){
      File f=new File(baseDir,element);
      if (!f.exists() || !f.isDirectory())       return null;
      return f;
    }
  }
,config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str"));
  return bundleDirs;
}

Fixed version (ground truth):
@Override public Collection<File> getBundleDirectories(){
  if (bundleDirs == null)   bundleDirs=Fn.map(new Fn.Function<String,File>(){
    @Override public File apply(    String element){
      return new File(baseDir,element.trim());
    }
  }
,config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str"));
  return bundleDirs;
}
Program: 19528
Project: 19528
Buggy source:
@Override public void frameworkEvent(FrameworkEvent event){
  if (event.getType() == FrameworkEvent.STARTED) {
    if (config.getBoolean(Config.CONFIG_KEY_LOG_STDOUT))     new LogPrinter(context);
    sizeMap=new HashMap<File,Long>();
    File baseDir=new File(config.getString(Config.CONFIG_KEY_ROOT_DIR));
    try {
      FSHelper.validateFile(baseDir,false,true,false,true);
      if (port != Bootstrap.DISABLE_SCRIPTS_PORT) {
        shell=new ConsoleSocketListener(port,context,this,new CommandParser(context,new File(baseDir,Config.SCRIPT_DIRECTORY_NAME)));
        shell.start();
      }
      (new InitThread(baseDir,Arrays.asList(config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str")))).start();
      log(LogService.LOG_INFO,"String_Node_Str" + KNAPSACK_VERSION + "String_Node_Str"+ config.get(Config.CONFIG_KEY_ROOT_DIR));
    }
 catch (    Exception e) {
      log(LogService.LOG_ERROR,"String_Node_Str",e);
    }
  }
}

Fixed version (ground truth):
@Override public void frameworkEvent(FrameworkEvent event){
  if (event.getType() == FrameworkEvent.STARTED) {
    if (config.getBoolean(Config.CONFIG_KEY_LOG_STDOUT))     new LogPrinter(context);
    sizeMap=new HashMap<File,Long>();
    File baseDir=new File(config.getString(Config.CONFIG_KEY_ROOT_DIR));
    try {
      FSHelper.validateFile(baseDir,false,true,false,true);
      if (port != Bootstrap.DISABLE_SCRIPTS_PORT) {
        shell=new ConsoleSocketListener(port,context,this,new CommandParser(context,new File(baseDir,Config.SCRIPT_DIRECTORY_NAME)));
        shell.start();
      }
 else {
        log(LogService.LOG_INFO,"String_Node_Str");
      }
      (new InitThread(baseDir,Arrays.asList(config.getString(Config.CONFIG_KEY_BUNDLE_DIRS).split("String_Node_Str")))).start();
      log(LogService.LOG_INFO,"String_Node_Str" + KNAPSACK_VERSION + "String_Node_Str"+ config.get(Config.CONFIG_KEY_ROOT_DIR));
    }
 catch (    Exception e) {
      log(LogService.LOG_ERROR,"String_Node_Str",e);
    }
  }
}
Program: 19530
Project: 19530
Buggy source:
private void addBasisAndUrePaths(ProcessBuilder processBuilder) throws IOException {
  File basisLink=new File(officeHome,"String_Node_Str");
  if (!basisLink.isFile()) {
    logger.fine("String_Node_Str");
    return;
  }
  String basisLinkText=FileUtils.readFileToString(basisLink).trim();
  File basisHome=new File(officeHome,basisLinkText);
  File basisProgram=new File(basisHome,"String_Node_Str");
  File ureLink=new File(basisHome,"String_Node_Str");
  String ureLinkText=FileUtils.readFileToString(ureLink).trim();
  File ureHome=new File(basisHome,ureLinkText);
  File ureBin=new File(ureHome,"String_Node_Str");
  Map<String,String> environment=processBuilder.environment();
  String pathKey="String_Node_Str";
  for (  String key : environment.keySet()) {
    if ("String_Node_Str".equalsIgnoreCase(key)) {
      pathKey=key;
    }
  }
  String path=environment.get(pathKey) + "String_Node_Str" + ureBin.getAbsolutePath()+ "String_Node_Str"+ basisProgram.getAbsolutePath();
  logger.fine(String.format("String_Node_Str",pathKey,path));
  environment.put(pathKey,path);
}

Fixed version (ground truth):
private void addBasisAndUrePaths(ProcessBuilder processBuilder) throws IOException {
  File ureBin=null;
  File basisProgram=null;
  File basisLink=new File(officeHome,"String_Node_Str");
  if (!basisLink.isFile()) {
    File ureLink=new File(officeHome,"String_Node_Str");
    if (!ureLink.isFile()) {
      logger.fine("String_Node_Str");
      return;
    }
    ureBin=new File(new File(officeHome,FileUtils.readFileToString(ureLink).trim()),"String_Node_Str");
  }
 else {
    String basisLinkText=FileUtils.readFileToString(basisLink).trim();
    File basisHome=new File(officeHome,basisLinkText);
    basisProgram=new File(basisHome,"String_Node_Str");
    File ureLink=new File(basisHome,"String_Node_Str");
    String ureLinkText=FileUtils.readFileToString(ureLink).trim();
    File ureHome=new File(basisHome,ureLinkText);
    ureBin=new File(ureHome,"String_Node_Str");
  }
  Map<String,String> environment=processBuilder.environment();
  String pathKey="String_Node_Str";
  for (  String key : environment.keySet()) {
    if ("String_Node_Str".equalsIgnoreCase(key)) {
      pathKey=key;
    }
  }
  String path=environment.get(pathKey) + "String_Node_Str" + ureBin.getAbsolutePath();
  if (basisProgram != null) {
    path+="String_Node_Str" + basisProgram.getAbsolutePath();
  }
  logger.fine(String.format("String_Node_Str",pathKey,path));
  environment.put(pathKey,path);
}
Program: 19531
Project: 19531
Buggy source:
protected void doUpdateDocumentIndexes(XComponent document){
  XTextDocument xDocument=cast(XTextDocument.class,document);
  if (xDocument != null) {
    XDocumentIndexesSupplier indexSupplier=cast(XDocumentIndexesSupplier.class,xDocument);
    XDocumentIndex index=null;
    if (indexSupplier != null) {
      XIndexAccess ia=indexSupplier.getDocumentIndexes();
      for (int i=0; i < ia.getCount(); i++) {
        Object idx=null;
        try {
          idx=ia.getByIndex(i);
          index=cast(XDocumentIndex.class,idx);
          if (index != null) {
            index.update();
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void doUpdateDocumentIndexes(XComponent document){
  XTextDocument xDocument=cast(XTextDocument.class,document);
  if (xDocument != null) {
    XDocumentIndexesSupplier indexSupplier=cast(XDocumentIndexesSupplier.class,xDocument);
    XDocumentIndex index=null;
    XRefreshable xRefreshable=cast(XRefreshable.class,document);
    if (xRefreshable != null) {
      xRefreshable.refresh();
    }
    if (indexSupplier != null) {
      XIndexAccess ia=indexSupplier.getDocumentIndexes();
      for (int i=0; i < ia.getCount(); i++) {
        Object idx=null;
        try {
          idx=ia.getByIndex(i);
          index=cast(XDocumentIndex.class,idx);
          if (index != null) {
            index.update();
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
  }
}
Program: 19534
Project: 19534
Buggy source:
/** 
 * <p class="changed_added_4_0"></p>
 * @return the value
 */
@TestMethodAnnotation("String_Node_Str") public String getSuperValue(){
  return this.value;
}

Fixed version (ground truth):
/** 
 * <p class="changed_added_4_0"> </p>
 * @return the value
 */
@TestMethodAnnotation("String_Node_Str") public String getSuperValue(){
  return this.value;
}
Program: 19535
Project: 19535
Buggy source:
/** 
 * <p class="changed_added_4_0"></p>
 * @param value the value to set
 */
public void setSuperValue(String value){
  this.value=value;
}

Fixed version (ground truth):
/** 
 * <p class="changed_added_4_0"> </p>
 * @param value the value to set
 */
public void setSuperValue(String value){
  this.value=value;
}
Program: 19536
Project: 19536
Buggy source:
public boolean available(){
  try {
    if (cachedLibrary != null) {
      return true;
    }
    if (cachingEnabled && getCacheFile().exists()) {
      load();
      return true;
    }
  }
 catch (  FileNotFoundException e) {
  }
catch (  Exception e) {
    cachingEnabled=false;
    log.warn("String_Node_Str" + getFilename() + "String_Node_Str",e);
  }
  return false;
}

Fixed version (ground truth):
public boolean available(){
  try {
    if (cachedLibrary != null) {
      return true;
    }
    if (cachingEnabled && getCacheFile().exists()) {
      load();
      return true;
    }
  }
 catch (  FileNotFoundException e) {
  }
catch (  Exception e) {
    cachingEnabled=false;
    log.info("String_Node_Str" + getFilename() + "String_Node_Str",e);
  }
  return false;
}
Program: 19537
Project: 19537
Buggy source:
public void save(ComponentLibrary library){
  try {
    byte[] bytes=SerializationUtils.serializeToBytes(library);
    fileManager.createOutput(getFilename(),System.currentTimeMillis());
    Files.write(bytes,getCacheFile());
  }
 catch (  IOException e) {
    throw new IllegalStateException("String_Node_Str" + getFilename(),e);
  }
}

Fixed version (ground truth):
public void save(ComponentLibrary library){
  try {
    byte[] bytes=SerializationUtils.serializeToBytes(library);
    try {
      fileManager.createOutput(getFilename(),System.currentTimeMillis());
      Files.write(bytes,getCacheFile());
    }
 catch (    IOException e) {
      log.warn("String_Node_Str" + getFilename(),e);
    }
  }
 catch (  Exception e) {
    log.warn("String_Node_Str",e);
  }
}
Program: 19538
Project: 19538
Buggy source:
private void createMethodContext(){
  this.currentStatement=new StatementsContainer();
  currentStatement.setVariable(FACES_CONTEXT_VARIABLE,getType(FacesContext.class));
  currentStatement.setVariable(RESPONSE_WRITER_VARIABLE,getType(ResponseWriter.class));
  currentStatement.setVariable(CLIENT_ID_VARIABLE,getType(String.class));
  currentStatement.setVariable(COMPONENT_VARIABLE,getComponentBaseClass());
  ELType generatedClassType=typesFactory.getType(generatedClass.getName());
  currentStatement.setVariable(THIS_VARIABLE,generatedClassType);
  ELType generatedClassSuperType=typesFactory.getType(generatedClass.getSuperClass().getName());
  currentStatement.setVariable(SUPER_VARIABLE,generatedClassSuperType);
}

Fixed version (ground truth):
private void createMethodContext(){
  this.currentStatement=new StatementsContainer();
  currentStatement.setVariable(FACES_CONTEXT_VARIABLE,getType(FacesContext.class));
  currentStatement.setVariable(RESPONSE_WRITER_VARIABLE,getType(ResponseWriter.class));
  currentStatement.setVariable(CLIENT_ID_VARIABLE,getType(String.class));
  currentStatement.setVariable(COMPONENT_VARIABLE,getType(UIComponent.class));
  ELType generatedClassType=typesFactory.getType(generatedClass.getName());
  currentStatement.setVariable(THIS_VARIABLE,generatedClassType);
  ELType generatedClassSuperType=typesFactory.getType(generatedClass.getSuperClass().getName());
  currentStatement.setVariable(SUPER_VARIABLE,generatedClassSuperType);
}
Program: 19540
Project: 19540
Buggy source:
public void scan() throws IOException {
  Collection<URL> urls=Sets.newHashSet();
  for (  VFSRoot cpFile : cpFiles) {
    if (cpFile.getType() == VFSType.zip) {
      if (cpFile.getChild("String_Node_Str") == null) {
        continue;
      }
    }
    URL url=cpFile.toURL();
    urls.add(url);
  }
  ConfigurationBuilder configurationBuilder=new ConfigurationBuilder().setUrls(urls);
  configurationBuilder.setScanners(new SubTypesScanner(),new TypeAnnotationsScanner(),new MarkerResourcesScanner()).useParallelExecutor();
  ReflectionsExt refl=new ReflectionsExt(configurationBuilder);
  Collection<Class<?>> allClasses=Sets.newHashSet();
  addAnnotatedClasses(DynamicResource.class,refl,allClasses);
  addAnnotatedClasses(DynamicUserResource.class,refl,allClasses);
  allClasses.addAll(refl.getMarkedClasses());
  allClasses=Collections2.filter(allClasses,UNINSTANTIATABLE_CLASSES_PREDICATE);
  resources.addAll(Collections2.transform(allClasses,RESOURCE_LOCATOR_FUNCTION));
  resources.addAll(resourceFactory.getMappedDynamicResourceKeys());
}

Fixed version (ground truth):
public void scan() throws IOException {
  Collection<URL> urls=Sets.newHashSet();
  for (  VFSRoot cpFile : cpFiles) {
    if (cpFile.getType() == VFSType.zip) {
      if (cpFile.getChild("String_Node_Str") == null) {
        continue;
      }
    }
    URL url=cpFile.toURL();
    urls.add(url);
  }
  ConfigurationBuilder configurationBuilder=new ConfigurationBuilder().setUrls(urls);
  configurationBuilder.setScanners(new SubTypesScanner(),new TypeAnnotationsScanner(),new MarkerResourcesScanner());
  ReflectionsExt refl=new ReflectionsExt(configurationBuilder);
  Collection<Class<?>> allClasses=Sets.newHashSet();
  addAnnotatedClasses(DynamicUserResource.class,refl,allClasses);
  allClasses.addAll(refl.getMarkedClasses());
  allClasses=Collections2.filter(allClasses,UNINSTANTIATABLE_CLASSES_PREDICATE);
  resources.addAll(Collections2.transform(allClasses,RESOURCE_LOCATOR_FUNCTION));
  resources.addAll(resourceFactory.getMappedDynamicResourceKeys());
}
Program: 19541
Project: 19541
Buggy source:
public void process(String resourceName,InputStream in,OutputStream out) throws IOException ;

Fixed version (ground truth):
public void process(String resourceName,InputSupplier<? extends InputStream> in,OutputSupplier<? extends OutputStream> out) throws IOException ;
Program: 19542
Project: 19542
Buggy source:
public JavaScriptResourceProcessor(Log log){
  super();
  this.log=log;
}

Fixed version (ground truth):
public JavaScriptResourceProcessor(Charset charset,Log log){
  this.charset=charset;
  this.log=log;
}
Program: 19543
Project: 19543
Buggy source:
public void endPrefixMapping(String prefix) throws SAXException {
  if (isEvaluatingContent()) {
    getContentHandler().endPrefixMapping(prefix);
    namespaces.remove(prefix);
  }
}

Fixed version (ground truth):
public void endPrefixMapping(String prefix) throws SAXException {
  if (isEvaluatingContent()) {
    String uri=namespaces.remove(prefix);
    if (!XINCLUDE_NAMESPACE_URI.equals(uri)) {
      getContentHandler().endPrefixMapping(prefix);
    }
  }
}
Program: 19545
Project: 19545
Buggy source:
protected void verifyEvents(ComponentLibrary library){
  for (  EventModel event : library.getEvents()) {
    ClassName listenerInterface=event.getListenerInterface();
    if (null == listenerInterface) {
    }
    event.setGenerateListener(null == sourceUtils.asTypeElement(listenerInterface));
    String methodName=event.getListenerMethod();
    if (null == methodName) {
      methodName="String_Node_Str";
      event.setListenerMethod(methodName);
    }
    ClassName sourceInterface=event.getSourceInterface();
    if (null == sourceInterface) {
    }
    event.setGenerateSource(null == sourceUtils.asTypeElement(sourceInterface));
    for (    ComponentModel component : library.getComponents()) {
      for (      EventModel componentEvent : component.getEvents()) {
        if (event.getType().equals(componentEvent.getType())) {
          componentEvent.merge(event);
        }
      }
    }
  }
}

Fixed version (ground truth):
protected void verifyEvents(ComponentLibrary library){
  for (  EventModel event : library.getEvents()) {
    ClassName listenerInterface=event.getListenerInterface();
    if (null == listenerInterface) {
    }
    SourceUtils sourceUtils=sourceUtilsProvider.get();
    event.setGenerateListener(null == sourceUtils.asTypeElement(listenerInterface));
    String methodName=event.getListenerMethod();
    if (null == methodName) {
      methodName="String_Node_Str";
      event.setListenerMethod(methodName);
    }
    ClassName sourceInterface=event.getSourceInterface();
    if (null == sourceInterface) {
    }
    event.setGenerateSource(null == sourceUtils.asTypeElement(sourceInterface));
    for (    ComponentModel component : library.getComponents()) {
      for (      EventModel componentEvent : component.getEvents()) {
        if (event.getType().equals(componentEvent.getType())) {
          componentEvent.merge(event);
        }
      }
    }
  }
}
Program: 19546
Project: 19546
Buggy source:
@Inject public ValidatorImpl(NamingConventions namingConventions,SourceUtils sourceUtils){
  this.namingConventions=namingConventions;
  this.sourceUtils=sourceUtils;
}

Fixed version (ground truth):
@Inject public ValidatorImpl(NamingConventions namingConventions,Provider<SourceUtils> sourceUtilsProvider){
  this.namingConventions=namingConventions;
  this.sourceUtilsProvider=sourceUtilsProvider;
}
Program: 19547
Project: 19547
Buggy source:
@Override public CompilationTask get() throws AptException {
  if (sourceFolders.getFiles().iterator().hasNext()) {
    Iterable<? extends JavaFileObject> sourceObjects=getFileManager().getJavaFileObjectsFromFiles(sourceFolders.getFiles());
    if (log.isDebugEnabled()) {
      compilerOptions.add("String_Node_Str");
    }
    CompilationTask task=getJavaCompiler().getTask(null,getFileManager(),diagnosticListener,compilerOptions,null,sourceObjects);
    task.setLocale(locale);
    task.setProcessors(Collections.singleton(cdkProcessor));
    return task;
  }
 else {
    return new CompilationTask(){
      @Override public void setProcessors(      Iterable<? extends Processor> processors){
      }
      @Override public void setLocale(      Locale locale){
      }
      @Override public Boolean call(){
        cdkProcessor.processNonJavaSources();
        return 0 == log.getErrorCount();
      }
    }
;
  }
}

Fixed version (ground truth):
@Override public CompilationTask get() throws AptException {
  if (sourceFolders.getFiles().iterator().hasNext()) {
    Iterable<? extends JavaFileObject> sourceObjects=getFileManager().getJavaFileObjectsFromFiles(sourceFolders.getFiles());
    if (log.isDebugEnabled()) {
      compilerOptions.add("String_Node_Str");
    }
    CompilationTask task=getJavaCompiler().getTask(null,getFileManager(),new DiagnosticListenerImplementation(log,locale),compilerOptions,null,sourceObjects);
    task.setLocale(locale);
    task.setProcessors(Collections.singleton(cdkProcessor));
    return task;
  }
 else {
    return new CompilationTask(){
      @Override public void setProcessors(      Iterable<? extends Processor> processors){
      }
      @Override public void setLocale(      Locale locale){
      }
      @Override public Boolean call(){
        cdkProcessor.processNonJavaSources();
        return 0 == log.getErrorCount();
      }
    }
;
  }
}
Program: 19548
Project: 19548
Buggy source:
private StandardJavaFileManager getFileManager(){
  if (fileManager == null) {
    fileManager=getJavaCompiler().getStandardFileManager(diagnosticListener,locale,charset);
    try {
      fileManager.setLocation(StandardLocation.CLASS_PATH,classPathLoader.getFiles());
      Iterable<File> outputFolders=outputFolder.getFolders();
      if (null != outputFolders) {
        Iterable<File> existedFolders=Iterables.filter(outputFolders,new Predicate<File>(){
          @Override public boolean apply(          File input){
            return input.exists();
          }
        }
);
        if (existedFolders.iterator().hasNext()) {
          fileManager.setLocation(StandardLocation.SOURCE_OUTPUT,outputFolders);
        }
      }
      fileManager.setLocation(StandardLocation.SOURCE_PATH,sourceFolders.getFolders());
    }
 catch (    IOException e) {
      throw new CdkException("String_Node_Str",e);
    }
  }
  return fileManager;
}

Fixed version (ground truth):
private StandardJavaFileManager getFileManager(){
  if (fileManager == null) {
    fileManager=getJavaCompiler().getStandardFileManager(new DiagnosticListenerImplementation(log,locale),locale,charset);
    try {
      fileManager.setLocation(StandardLocation.CLASS_PATH,classPathLoader.getFiles());
      Iterable<File> outputFolders=outputFolder.getFolders();
      if (null != outputFolders) {
        Iterable<File> existedFolders=Iterables.filter(outputFolders,new Predicate<File>(){
          @Override public boolean apply(          File input){
            return input.exists();
          }
        }
);
        if (existedFolders.iterator().hasNext()) {
          fileManager.setLocation(StandardLocation.SOURCE_OUTPUT,outputFolders);
        }
      }
      fileManager.setLocation(StandardLocation.SOURCE_PATH,sourceFolders.getFolders());
    }
 catch (    IOException e) {
      throw new CdkException("String_Node_Str",e);
    }
  }
  return fileManager;
}
Program: 19549
Project: 19549
Buggy source:
private ExpressionFactory createExpressionFactory(){
  return ExpressionFactoryImpl.newInstance();
}

Fixed version (ground truth):
private ExpressionFactory createExpressionFactory(){
  return new ExpressionFactoryImpl();
}
Program: 19551
Project: 19551
Buggy source:
@Override public void jobStateChange(StateEvent event){
  if (StateConditions.ACTIVE.test(event.getState())) {
    logger().info("String_Node_Str");
    action.set(new AsyncAction());
  }
}

Fixed version (ground truth):
@Override public void jobStateChange(StateEvent event){
  StateCondition condition=StateConditions.ACTIVE;
  if (condition.test(event.getState())) {
    logger().info("String_Node_Str");
    action.set(new AsyncAction());
  }
}
Program: 19552
Project: 19552
Buggy source:
@Override public void startBus() throws BusCrashException {
  if (started) {
    throw new IllegalStateException("String_Node_Str");
  }
  busConductor.fireBusStarting();
  started=true;
}

Fixed version (ground truth):
@Override public void startBus() throws BusCrashException {
  if (started) {
    throw new IllegalStateException("String_Node_Str");
  }
  try {
    busConductor.fireBusStarting();
  }
 catch (  BusCrashException e) {
    busConductor.fireBusCrashed(BusPhase.BUS_STARTING,e);
    busConductor.fireBusTerminated();
    throw e;
  }
  started=true;
}
Program: 19553
Project: 19553
Buggy source:
public Collection<? super Iterable<T>> getTo(){
  return to;
}

Fixed version (ground truth):
public Collection<? super Collection<T>> getTo(){
  return to;
}
Program: 19554
Project: 19554
Buggy source:
@Override public void setTo(Collection<? super Iterable<T>> next){
  this.to=next;
}

Fixed version (ground truth):
@Override public void setTo(Collection<? super Collection<T>> next){
  this.to=next;
}
Program: 19555
Project: 19555
Buggy source:
@Override public boolean add(Object bean){
  beans.add(bean);
  return true;
}

Fixed version (ground truth):
@Override public boolean add(Object bean){
  beans.add(bean);
  if (to != null) {
    to.add(bean);
  }
  return true;
}
Program: 19556
Project: 19556
Buggy source:
@Override public Class<?>[] wrappingInterfacesFor(Collection<?> wrapped){
  Set<Class<?>> interfaces=new HashSet<Class<?>>();
  interfaces.add(Object.class);
  interfaces.add(ArooaSessionAware.class);
  interfaces.add(ArooaLifeAware.class);
  interfaces.add(DynaBean.class);
  interfaces.add(LogEnabled.class);
  interfaces.add(Describeable.class);
  interfaces.add(Iconic.class);
  interfaces.add(BusPart.class);
  return (Class[])interfaces.toArray(new Class[interfaces.size()]);
}

Fixed version (ground truth):
@Override public Class<?>[] wrappingInterfacesFor(Collection<E> wrapped){
  Set<Class<?>> interfaces=new HashSet<Class<?>>();
  interfaces.add(Object.class);
  interfaces.add(ArooaSessionAware.class);
  interfaces.add(ArooaLifeAware.class);
  interfaces.add(DynaBean.class);
  interfaces.add(LogEnabled.class);
  interfaces.add(Describeable.class);
  interfaces.add(Iconic.class);
  interfaces.add(BusPart.class);
  interfaces.add(Collection.class);
  return (Class[])interfaces.toArray(new Class[interfaces.size()]);
}
Program: 19557
Project: 19557
Buggy source:
/** 
 * Generate the collection.
 * @param collection
 * @param classLoader
 * @return The collection.
 */
public Object generate(Collection<?> collection,ClassLoader classLoader){
  return generate(collection,new WrapperFactory<Collection<?>>(){
    @Override public Class<?>[] wrappingInterfacesFor(    Collection<?> wrapped){
      Set<Class<?>> interfaces=new HashSet<Class<?>>();
      interfaces.add(Object.class);
      interfaces.add(ArooaSessionAware.class);
      interfaces.add(ArooaLifeAware.class);
      interfaces.add(DynaBean.class);
      interfaces.add(LogEnabled.class);
      interfaces.add(Describeable.class);
      interfaces.add(Iconic.class);
      interfaces.add(BusPart.class);
      return (Class[])interfaces.toArray(new Class[interfaces.size()]);
    }
    @Override public ComponentWrapper wrapperFor(    Collection<?> wrapped,    Object proxy){
      CollectionWrapper wrapper=new CollectionWrapper(wrapped,proxy);
      return wrapper;
    }
  }
,classLoader);
}

Fixed version (ground truth):
/** 
 * Generate the collection.
 * @param collection
 * @param classLoader
 * @return The collection.
 */
public Object generate(Collection<E> collection,ClassLoader classLoader){
  return generate(collection,new WrapperFactory<Collection<E>>(){
    @Override public Class<?>[] wrappingInterfacesFor(    Collection<E> wrapped){
      Set<Class<?>> interfaces=new HashSet<Class<?>>();
      interfaces.add(Object.class);
      interfaces.add(ArooaSessionAware.class);
      interfaces.add(ArooaLifeAware.class);
      interfaces.add(DynaBean.class);
      interfaces.add(LogEnabled.class);
      interfaces.add(Describeable.class);
      interfaces.add(Iconic.class);
      interfaces.add(BusPart.class);
      interfaces.add(Collection.class);
      return (Class[])interfaces.toArray(new Class[interfaces.size()]);
    }
    @Override public ComponentWrapper wrapperFor(    Collection<E> wrapped,    Object proxy){
      CollectionWrapper<E> wrapper=new CollectionWrapper<E>(wrapped,proxy);
      return wrapper;
    }
  }
,classLoader);
}