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 373ED20049E for ; Thu, 10 Aug 2017 09:42:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 340F016ACDB; Thu, 10 Aug 2017 07:42:10 +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 5395B16ACD9 for ; Thu, 10 Aug 2017 09:42:09 +0200 (CEST) Received: (qmail 41904 invoked by uid 500); 10 Aug 2017 07:42:08 -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 41895 invoked by uid 99); 10 Aug 2017 07:42:08 -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, 10 Aug 2017 07:42:08 +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 095671807E2 for ; Thu, 10 Aug 2017 07:42:08 +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 WBW35wpb5P2W for ; Thu, 10 Aug 2017 07:42:06 +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 EF8B55FBC6 for ; Thu, 10 Aug 2017 07:42:05 +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 157E9E0DEC for ; Thu, 10 Aug 2017 07:42:04 +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 8619924161 for ; Thu, 10 Aug 2017 07:42:01 +0000 (UTC) Date: Thu, 10 Aug 2017 07:42:01 +0000 (UTC) From: "Jacques Le Roux (JIRA)" To: notifications@ofbiz.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (OFBIZ-9566) [FB] Package org.apache.ofbiz.base.config MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 10 Aug 2017 07:42:10 -0000 [ https://issues.apache.org/jira/browse/OFBIZ-9566?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reassigned OFBIZ-9566: -------------------------------------- Assignee: Jacques Le Roux > [FB] Package org.apache.ofbiz.base.config > ----------------------------------------- > > Key: OFBIZ-9566 > URL: https://issues.apache.org/jira/browse/OFBIZ-9566 > Project: OFBiz > Issue Type: Sub-task > Components: base > Affects Versions: Trunk > Reporter: Tobias Laufk=C3=B6tter > Assignee: Jacques Le Roux > Priority: Minor > Attachments: OFBIZ-9566.patch > > > FileLoader.java:30, SE_NO_SERIALVERSIONID, > SnVI: org.apache.ofbiz.base.config.FileLoader is Serializable; consider d= eclaring a serialVersionUID > This class implements the Serializable interface, but does not define a s= erialVersionUID field. A change as simple as adding a reference to a .clas= s object will add synthetic fields to the class, which will unfortunately c= hange the implicit serialVersionUID (e.g., adding a reference to String.cla= ss will generate a static field class$java$lang$String). Also, different so= urce code to bytecode compilers may use different naming conventions for sy= nthetic variables generated for references to class objects or inner classe= s. To ensure interoperability of Serializable across versions, consider add= ing an explicit serialVersionUID. > MainResourceHandler.java:-1, CI_CONFUSED_INHERITANCE, > CI: Class org.apache.ofbiz.base.config.MainResourceHandler is final but d= eclares protected field org.apache.ofbiz.base.config.MainResourceHandler.xm= lFilename > 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 protec= ted is confusing. The access modifier for the field should be changed to pr= ivate or public to represent the true use for the field. > MainResourceHandler.java:-1, CI_CONFUSED_INHERITANCE, > CI: Class org.apache.ofbiz.base.config.MainResourceHandler is final but d= eclares protected field org.apache.ofbiz.base.config.MainResourceHandler.lo= cation > 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 protec= ted is confusing. The access modifier for the field should be changed to pr= ivate or public to represent the true use for the field. > MainResourceHandler.java:-1, CI_CONFUSED_INHERITANCE, > CI: Class org.apache.ofbiz.base.config.MainResourceHandler is final but d= eclares protected field org.apache.ofbiz.base.config.MainResourceHandler.lo= aderName > 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 protec= ted is confusing. The access modifier for the field should be changed to pr= ivate or public to represent the true use for the field. > MainResourceHandler.java:37, SE_NO_SERIALVERSIONID, > SnVI: org.apache.ofbiz.base.config.MainResourceHandler is Serializable; c= onsider declaring a serialVersionUID > This class implements the Serializable interface, but does not define a s= erialVersionUID field. A change as simple as adding a reference to a .clas= s object will add synthetic fields to the class, which will unfortunately c= hange the implicit serialVersionUID (e.g., adding a reference to String.cla= ss will generate a static field class$java$lang$String). Also, different so= urce code to bytecode compilers may use different naming conventions for sy= nthetic variables generated for references to class objects or inner classe= s. To ensure interoperability of Serializable across versions, consider add= ing an explicit serialVersionUID. > ResourceLoader.java:159, REC_CATCH_EXCEPTION, > REC: Exception is caught when Exception is not thrown in org.apache.ofbiz= .base.config.ResourceLoader.makeLoader(Element) > This method uses a try-catch block that catches Exception objects, but Ex= ception is not thrown within the try block, and RuntimeException is not exp= licitly caught. It is a common bug pattern to say try { ... } catch (Except= ion e) { something } as a shorthand for catching a number of types of excep= tion each of whose catch blocks is identical, but this construct also accid= entally catches RuntimeException as well, masking potential bugs. > A better approach is to either explicitly catch the specific exceptions t= hat are thrown, or to explicitly catch RuntimeException exception, rethrow = it, and then catch all non-Runtime Exceptions, as shown below: > try { > ... > } catch (RuntimeException e) { > throw e; > } catch (Exception e) { > ... deal with all non-runtime exceptions ... > } > UrlLoader.java:30, SE_NO_SERIALVERSIONID, > SnVI: org.apache.ofbiz.base.config.UrlLoader is Serializable; consider de= claring a serialVersionUID > This class implements the Serializable interface, but does not define a s= erialVersionUID field. A change as simple as adding a reference to a .clas= s object will add synthetic fields to the class, which will unfortunately c= hange the implicit serialVersionUID (e.g., adding a reference to String.cla= ss will generate a static field class$java$lang$String). Also, different so= urce code to bytecode compilers may use different naming conventions for sy= nthetic variables generated for references to class objects or inner classe= s. To ensure interoperability of Serializable across versions, consider add= ing an explicit serialVersionUID. -- This message was sent by Atlassian JIRA (v6.4.14#64029)