Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E4063200CF0 for ; Thu, 7 Sep 2017 13:13:45 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E2DB21609DB; Thu, 7 Sep 2017 11:13:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DCA821609A7 for ; Thu, 7 Sep 2017 13:13:44 +0200 (CEST) Received: (qmail 77628 invoked by uid 500); 7 Sep 2017 11:13:42 -0000 Mailing-List: contact notifications-help@ofbiz.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ofbiz.apache.org Delivered-To: mailing list notifications@ofbiz.apache.org Received: (qmail 77619 invoked by uid 99); 7 Sep 2017 11:13:42 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2017 11:13:42 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 374CE18C992 for ; Thu, 7 Sep 2017 11:13:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id pHX-fDwlA3sI for ; Thu, 7 Sep 2017 11:13:35 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 2455B5FAC9 for ; Thu, 7 Sep 2017 11:13:35 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5562CE0059 for ; Thu, 7 Sep 2017 10:56:20 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 0CC7B24137 for ; Thu, 7 Sep 2017 10:56:00 +0000 (UTC) Date: Thu, 7 Sep 2017 10:56:00 +0000 (UTC) From: "Julian Leichert (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (OFBIZ-9683) [FB] Package org.apache.ofbiz.service.eca MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 07 Sep 2017 11:13:46 -0000 Julian Leichert created OFBIZ-9683: -------------------------------------- Summary: [FB] Package org.apache.ofbiz.service.eca Key: OFBIZ-9683 URL: https://issues.apache.org/jira/browse/OFBIZ-9683 Project: OFBiz Issue Type: Sub-task Affects Versions: Trunk Reporter: Julian Leichert Priority: Minor ServiceEcaAction.java:43, SE_NO_SERIALVERSIONID - SnVI: org.apache.ofbiz.service.eca.ServiceEcaAction is Serializable; cons= ider declaring a serialVersionUID This class implements the Serializable interface, but does not define a ser= ialVersionUID field. A change as simple as adding a reference to a .class = object will add synthetic fields to the class, which will unfortunately cha= nge the implicit serialVersionUID (e.g., adding a reference to String.class= will generate a static field class$java$lang$String). Also, different sour= ce code to bytecode compilers may use different naming conventions for synt= hetic variables generated for references to class objects or inner classes.= To ensure interoperability of Serializable across versions, consider addin= g 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 retu= rns the identity hash code, an arbitrary value assigned to the object by th= e VM). Therefore, the class is very likely to violate the invariant that e= qual objects must have equal hashcodes. If you don't think instances of this class will ever be inserted into a Has= hMap/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; c= onsider declaring a serialVersionUID This class implements the Serializable interface, but does not define a ser= ialVersionUID field. A change as simple as adding a reference to a .class = object will add synthetic fields to the class, which will unfortunately cha= nge the implicit serialVersionUID (e.g., adding a reference to String.class= will generate a static field class$java$lang$String). Also, different sour= ce code to bytecode compilers may use different naming conventions for synt= hetic variables generated for references to class objects or inner classes.= To ensure interoperability of Serializable across versions, consider addin= g an explicit serialVersionUID. ServiceEcaCondition.java:78, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE - RCN: Redundant nullcheck of org.apache.ofbiz.service.eca.ServiceEcaCondit= ion.lhsValueName, which is known to be non-null in new org.apache.ofbiz.ser= vice.eca.ServiceEcaCondition(Element, boolean, boolean) This method contains a redundant check of a known non-null value against th= e constant null. ServiceEcaCondition.java:81, RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE - RCN: Redundant nullcheck of org.apache.ofbiz.service.eca.ServiceEcaCondit= ion.rhsValueName, which is known to be non-null in new org.apache.ofbiz.ser= vice.eca.ServiceEcaCondition(Element, boolean, boolean) This method contains a redundant check of a known non-null value against th= e constant null. ServiceEcaCondition.java:219, HE_EQUALS_USE_HASHCODE - HE: org.apache.ofbiz.service.eca.ServiceEcaCondition defines equals and u= ses Object.hashCode() This class overrides equals(Object), but does not override hashCode(), and = inherits the implementation of hashCode() from java.lang.Object (which retu= rns the identity hash code, an arbitrary value assigned to the object by th= e VM). Therefore, the class is very likely to violate the invariant that e= qual objects must have equal hashcodes. If you don't think instances of this class will ever be inserted into a Has= hMap/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=C3=A4t: 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. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.enabled This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.runOnFailure This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.serviceName This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.runOnError This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.conditions This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.definitionLo= cation This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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 declar= es protected field org.apache.ofbiz.service.eca.ServiceEcaRule.eventName This class is declared to be final, but declares fields to be protected. Si= nce the class is final, it can not be derived from, and the use of protecte= d is confusing. The access modifier for the field should be changed to priv= ate 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; consid= er declaring a serialVersionUID This class implements the Serializable interface, but does not define a ser= ialVersionUID field. A change as simple as adding a reference to a .class = object will add synthetic fields to the class, which will unfortunately cha= nge the implicit serialVersionUID (e.g., adding a reference to String.class= will generate a static field class$java$lang$String). Also, different sour= ce code to bytecode compilers may use different naming conventions for synt= hetic variables generated for references to class objects or inner classes.= To ensure interoperability of Serializable across versions, consider addin= g an explicit serialVersionUID. ServiceEcaRule.java:181, HE_EQUALS_USE_HASHCODE - HE: org.apache.ofbiz.service.eca.ServiceEcaRule defines equals and uses O= bject.hashCode() This class overrides equals(Object), but does not override hashCode(), and = inherits the implementation of hashCode() from java.lang.Object (which retu= rns the identity hash code, an arbitrary value assigned to the object by th= e VM). Therefore, the class is very likely to violate the invariant that e= qual objects must have equal hashcodes. If you don't think instances of this class will ever be inserted into a Has= hMap/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 def= ault encoding. This may result in improper conversions when used with inter= national 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 us= es Object.hashCode() This class overrides equals(Object), but does not override hashCode(), and = inherits the implementation of hashCode() from java.lang.Object (which retu= rns the identity hash code, an arbitrary value assigned to the object by th= e VM). Therefore, the class is very likely to violate the invariant that e= qual objects must have equal hashcodes. If you don't think instances of this class will ever be inserted into a Has= hMap/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.a= pache.ofbiz.service.eca.ServiceEcaUtil.getServiceEventMap(String) There is a branch of statement that, if executed, guarantees that a null va= lue will be dereferenced, which would generate a NullPointerException when = the code is executed. Of course, the problem might be that the branch or st= atement is infeasible and that the null pointer exception can't ever be exe= cuted; deciding that is beyond the ability of FindBugs. -- This message was sent by Atlassian JIRA (v6.4.14#64029)