Program: 95053
Project: 95053
Buggy source:
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_flight);
  fragmentManager=getSupportFragmentManager();
  mSlidingPanel=(SlidingUpPanelLayout)findViewById(R.id.slidingPanelContainer);
  enableSlidingUpPanel(this.drone);
  warningView=(TextView)findViewById(R.id.failsafeTextView);
  final SlidingDrawer slidingDrawer=(SlidingDrawer)findViewById(R.id.slidingDrawerRight);
  if (slidingDrawer != null) {
    slidingDrawer.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener(){
      @Override public void onDrawerClosed(){
        final int slidingDrawerWidth=slidingDrawer.getContent().getWidth();
        final boolean isSlidingDrawerOpened=slidingDrawer.isOpened();
        updateLocationButtonsMargin(isSlidingDrawerOpened,slidingDrawerWidth);
      }
    }
);
    slidingDrawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener(){
      @Override public void onDrawerOpened(){
        final int slidingDrawerWidth=slidingDrawer.getContent().getWidth();
        final boolean isSlidingDrawerOpened=slidingDrawer.isOpened();
        updateLocationButtonsMargin(isSlidingDrawerOpened,slidingDrawerWidth);
      }
    }
);
  }
  setupMapFragment();
  mLocationButtonsContainer=findViewById(R.id.location_button_container);
  mGoToMyLocation=(ImageButton)findViewById(R.id.my_location_button);
  mGoToDroneLocation=(ImageButton)findViewById(R.id.drone_location_button);
  final ImageButton resetMapBearing=(ImageButton)findViewById(R.id.map_orientation_button);
  resetMapBearing.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.updateMapBearing(0);
      }
    }
  }
);
  mGoToMyLocation.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToMyLocation();
        updateMapLocationButtons(AutoPanMode.DISABLED);
      }
    }
  }
);
  mGoToMyLocation.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToMyLocation();
        updateMapLocationButtons(AutoPanMode.USER);
        return true;
      }
      return false;
    }
  }
);
  mGoToDroneLocation.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToDroneLocation();
        updateMapLocationButtons(AutoPanMode.DISABLED);
      }
    }
  }
);
  mGoToDroneLocation.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToDroneLocation();
        updateMapLocationButtons(AutoPanMode.DRONE);
        return true;
      }
      return false;
    }
  }
);
  Fragment flightActions=fragmentManager.findFragmentById(R.id.flightActionsFragment);
  if (flightActions == null) {
    flightActions=new FlightActionsFragment();
    fragmentManager.beginTransaction().add(R.id.flightActionsFragment,flightActions).commit();
  }
  mFlightActionsView=findViewById(R.id.flightActionsFragment);
  mFlightActionsView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (!mSlidingPanelCollapsing.get()) {
        mSlidingPanel.setPanelHeight(mFlightActionsView.getHeight());
      }
    }
  }
);
  Fragment telemetryFragment=fragmentManager.findFragmentById(R.id.telemetryFragment);
  if (telemetryFragment == null) {
    telemetryFragment=new TelemetryFragment();
    fragmentManager.beginTransaction().add(R.id.telemetryFragment,telemetryFragment).commit();
  }
  Fragment flightModePanel=fragmentManager.findFragmentById(R.id.sliding_drawer_content);
  if (flightModePanel == null) {
    flightModePanel=new FlightModePanel();
    fragmentManager.beginTransaction().add(R.id.sliding_drawer_content,flightModePanel).commit();
  }
  DroneshareDialog.perhapsShow(this);
}

Fixed version (ground truth):
@Override public void onCreate(Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_flight);
  fragmentManager=getSupportFragmentManager();
  mSlidingPanel=(SlidingUpPanelLayout)findViewById(R.id.slidingPanelContainer);
  enableSlidingUpPanel(this.drone);
  warningView=(TextView)findViewById(R.id.failsafeTextView);
  final SlidingDrawer slidingDrawer=(SlidingDrawer)findViewById(R.id.slidingDrawerRight);
  if (slidingDrawer != null) {
    slidingDrawer.setOnDrawerCloseListener(new SlidingDrawer.OnDrawerCloseListener(){
      @Override public void onDrawerClosed(){
        final int slidingDrawerWidth=slidingDrawer.getContent().getWidth();
        final boolean isSlidingDrawerOpened=slidingDrawer.isOpened();
        updateLocationButtonsMargin(isSlidingDrawerOpened,slidingDrawerWidth);
      }
    }
);
    slidingDrawer.setOnDrawerOpenListener(new SlidingDrawer.OnDrawerOpenListener(){
      @Override public void onDrawerOpened(){
        final int slidingDrawerWidth=slidingDrawer.getContent().getWidth();
        final boolean isSlidingDrawerOpened=slidingDrawer.isOpened();
        updateLocationButtonsMargin(isSlidingDrawerOpened,slidingDrawerWidth);
      }
    }
);
  }
  setupMapFragment();
  mLocationButtonsContainer=findViewById(R.id.location_button_container);
  mGoToMyLocation=(ImageButton)findViewById(R.id.my_location_button);
  mGoToDroneLocation=(ImageButton)findViewById(R.id.drone_location_button);
  final ImageButton resetMapBearing=(ImageButton)findViewById(R.id.map_orientation_button);
  resetMapBearing.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.updateMapBearing(0);
      }
    }
  }
);
  mGoToMyLocation.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToMyLocation();
        updateMapLocationButtons(AutoPanMode.DISABLED);
      }
    }
  }
);
  mGoToMyLocation.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToMyLocation();
        updateMapLocationButtons(AutoPanMode.USER);
        return true;
      }
      return false;
    }
  }
);
  mGoToDroneLocation.setOnClickListener(new View.OnClickListener(){
    @Override public void onClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToDroneLocation();
        updateMapLocationButtons(AutoPanMode.DISABLED);
      }
    }
  }
);
  mGoToDroneLocation.setOnLongClickListener(new View.OnLongClickListener(){
    @Override public boolean onLongClick(    View v){
      if (mapFragment != null) {
        mapFragment.goToDroneLocation();
        updateMapLocationButtons(AutoPanMode.DRONE);
        return true;
      }
      return false;
    }
  }
);
  flightActions=(FlightActionsFragment)fragmentManager.findFragmentById(R.id.flightActionsFragment);
  if (flightActions == null) {
    flightActions=new FlightActionsFragment();
    fragmentManager.beginTransaction().add(R.id.flightActionsFragment,flightActions).commit();
  }
  mFlightActionsView=findViewById(R.id.flightActionsFragment);
  mFlightActionsView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener(){
    @Override public void onGlobalLayout(){
      if (!mSlidingPanelCollapsing.get()) {
        mSlidingPanel.setPanelHeight(mFlightActionsView.getHeight());
      }
    }
  }
);
  Fragment telemetryFragment=fragmentManager.findFragmentById(R.id.telemetryFragment);
  if (telemetryFragment == null) {
    telemetryFragment=new TelemetryFragment();
    fragmentManager.beginTransaction().add(R.id.telemetryFragment,telemetryFragment).commit();
  }
  Fragment flightModePanel=fragmentManager.findFragmentById(R.id.sliding_drawer_content);
  if (flightModePanel == null) {
    flightModePanel=new FlightModePanel();
    fragmentManager.beginTransaction().add(R.id.sliding_drawer_content,flightModePanel).commit();
  }
  DroneshareDialog.perhapsShow(this);
}