Program: 32248
Project: 32248
Buggy source:
private void createRemoteDisplay(final Display disp){
  try {
    if (disp == null) {
      return;
    }
    if (remoteDisplay != null && remoteDisplay.getDisplay() != disp) {
      remoteDisplay.dismissPresentation();
    }
    FutureTask<Boolean> fTask=new FutureTask<Boolean>(new SdlRemoteDisplay.Creator(context,disp,remoteDisplay,remoteDisplayClass,new SdlRemoteDisplay.Callback(){
      @Override public void onCreated(      final SdlRemoteDisplay remoteDisplay){
        VideoStreamingManager.this.remoteDisplay=remoteDisplay;
        remoteDisplay.getMainView().post(new Runnable(){
          @Override public void run(){
            hapticManager.refreshHapticData(remoteDisplay.getMainView());
          }
        }
);
        ImageResolution resolution=null;
        if (getWiProVersion() >= 5) {
          VideoStreamingCapability capability=(VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
          resolution=capability.getPreferredResolution();
        }
 else {
          DisplayCapabilities dispCap=(DisplayCapabilities)_systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
          if (dispCap != null) {
            resolution=(dispCap.getScreenParams().getImageResolution());
          }
        }
        if (resolution != null) {
          DisplayMetrics displayMetrics=new DisplayMetrics();
          disp.getMetrics(displayMetrics);
          touchScalar[0]=((float)displayMetrics.widthPixels) / resolution.getResolutionWidth();
          touchScalar[1]=((float)displayMetrics.heightPixels) / resolution.getResolutionHeight();
        }
      }
      @Override public void onInvalidated(      final SdlRemoteDisplay remoteDisplay){
        remoteDisplay.getMainView().post(new Runnable(){
          @Override public void run(){
            hapticManager.refreshHapticData(remoteDisplay.getMainView());
          }
        }
);
      }
    }
));
    Thread showPresentation=new Thread(fTask);
    showPresentation.start();
  }
 catch (  Exception ex) {
    Log.e(TAG,"String_Node_Str");
  }
}

Fixed version (ground truth):
private void createRemoteDisplay(final Display disp){
  try {
    if (disp == null) {
      return;
    }
    if (remoteDisplay != null && remoteDisplay.getDisplay() != disp) {
      remoteDisplay.dismissPresentation();
    }
    FutureTask<Boolean> fTask=new FutureTask<Boolean>(new SdlRemoteDisplay.Creator(context,disp,remoteDisplay,remoteDisplayClass,new SdlRemoteDisplay.Callback(){
      @Override public void onCreated(      final SdlRemoteDisplay remoteDisplay){
        VideoStreamingManager.this.remoteDisplay=remoteDisplay;
        if (hapticManager != null) {
          remoteDisplay.getMainView().post(new Runnable(){
            @Override public void run(){
              hapticManager.refreshHapticData(remoteDisplay.getMainView());
            }
          }
);
        }
        ImageResolution resolution=null;
        if (getWiProVersion() >= 5) {
          VideoStreamingCapability capability=(VideoStreamingCapability)_systemCapabilityManager.getCapability(SystemCapabilityType.VIDEO_STREAMING);
          resolution=capability.getPreferredResolution();
        }
 else {
          DisplayCapabilities dispCap=(DisplayCapabilities)_systemCapabilityManager.getCapability(SystemCapabilityType.DISPLAY);
          if (dispCap != null) {
            resolution=(dispCap.getScreenParams().getImageResolution());
          }
        }
        if (resolution != null) {
          DisplayMetrics displayMetrics=new DisplayMetrics();
          disp.getMetrics(displayMetrics);
          touchScalar[0]=((float)displayMetrics.widthPixels) / resolution.getResolutionWidth();
          touchScalar[1]=((float)displayMetrics.heightPixels) / resolution.getResolutionHeight();
        }
      }
      @Override public void onInvalidated(      final SdlRemoteDisplay remoteDisplay){
        if (hapticManager != null) {
          remoteDisplay.getMainView().post(new Runnable(){
            @Override public void run(){
              hapticManager.refreshHapticData(remoteDisplay.getMainView());
            }
          }
);
        }
      }
    }
));
    Thread showPresentation=new Thread(fTask);
    showPresentation.start();
  }
 catch (  Exception ex) {
    Log.e(TAG,"String_Node_Str");
  }
}