Details

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

      Description

      FlexibleStringExpanderTests.java:196, NP_LOAD_OF_KNOWN_NULL_VALUE
      NP: Load of known null value in org.apache.ofbiz.base.util.string.test.FlexibleStringExpanderTests.fseTest(String, String, Map, TimeZone, Locale, String, Object, boolean)

      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).

      • FlexibleStringExpanderTests.java:209, NM_METHOD_NAMING_CONVENTION
        Nm: The method name org.apache.ofbiz.base.util.string.test.FlexibleStringExpanderTests.StaticReturnNull() doesn't start with a lower case letter

      Methods should be verbs, in mixed case with the first letter lowercase, with the first letter of each internal word capitalized.

      • FlexibleStringExpanderTests.java:226, NM_CLASS_NOT_EXCEPTION
        Nm: Class org.apache.ofbiz.base.util.string.test.FlexibleStringExpanderTests$ThrowException is not derived from an Exception, even though it is named as such

      This class is not derived from another exception, but ends with 'Exception'. This will be confusing to users of this class.

      • FlexibleStringExpanderTests.java:251, SE_NO_SERIALVERSIONID
        SnVI: org.apache.ofbiz.base.util.string.test.FlexibleStringExpanderTests$SpecialNumber is Serializable; consider declaring a serialVersionUID

      This class implements the Serializable interface, but does not define a serialVersionUID field. A change as simple as adding a reference to a .class object will add synthetic fields to the class, which will unfortunately change the implicit serialVersionUID (e.g., adding a reference to String.class will generate a static field class$java$lang$String). Also, different source code to bytecode compilers may use different naming conventions for synthetic variables generated for references to class objects or inner classes. To ensure interoperability of Serializable across versions, consider adding an explicit serialVersionUID.

        Activity

        Hide
        mbrohl Michael Brohl added a comment -

        Thanks Dennis,

        your patch is in trunk r1811418.

        Show
        mbrohl Michael Brohl added a comment - Thanks Dennis, your patch is in trunk r1811418.
        Hide
        Dennis Balkir Dennis Balkir added a comment -
        • Diamond Operators fixed
        • Line 196: didn’t do anything, was intended as it is
        • Line 209: changed the name from StaticReturnNull to staticReturnNull
        • Line 226: class ThrowException is now derived from Exception just to prevent confusion
        • Line 251: didn’t do anything; class SpecialNumber is Serializable, but implementing serialVersionUID is not necessary
        Show
        Dennis Balkir Dennis Balkir added a comment - Diamond Operators fixed Line 196: didn’t do anything, was intended as it is Line 209: changed the name from StaticReturnNull to staticReturnNull Line 226: class ThrowException is now derived from Exception just to prevent confusion Line 251: didn’t do anything; class SpecialNumber is Serializable, but implementing serialVersionUID is not necessary

          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