Commit Graph
15 Commits
Author SHA1 Message Date
Jacques Le Roux 4dc2b3eab9 Improved: Adds missing ASL2 header in exclude.xml
Reported by https://nightlies.apache.org/ofbiz/trunk/rat-output.html
2022-01-01 13:19:26 +01:00
Jacques Le Roux 8588de579c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
I prefer to remove this exclusion as it may depend of Spotbugs version.
2021-12-26 14:02:17 +01:00
Jacques Le Roux 2437f2539c Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Forgot to include the spotbugs/exclude.xml file in previous commit.
Also fixes some typos
2021-12-26 13:19:42 +01:00
Jacques Le Roux 3a81cc5aa3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In JanrainHelper class the apiKey and baseUrl field are initialised by
UtilProperties.getPropertyValue() and then only read or possibly modified by
the sole constructor. Excludes them from SpotBugs findings
2021-12-26 08:09:28 +01:00
Jacques Le Roux 8587bccf40 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
We don't fear collisions for "servletContext". It's only initialised by
contextInitialized() and then only read before being destroyed by
contextDestroyed()

Also initialises servletContextto null
2021-12-23 17:14:11 +01:00
Jacques Le Roux c0e637d72f Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
I made a mistake in 1 exclusion
2021-12-18 11:50:08 +01:00
Jacques Le Roux aac0571283 Improved: no functional change, removes applications/content/index/ from .gitignore
Also adds a comment in spotbugs/exclude.xml
2021-12-16 16:46:06 +01:00
Jacques Le Roux b9735b208a Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Finally it's better to use || than | (did not check well last time) in
ProductSearchSession::makeSearchParametersString
kc.isAnyPrefix() || kc.isAnySuffix()
So also removes the exclusion

No problem for report field in AbstractReportThread as explained in exclude.xml
2021-12-16 13:09:38 +01:00
Jacques Le Roux 4724b9e2ee Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
We don't fear collisions for "url". It's only used in testXmlRpcRequest during
a sole test, write that in exclude.xml

Also removes an unused MODULE in XmlRpcTests class
2021-12-13 16:23:54 +01:00
Jacques Le Roux 4de3a37c54 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ProposedOrder::calculateStartDate and TimeDuration::TimeDuration better use a
long directly (efficiency)

In ConfigXMLReader, removes unused getViewMap method

