Uploaded image for project: 'Ranger'
  1. Ranger
  2. RANGER-1431

Do some code improvement in Java method AuthSessionService.mapEntityToViewBean

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: 1.0.0, 0.7.1
    • Component/s: admin
    • Labels:
    • Flags:
      Patch

      Description

      In method mapEntityToViewBean of class \security-admin\src\main\java\org\apache\ranger\service\AuthSessionService.java,
      there is some code can be improved:
      1.The following code is repated twice, remove one of them.

      viewObj.setLastName(gjUser.getLastName());
      

      2.Check null before using gjUser.

      XXPortalUser gjUser = daoMgr.getXXPortalUser().getById(resource.getUserId());
      

      3.Family name should be last name instead of email address.

      viewObj.setFamilyScreenName(gjUser.getEmailAddress());
      

        Attachments

          Activity

            People

            • Assignee:
              zhangqiang2 Qiang Zhang
              Reporter:
              zhangqiang2 Qiang Zhang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 12h
                12h
                Remaining:
                Remaining Estimate - 12h
                12h
                Logged:
                Time Spent - Not Specified
                Not Specified