Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Implemented
    • Affects Version/s: Trunk
    • Fix Version/s: Upcoming Release
    • Component/s: framework
    • Labels:
      None

      Description

      • LoginServices.java:118, DM_CONVERT_CASE
        Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.common.login.LoginServices.userLogin(DispatchContext, Map)

      A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

      String.toUpperCase( Locale l )
      String.toLowerCase( Locale l )
      versions instead.

      • LoginServices.java:161, DLS_DEAD_LOCAL_STORE
        DLS: Dead store to loginDisableMinutes in org.apache.ofbiz.common.login.LoginServices.userLogin(DispatchContext, Map)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

      • LoginServices.java:569, DLS_DEAD_LOCAL_STORE
        DLS: Dead store to resultMap in org.apache.ofbiz.common.login.LoginServices.createUserLogin(DispatchContext, Map)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

      • LoginServices.java:661, NP_LOAD_OF_KNOWN_NULL_VALUE
        NP: Load of known null value in org.apache.ofbiz.common.login.LoginServices.updatePassword(DispatchContext, Map)

      The variable referenced at this point is known to be null due to an earlier check against null. Although this is valid, it might be a mistake (perhaps you intended to refer to a different variable, or perhaps the earlier check to see if the variable is null should have been a check to see if it was non-null).

      • LoginServices.java:671, DM_CONVERT_CASE
        Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.common.login.LoginServices.updatePassword(DispatchContext, Map)

      A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

      String.toUpperCase( Locale l )
      String.toLowerCase( Locale l )
      versions instead.

      • LoginServices.java:733, DM_CONVERT_CASE
        Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.common.login.LoginServices.updateUserLoginId(DispatchContext, Map)

      A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

      String.toUpperCase( Locale l )
      String.toLowerCase( Locale l )
      versions instead.

      • LoginServices.java:906, RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE
        RCN: Nullcheck of userLogin at line 915 of value previously dereferenced in org.apache.ofbiz.common.login.LoginServices.checkNewPassword(GenericValue, String, String, String, String, List, boolean, Locale)

      A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous.

      • LoginServices.java:915, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE
        RCN: Redundant nullcheck of currentPassword, which is known to be non-null in org.apache.ofbiz.common.login.LoginServices.checkNewPassword(GenericValue, String, String, String, String, List, boolean, Locale)

      This method contains a redundant check of a known non-null value against the constant null.

      • LoginServices.java:988, DLS_DEAD_LOCAL_STORE
        DLS: Dead store to messageMap in org.apache.ofbiz.common.login.LoginServices.checkNewPassword(GenericValue, String, String, String, String, List, boolean, Locale)

      This instruction assigns a value to a local variable, but the value is not read or used in any subsequent instruction. Often, this indicates an error, because the value computed is never used.

      Note that Sun's javac compiler often generates dead stores for final local variables. Because FindBugs is a bytecode-based tool, there is no easy way to eliminate these false positives.

      • LoginServices.java:1002, DM_CONVERT_CASE
        Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.common.login.LoginServices.checkNewPassword(GenericValue, String, String, String, String, List, boolean, Locale)

      A String is being converted to upper or lowercase, using the platform's default encoding. This may result in improper conversions when used with international characters. Use the

      String.toUpperCase( Locale l )
      String.toLowerCase( Locale l )
      versions instead.

        Activity

        Hide
        Dennis Balkir Dennis Balkir added a comment -
        • Diamond Operators fixed
        • removed unnecessary else
        • Line 117: added a default Locale to toLowerCase
        • Line 568: resultMap is used in the lines after its declaration
        • Line 659: null was written into result. that was intended, but this way it’s easier to read
        • Line 670, 671, 672: added a default Locale to toLowerCase
        • Line 731: added a default Locale to toLowerCase
        • Line 912: removed {{userLogin != null && currentPassword != null && }} because both parameters cannot be null at this point
        • Line 939: removed {{ && userLogin != null}} because the parameter cannot be null at this point
        • Line 984: removed messageMap = UtilMisc.toMap("passwordPatternMessage", errMsg); as it’s never used anymore
        • Line 995: removed {{userLogin != null && }} because the parameter cannot be null at this point
        • Line 998: added default Locale to toUpperCase
        Show
        Dennis Balkir Dennis Balkir added a comment - Diamond Operators fixed removed unnecessary else Line 117: added a default Locale to toLowerCase Line 568: resultMap is used in the lines after its declaration Line 659: null was written into result . that was intended, but this way it’s easier to read Line 670, 671, 672: added a default Locale to toLowerCase Line 731: added a default Locale to toLowerCase Line 912: removed {{userLogin != null && currentPassword != null && }} because both parameters cannot be null at this point Line 939: removed {{ && userLogin != null}} because the parameter cannot be null at this point Line 984: removed messageMap = UtilMisc.toMap("passwordPatternMessage", errMsg); as it’s never used anymore Line 995: removed {{userLogin != null && }} because the parameter cannot be null at this point Line 998: added default Locale to toUpperCase
        Hide
        mbrohl Michael Brohl added a comment -

        Thanks Dennis,

        your patch is in trunk r1811424.

        Show
        mbrohl Michael Brohl added a comment - Thanks Dennis, your patch is in trunk r1811424.

          People

          • Assignee:
            mbrohl Michael Brohl
            Reporter:
            Dennis Balkir Dennis Balkir
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development