Program: 150580
Project: 150580
Buggy source:
/** 
 * Tries to open a   {@link CameraDevice}. The result is listened by `mStateCallback`.
 */
@SuppressWarnings("String_Node_Str") protected void openCamera(int widthTexture,int heightTexture){
  if (verbose)   Log.i(TAG,"String_Node_Str" + widthTexture + "String_Node_Str"+ heightTexture+ "String_Node_Str");
  if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (isFinishing()) {
    return;
  }
  CameraManager manager=(CameraManager)getSystemService(Context.CAMERA_SERVICE);
  if (manager == null)   throw new RuntimeException("String_Node_Str");
  this.viewWidth=widthTexture;
  this.viewHeight=heightTexture;
  this.cameraToDisplayDensity=0;
  this.firstFrame=true;
  boolean releaseCamera=true;
  try {
    if (verbose)     Log.d(TAG,"String_Node_Str");
    if (!open.mLock.tryLock(2500,TimeUnit.MILLISECONDS)) {
      throw new RuntimeException("String_Node_Str");
    }
    if (mBackgroundHandler == null) {
      if (verbose)       Log.i(TAG,"String_Node_Str");
      return;
    }
    if (open.mCameraDevice != null) {
      throw new RuntimeException("String_Node_Str");
    }
    String[] cameras=manager.getCameraIdList();
    for (    String cameraId : cameras) {
      CameraCharacteristics characteristics=manager.getCameraCharacteristics(cameraId);
      if (!selectCamera(cameraId,characteristics))       continue;
      StreamConfigurationMap map=characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
      if (map == null) {
        continue;
      }
      Size[] sizes=map.getOutputSizes(ImageFormat.YUV_420_888);
      int which=selectResolution(widthTexture,heightTexture,sizes);
      if (which < 0 || which >= sizes.length)       continue;
      open.mCameraSize=sizes[which];
      open.cameraId=cameraId;
      open.mSensorOrientation=characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
      this.cameraToDisplayDensity=displayDensityAdjusted();
      if (verbose)       Log.i(TAG,"String_Node_Str" + cameraId + "String_Node_Str"+ open.mSensorOrientation);
      open.mCameraCharacterstics=characteristics;
      onCameraResolutionChange(open.mCameraSize.getWidth(),open.mCameraSize.getHeight(),open.mSensorOrientation);
      try {
        mPreviewReader=ImageReader.newInstance(open.mCameraSize.getWidth(),open.mCameraSize.getHeight(),ImageFormat.YUV_420_888,2);
        mPreviewReader.setOnImageAvailableListener(onAvailableListener,mBackgroundHandler);
        configureTransform(widthTexture,heightTexture);
        manager.openCamera(cameraId,mStateCallback,null);
        releaseCamera=false;
      }
 catch (      IllegalArgumentException e) {
        Toast.makeText(this,e.getMessage(),Toast.LENGTH_LONG).show();
        finish();
      }
      return;
    }
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
  }
 catch (  CameraAccessException e) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    finish();
  }
catch (  NullPointerException e) {
    e.printStackTrace();
    Log.e(TAG,"String_Node_Str");
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
  }
catch (  InterruptedException e) {
    throw new RuntimeException("String_Node_Str");
  }
 finally {
    if (releaseCamera)     open.mLock.unlock();
  }
}

Fixed version (ground truth):
/** 
 * Tries to open a   {@link CameraDevice}. The result is listened by `mStateCallback`.
 */
@SuppressWarnings("String_Node_Str") protected void openCamera(int widthTexture,int heightTexture){
  if (verbose)   Log.i(TAG,"String_Node_Str" + widthTexture + "String_Node_Str"+ heightTexture+ "String_Node_Str");
  if (Looper.getMainLooper().getThread() != Thread.currentThread()) {
    throw new RuntimeException("String_Node_Str");
  }
  if (isFinishing()) {
    return;
  }
  CameraManager manager=(CameraManager)getSystemService(Context.CAMERA_SERVICE);
  if (manager == null)   throw new RuntimeException("String_Node_Str");
  this.viewWidth=widthTexture;
  this.viewHeight=heightTexture;
  this.cameraToDisplayDensity=0;
  this.firstFrame=true;
  boolean releaseCamera=true;
  try {
    if (verbose)     Log.d(TAG,"String_Node_Str");
    if (!open.mLock.tryLock(2500,TimeUnit.MILLISECONDS)) {
      throw new RuntimeException("String_Node_Str");
    }
    if (open.state != CameraState.CLOSED) {
      throw new RuntimeException("String_Node_Str");
    }
 else {
      open.state=CameraState.OPENING;
    }
    if (mBackgroundHandler == null) {
      if (verbose)       Log.i(TAG,"String_Node_Str");
      return;
    }
    if (open.mCameraDevice != null) {
      throw new RuntimeException("String_Node_Str");
    }
    String[] cameras=manager.getCameraIdList();
    for (    String cameraId : cameras) {
      CameraCharacteristics characteristics=manager.getCameraCharacteristics(cameraId);
      if (!selectCamera(cameraId,characteristics))       continue;
      StreamConfigurationMap map=characteristics.get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP);
      if (map == null) {
        continue;
      }
      Size[] sizes=map.getOutputSizes(ImageFormat.YUV_420_888);
      int which=selectResolution(widthTexture,heightTexture,sizes);
      if (which < 0 || which >= sizes.length)       continue;
      open.mCameraSize=sizes[which];
      open.cameraId=cameraId;
      open.mSensorOrientation=characteristics.get(CameraCharacteristics.SENSOR_ORIENTATION);
      this.cameraToDisplayDensity=displayDensityAdjusted();
      if (verbose)       Log.i(TAG,"String_Node_Str" + cameraId + "String_Node_Str"+ open.mSensorOrientation);
      open.mCameraCharacterstics=characteristics;
      onCameraResolutionChange(open.mCameraSize.getWidth(),open.mCameraSize.getHeight(),open.mSensorOrientation);
      try {
        mPreviewReader=ImageReader.newInstance(open.mCameraSize.getWidth(),open.mCameraSize.getHeight(),ImageFormat.YUV_420_888,2);
        mPreviewReader.setOnImageAvailableListener(onAvailableListener,mBackgroundHandler);
        configureTransform(widthTexture,heightTexture);
        manager.openCamera(cameraId,mStateCallback,null);
        releaseCamera=false;
      }
 catch (      IllegalArgumentException e) {
        Toast.makeText(this,e.getMessage(),Toast.LENGTH_LONG).show();
        finish();
      }
      return;
    }
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
  }
 catch (  CameraAccessException e) {
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_SHORT).show();
    finish();
  }
catch (  NullPointerException e) {
    e.printStackTrace();
    Log.e(TAG,"String_Node_Str");
    Toast.makeText(this,"String_Node_Str",Toast.LENGTH_LONG).show();
    finish();
  }
catch (  InterruptedException e) {
    throw new RuntimeException("String_Node_Str");
  }
 finally {
    if (releaseCamera)     open.mLock.unlock();
  }
}