Program: 126107
Project: 126107
Buggy source:
/** 
 * DOC sgandon Comment method "activateTheProperPerspective".
 * @param mPerspStack, the stack to look for the perspecive to activate
 * @param initialSelectedPerspective, the perspective that was initialy selected
 */
private void activateTheProperPerspective(final MPerspectiveStack mPerspStack,MPerspective initialSelectedPerspective){
  if (mPerspStack != null) {
    MPerspective perspectiveToSelect=null;
    boolean firstTimeLaunch=wsPreferences.getBoolean(FIRST_TIME_LAUNCH_PREF,true);
    if (mPerspStack.getChildren().contains(initialSelectedPerspective) && !firstTimeLaunch) {
      perspectiveToSelect=initialSelectedPerspective;
    }
 else {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
        IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
        String defaultPerspectiveId=service.getBrandingConfiguration().getInitialWindowPerspectiveId();
        List<MPerspective> matchPerspectives=fModelService.findElements(mPerspStack,MPerspective.class,EModelService.IN_ACTIVE_PERSPECTIVE,new ElementMatcher(defaultPerspectiveId,null,(String)null));
        if (!matchPerspectives.isEmpty()) {
          perspectiveToSelect=matchPerspectives.get(0);
        }
      }
 else {
        if (!mPerspStack.getChildren().isEmpty()) {
          perspectiveToSelect=mPerspStack.getChildren().get(0);
        }
      }
    }
    if (perspectiveToSelect != null) {
      mPerspStack.setSelectedElement(perspectiveToSelect);
    }
 else {
      log.info("String_Node_Str");
    }
    wsPreferences.putBoolean(FIRST_TIME_LAUNCH_PREF,false);
  }
}

Fixed version (ground truth):
/** 
 * DOC sgandon Comment method "activateTheProperPerspective".
 * @param mPerspStack, the stack to look for the perspecive to activate
 * @param initialSelectedPerspective, the perspective that was initialy selected
 */
private void activateTheProperPerspective(final MPerspectiveStack mPerspStack,MPerspective initialSelectedPerspective){
  if (mPerspStack != null) {
    MPerspective perspectiveToSelect=null;
    boolean firstTimeLaunch=wsPreferences.getBoolean(FIRST_TIME_LAUNCH_PREF,true);
    if (mPerspStack.getChildren().contains(initialSelectedPerspective) && !firstTimeLaunch) {
      perspectiveToSelect=initialSelectedPerspective;
    }
 else {
      if (GlobalServiceRegister.getDefault().isServiceRegistered(IBrandingService.class)) {
        IBrandingService service=(IBrandingService)GlobalServiceRegister.getDefault().getService(IBrandingService.class);
        String defaultPerspectiveId=service.getBrandingConfiguration().getInitialWindowPerspectiveId();
        List<MPerspective> matchPerspectives=fModelService.findElements(mPerspStack,MPerspective.class,EModelService.IN_ANY_PERSPECTIVE,new ElementMatcher(defaultPerspectiveId,null,(String)null));
        if (!matchPerspectives.isEmpty()) {
          perspectiveToSelect=matchPerspectives.get(0);
        }
      }
 else {
        if (!mPerspStack.getChildren().isEmpty()) {
          perspectiveToSelect=mPerspStack.getChildren().get(0);
        }
      }
    }
    if (perspectiveToSelect != null) {
      mPerspStack.setSelectedElement(perspectiveToSelect);
    }
 else {
      log.info("String_Node_Str");
    }
    wsPreferences.putBoolean(FIRST_TIME_LAUNCH_PREF,false);
  }
}