In ServiceArtifactInfo, some formatting and in writeServiceCallGraphEoModel
method add missing <<if (calledServiceSet != null) {>>

Adds and documents false positives in exclude.xml.
Remains 14 issues, I'll document them in the Jira and 'll later discuss them
on dev ML (committers attention needed). None of them are security issues :)
C:/projectsASF/Git/ofbiz-framework/plugins/rest-api/src/main/java/org/apache/ofbiz/ws/rs/listener/ApiContextListener.java:38 Ecriture d'un champ statique org.apache.ofbiz.ws.rs.listener.ApiContextListener.servletContext depuis la méthode d'une instance org.apache.ofbiz.ws.rs.listener.ApiContextListener.contextInitialized(ServletContextEvent) [Of Concern(15), High confidence]
C:/projectsASF/Git/ofbiz-framework/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java:49 org.apache.ofbiz.base.util.collections.GenericMapValues.equals(Object) checks for operand being a java.util.List  [Troubling(14), High confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/ldap/src/main/java/org/apache/ofbiz/ldap/cas/OFBizCasAuthenticationHandler.java:91 Déréférencement immédiat du résultat d'un readLine() dans org.apache.ofbiz.ldap.cas.OFBizCasAuthenticationHandler.login(HttpServletRequest, HttpServletResponse, Element) [Of Concern(15), Normal confidence]
C:/projectsASF/Git/ofbiz-framework/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/GenericMapValues.java:49 org.apache.ofbiz.base.util.collections.GenericMapValues.equals(Object) checks for operand being a java.util.Set  [Troubling(14), High confidence]
C:/projectsASF/Git/ofbiz-framework/framework/widget/src/test/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRendererTest.java:875 Un appel de méthode dans new org.apache.ofbiz.widget.renderer.macro.MacroFormRendererTest$36(MacroFormRendererTest, ModelForm) passe null à un paramètre déréférencé de façon inconditionnelle dans org.apache.ofbiz.webapp.control.RequestHandler.makeLink(HttpServletRequest, HttpServletResponse, String) [Scary(8), Normal confidence]
C:/projectsASF/Git/ofbiz-framework/framework/widget/src/test/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRendererTest.java:848 Un appel de méthode dans new org.apache.ofbiz.widget.renderer.macro.MacroFormRendererTest$35(MacroFormRendererTest, ModelForm) passe null à un paramètre déréférencé de façon inconditionnelle dans org.apache.ofbiz.webapp.control.RequestHandler.makeLink(HttpServletRequest, HttpServletResponse, String) [Scary(8), Normal confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java:71 Ecriture d'un champ statique org.apache.ofbiz.ecommerce.janrain.JanrainHelper.apiKey depuis la méthode d'une instance new org.apache.ofbiz.ecommerce.janrain.JanrainHelper(String, String) [Of Concern(15), High confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/pricat/src/main/java/org/apache/ofbiz/htmlreport/AbstractReportThread.java:160 Champ jamais écrit : org.apache.ofbiz.htmlreport.AbstractReportThread.report [Troubling(12), Normal confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/ecommerce/src/main/java/org/apache/ofbiz/ecommerce/janrain/JanrainHelper.java:72 Ecriture d'un champ statique org.apache.ofbiz.ecommerce.janrain.JanrainHelper.baseUrl depuis la méthode d'une instance new org.apache.ofbiz.ecommerce.janrain.JanrainHelper(String, String) [Of Concern(15), High confidence]
C:/projectsASF/Git/ofbiz-framework/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/CacheSoftReference.java:29 org.apache.ofbiz.base.util.cache.CacheSoftReference est Serializable mais sa super-classe ne possède pas de constructeur par défaut visible [Troubling(14), High confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/ldap/src/main/java/org/apache/ofbiz/ldap/activedirectory/OFBizActiveDirectoryAuthenticationHandler.java:110 Alimentation à perte d'une variable locale dans la méthode org.apache.ofbiz.ldap.activedirectory.OFBizActiveDirectoryAuthenticationHandler.getLdapSearchResult(String, String, Element, boolean) [Of Concern(15), High confidence]
C:/projectsASF/Git/ofbiz-framework/plugins/ldap/src/main/java/org/apache/ofbiz/ldap/openldap/OFBizLdapAuthenticationHandler.java:95 Alimentation à perte d'une variable locale dans la méthode org.apache.ofbiz.ldap.openldap.OFBizLdapAuthenticationHandler.getLdapSearchResult(String, String, Element, boolean) [Of Concern(15), High confidence]
C:/projectsASF/Git/ofbiz-framework/framework/base/src/main/java/org/apache/ofbiz/base/util/collections/FlexibleServletAccessor.java:193 org.apache.ofbiz.base.util.collections.FlexibleServletAccessor.equals(Object) checks for operand being a String  [Troubling(14), High confidence]
C:/projectsASF/Git/ofbiz-framework/framework/service/src/main/java/org/apache/ofbiz/service/test/XmlRpcTests.java:47 Ecriture d'un champ statique org.apache.ofbiz.service.test.XmlRpcTests.url depuis la méthode d'une instance new org.apache.ofbiz.service.test.XmlRpcTests(String) [Of Concern(15), High confidence]
2021-12-11 16:21:36 +01:00
Jacques Le Roux cba9471cb0 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Despite by best efforts in SecuredUpload::isValidFile and
PricatParseExcelHtmlThread::storePricatFile SpotBugs still reports possible null
dereferencements.

The error is NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE. It's false reports to me.
Hence excluding them in these places
2021-12-10 11:55:16 +01:00
Jacques Le Roux 5a64c3d27d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In exclude.xml:
removes Confidence lines, no need to complicate things
Adds 2 DC_DOUBLECHECK false reports; synchronized is used there (maybe not the
best way but it's OK as is)

In ProductConfigWrapper::equals fixes use of == instead of equals (tested)
In UspsServices::uspsPriorityMailInternationalLabel fixes 2 possible null
dereferencements

In EntityExpr::checkRhsType fixes a possible null dereferencement
2021-12-09 07:25:25 +01:00
Jacques Le Roux 086d4d4bfe Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Adjusts the spotbugs/exclude.xml file to remove no super::clone reports
2021-12-03 19:41:36 +01:00
Jacques Le Roux 17f21565bb Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Removes duplicate from SpotBugs exclude file.
2021-12-03 12:33:55 +01:00
Jacques Le Roux 65d2a66b35 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Add a SpotBugs exclude file. To use refer to
https://spotbugs.readthedocs.io/en/latest/filter.html
https://spotbugs.readthedocs.io/en/latest/bugDescriptions.html
2021-12-03 09:34:33 +01:00