Details

      Description

      ServiceEcaAction.java:43, SE_NO_SERIALVERSIONID

      • SnVI: org.apache.ofbiz.service.eca.ServiceEcaAction 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.

      ServiceEcaAction.java:237, HE_EQUALS_USE_HASHCODE

      • HE: org.apache.ofbiz.service.eca.ServiceEcaAction defines equals and uses Object.hashCode()

      This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

      If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

      public int hashCode()

      { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }

      ServiceEcaCondition.java:42, SE_NO_SERIALVERSIONID

      • SnVI: org.apache.ofbiz.service.eca.ServiceEcaCondition 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.

      ServiceEcaCondition.java:78, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of org.apache.ofbiz.service.eca.ServiceEcaCondition.lhsValueName, which is known to be non-null in new org.apache.ofbiz.service.eca.ServiceEcaCondition(Element, boolean, boolean)

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

      ServiceEcaCondition.java:81, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE

      • RCN: Redundant nullcheck of org.apache.ofbiz.service.eca.ServiceEcaCondition.rhsValueName, which is known to be non-null in new org.apache.ofbiz.service.eca.ServiceEcaCondition(Element, boolean, boolean)

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

      ServiceEcaCondition.java:219, HE_EQUALS_USE_HASHCODE

      • HE: org.apache.ofbiz.service.eca.ServiceEcaCondition defines equals and uses Object.hashCode()

      This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

      If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

      public int hashCode()

      { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE, Priorit├Ąt: Niedrig
      CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.actionsAndSets

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.enabled

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.runOnFailure

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.serviceName

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.runOnError

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.conditions

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.definitionLocation

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:-1, CI_CONFUSED_INHERITANCE

      • CI: Class org.apache.ofbiz.service.eca.ServiceEcaRule is final but declares protected field org.apache.ofbiz.service.eca.ServiceEcaRule.eventName

      This class is declared to be final, but declares fields to be protected. Since the class is final, it can not be derived from, and the use of protected is confusing. The access modifier for the field should be changed to private or public to represent the true use for the field.

      ServiceEcaRule.java:41, SE_NO_SERIALVERSIONID

      • SnVI: org.apache.ofbiz.service.eca.ServiceEcaRule 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.

      ServiceEcaRule.java:181, HE_EQUALS_USE_HASHCODE

      • HE: org.apache.ofbiz.service.eca.ServiceEcaRule defines equals and uses Object.hashCode()

      This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

      If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

      public int hashCode()

      { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }

      ServiceEcaSetField.java:109, DM_CONVERT_CASE

      • Dm: Use of non-localized String.toUpperCase() or String.toLowerCase() in org.apache.ofbiz.service.eca.ServiceEcaSetField.format(String, 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.

      ServiceEcaSetField.java:144, HE_EQUALS_USE_HASHCODE

      • HE: org.apache.ofbiz.service.eca.ServiceEcaSetField defines equals and uses Object.hashCode()

      This class overrides equals(Object), but does not override hashCode(), and inherits the implementation of hashCode() from java.lang.Object (which returns the identity hash code, an arbitrary value assigned to the object by the VM). Therefore, the class is very likely to violate the invariant that equal objects must have equal hashcodes.

      If you don't think instances of this class will ever be inserted into a HashMap/HashTable, the recommended hashCode implementation to use is:

      public int hashCode()

      { assert false : "hashCode not designed"; return 42; // any arbitrary constant will do }

      ServiceEcaUtil.java:156, NP_NULL_ON_SOME_PATH

      • NP: Possible null pointer dereference of ServiceEcaUtil.ecaCache in org.apache.ofbiz.service.eca.ServiceEcaUtil.getServiceEventMap(String)

      There is a branch of statement that, if executed, guarantees that a null value will be dereferenced, which would generate a NullPointerException when the code is executed. Of course, the problem might be that the branch or statement is infeasible and that the null pointer exception can't ever be executed; deciding that is beyond the ability of FindBugs.

        Activity

        Hide
        jleichert Julian Leichert added a comment -

        All Classes

        • Added hashCode() Overrides

        class ServiceEcaCondition

        • removed redundant null check

        class ServiceEcaRule

        • changed multiple protected to public

        class ServiceEcaSetField

        • added String Encoding
        Show
        jleichert Julian Leichert added a comment - All Classes Added hashCode() Overrides class ServiceEcaCondition removed redundant null check class ServiceEcaRule changed multiple protected to public class ServiceEcaSetField added String Encoding
        Hide
        mbrohl Michael Brohl added a comment -

        Thanks Julian,

        your patch is in trunk r1812897.

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

          People

          • Assignee:
            mbrohl Michael Brohl
            Reporter:
            jleichert Julian Leichert
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development