Program: 45361
Project: 45361
Buggy source:
/** 
 * Display the correct security warning (access denied or the login screen).
 * @param iErrorCode
 */
public BaseScreen getSecurityScreen(int iErrorCode,BasePanel parentScreen){
  BaseScreen screen=null;
  if (iErrorCode == DBConstants.ACCESS_DENIED) {
    screen=new BaseScreen(null,null,parentScreen,null,0,null);
    String strDisplay=this.getTask().getApplication().getSecurityErrorText(iErrorCode);
    BaseApplication application=(BaseApplication)this.getTask().getApplication();
    String strMessage=application.getResources(ResourceConstants.ERROR_RESOURCE,true).getString(strDisplay);
    BaseField fldFake=new StringField(null,DBConstants.BLANK,128,DBConstants.BLANK,null);
    fldFake.setString(strMessage);
    new SStaticText(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL,ScreenConstants.ANCHOR_DEFAULT),screen,fldFake,ScreenConstants.DEFAULT_DISPLAY);
  }
 else   if ((iErrorCode == DBConstants.LOGIN_REQUIRED) || (iErrorCode == DBConstants.AUTHENTICATION_REQUIRED)) {
    Record record=Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS,null);
    ScreenLocation itsLocation=this.getScreenLocation();
    int docMode=record.commandToDocType(UserInfoModel.LOGIN_SCREEN);
    Map<String,Object> properties=null;
    screen=(BaseScreen)record.makeScreen(itsLocation,parentScreen,docMode,properties);
  }
 else   if (iErrorCode == DBConstants.CREATE_USER_REQUIRED) {
    Record record=Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS,null);
    ScreenLocation itsLocation=this.getScreenLocation();
    int docMode=record.commandToDocType(UserInfoModel.ENTRY_SCREEN);
    Map<String,Object> properties=null;
    screen=(BaseScreen)record.makeScreen(itsLocation,parentScreen,docMode,properties);
  }
  return screen;
}

Fixed version (ground truth):
/** 
 * Display the correct security warning (access denied or the login screen).
 * @param iErrorCode
 */
public BaseScreen getSecurityScreen(int iErrorCode,BasePanel parentScreen){
  BaseScreen screen=null;
  if (iErrorCode == DBConstants.ACCESS_DENIED) {
    screen=new BaseScreen(null,null,parentScreen,null,0,null);
    String strDisplay=this.getTask().getApplication().getSecurityErrorText(iErrorCode);
    BaseApplication application=(BaseApplication)this.getTask().getApplication();
    String strMessage=application.getResources(ResourceConstants.ERROR_RESOURCE,true).getString(strDisplay);
    BaseField fldFake=new StringField(null,DBConstants.BLANK,128,DBConstants.BLANK,null);
    fldFake.setString(strMessage);
    new SStaticText(screen.getNextLocation(ScreenConstants.NEXT_LOGICAL,ScreenConstants.ANCHOR_DEFAULT),screen,fldFake,ScreenConstants.DEFAULT_DISPLAY);
  }
 else   if ((iErrorCode == DBConstants.LOGIN_REQUIRED) || (iErrorCode == DBConstants.AUTHENTICATION_REQUIRED)) {
    Record record=Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS,Utility.getRecordOwner(parentScreen));
    ScreenLocation itsLocation=this.getScreenLocation();
    int docMode=record.commandToDocType(UserInfoModel.LOGIN_SCREEN);
    Map<String,Object> properties=null;
    screen=(BaseScreen)record.makeScreen(itsLocation,parentScreen,docMode,properties);
  }
 else   if (iErrorCode == DBConstants.CREATE_USER_REQUIRED) {
    Record record=Record.makeRecordFromClassName(UserInfoModel.THICK_CLASS,null);
    ScreenLocation itsLocation=this.getScreenLocation();
    int docMode=record.commandToDocType(UserInfoModel.ENTRY_SCREEN);
    Map<String,Object> properties=null;
    screen=(BaseScreen)record.makeScreen(itsLocation,parentScreen,docMode,properties);
  }
  return screen;
}