Commit Graph
10634 Commits
Author SHA1 Message Date
Jacques Le Roux d324f6abee Fixed: Attribute 'placeholder' is not allowed to appear in element 'text'
Completes the previous fix by Wei Zhang. This was committed at a wrong place
for OFBIZ-5341. Only text was concerned, not date-time
2022-01-29 10:57:31 +01:00
Nicolas Malin 4936f6f145 Improved: Use flexible expander to resolve the area target on call back (OFBIZ-12509)
When you use a callback, at this time we haven't to possibility to resolve the area target from the context like this

                <wm:link target="WorkEffortAgreement/delete">
                    ....
                    <wm:set-callback area-target="${useThisTarget}">
                       ...
                    </wm-setcallback>
                </wm:link>
2022-01-24 07:16:36 +01:00
Jacques Le Roux 952519e898 Documented: Changes "Default User Documentation website uri" (OFBIZ-12456)
Related to BuildBot migration from 0.8 to 3.2 version (INFRA-22279).
2021-12-31 10:47:02 +01:00
Jacques Le Roux 8c6d3272bd Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes random  object created and used only once in classes:
  SSLUtil
  OrderTestServices
  FinAccountHelper
  GiftCertificateServices

Also related minor formatting in HashCrypt and ContextFilter
2021-12-28 12:11:12 +01:00
Jacques Le Roux 21ebebc063 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Adds a null check at GenericMapValues::equals
2021-12-26 14:52:37 +01:00
Jacques Le Roux 06092ae0af Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
As advised by SpotBugs:

<<This code creates a java.util.Random object, uses it to generate one random
number, and then discards the Random object. This produces mediocre quality
random numbers and is inefficient. If possible, rewrite the code so that the
Random object is created once and saved, and each time a new random number is
required invoke a method on the existing Random object to obtain it.

If it is important that the generated Random numbers not be guessable, you must
not create a new Random for each random number; the values are too easily
guessable. You should strongly consider using a java.security.SecureRandom
instead (and avoid allocating a new SecureRandom for each random number needed).

Rank: Troubling (14), confidence: High
Pattern: DMI_RANDOM_USED_ONLY_ONCE
Type: DMI, Category: BAD_PRACTICE (Bad practice)>>

uses <<private static final SecureRandom SECURE_RANDOM = new SecureRandom();>>
in classes:
PaymentGatewayServices
ValueLinkApi
ContactMechServices
ProductStoreWorker
DesCrypt
HashCrypt
EntityCrypto
ContextFilter.java

Despite doing so SpotButs still reports the same error for those classes.
As it's obviously an error I prefer to not excludes those cases that will maybe
not be reported in a future version of SpotButs in Eclipse. For instance they
are not reported at all in previous version (4.5.1) but are in 4.5.2
2021-12-26 14:50:32 +01:00
Jacques Le Roux 628c251842 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
SpotBugs reports that
<<org.apache.ofbiz.base.util.collections.FlexibleServletAccessor.equals(Object)
does not check for parameter nullity

This implementation of equals(Object) does not respect the contract defined by
java.lang.Object.equals() because it does not check the nullity of the parameter
received as argument. All equals() methods must return false when they receive
a null value.>>

This fixes it, but despite SpotBugs continues to report the same error, excludes
it.

Also removes unused expandContext private var
2021-12-26 09:09:16 +01:00
Jacques Le Roux 22b8ecb557 Improved: Migrate Ofbiz bb 0.8 config to 3.2 (OFBIZ-12456)
Comment out the XMLRPC tests. This alone should allow Buildbot 3.2 to run the
integration tests.
2021-12-16 07:05:26 +01:00
Jacques Le Roux 3b99529c0d Improved: Address SpotBugs issue by avoiding nulls in parameter matches for JMockit Expectations (OFBIZ-11456)
Same than https://github.com/apache/ofbiz-framework/pull/411

Thanks: Daniel
2021-12-13 17:24:02 +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
Daniel Watford e163330934 Improved: Address SpotBugs issue by avoiding nulls in parameter matches for JMockit Expectations (OFBIZ-11456) 2021-12-13 15:20:40 +00:00
Jacques Le Roux 36600c1bcc Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
CacheSoftReference<V> extends ReferenceCleaner.Soft<V> and implements
Serializable. But ReferenceCleaner does not implement Serializable.

I see no reasons for CacheSoftReference<V> to implement Serializable. So I
simply remove that.
2021-12-12 17:40:26 +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 8b9fc99d7d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ProductWorker::getProductFeaturesApplIncludeMarketingPackage fixes a possible
null dereferencement (tested too late)

In FileUtil::unZip uses a try-w-resource w/ ZipFile to close it. I crossed an
issue with automated OOTB formatting (clean-up on save in Eclipse). Fixed with
my external default editor (could not find where to change that in
OFBizJavaFormatter.xml

In ServiceArtifactInfo::calledServiceEcaSet fixes a possible null dereferencement
(tested too late), also minor formatting

In MacroScreenRenderer::renderScreenletSubWidget fixes a possible null
dereferencement (tested too late)

in FileUtil
2021-12-10 16:09:42 +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 69cff24c82 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In WebToolsServices::entityImportDir fixes a possible null dereferencement

Missed in previous commit, not sure why
2021-12-10 09:51:22 +01:00
Jacques Le Roux 54c6010c3b Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
In SecuredUpload::isValidFile fixes a possible null dereferencement
2021-12-09 19:24:21 +01:00
Pierre Smits 1bbd2c2e2f Improved: Dutch UiLabels (OFBIZ-10363) (#402) 2021-12-09 18:36:05 +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 ed0eb9c907 Improved: uses diamond syntax in JsLanguageFilesMapping class
No functional change
2021-12-08 16:35:33 +01:00
Jacques Le Roux d6c18f2998 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
ModelFormField::isAllChecked can't return null, must be a boolean
2021-12-06 09:44:48 +01:00
Jacques Le Roux b02255ae5f Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
No functional change: removes unused MODULE in ReferenceCleaner class
2021-12-06 09:43:52 +01:00
Jacques Le Roux ca03e21ae8 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Rearranges order of modifiers after transient insertion, in classes
ProductConfigWrapper, ModelEntity, ModelViewEntity and ModelService
2021-12-06 09:42:47 +01:00
Jacques Le Roux 1ecf6d3929 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Adds @SuppressWarnings("serial") to AbstractJob and removes unused MODULE var
from PurgeJob
2021-12-06 09:37:36 +01:00
Jacques Le Roux d4306b9f59 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
ComparableRange is a super class of DateRange that is Serializable. So
ComparableRange needs to be Serializable Too. Same with AbstractJob for PurgeJob
and GenericServiceJob
2021-12-06 09:33:31 +01:00
Jacques Le Roux ed6241cb52 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
transient is needed for not serialisable fields of a Serializable class
2021-12-06 09:23:55 +01:00
Jacques Le Roux aab412b948 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Renames ControlServlet class to OfbizControlServlet, because it shadowed the
simple name of it superclass
It can be exceptionally confusing, create lots of situations in which you have
to look at import statements to resolve references and creates many
opportunities to accidentally define methods that do not override methods
in their superclasses.

Same for XmlRpcClient.java
2021-12-05 13:03:50 +01:00
Jacques Le Roux 36b82f2b16 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
GenericEntity::getBoolean can't return null, so false

CommunicationEventServices::sendEmailToContactList handles correctly
tmpResult != null
2021-12-03 12:37:46 +01:00
Jacques Le Roux 164d39a7fc Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Removes wrong comment, it's a test class
2021-12-03 12:25:25 +01:00
Jacques Le Roux a7183cba55 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Add a comment about test methods not used OOTB
2021-12-03 09:34:33 +01:00
Jacques Le Roux 513689da96 Documented: MacroFormRenderer refactoring (OFBIZ-11456)
Adds a FIXME about: SpotBugs reporting:
Argument 1 is definitely null but must not be null
2021-11-30 19:12:33 +01:00
Jacques Le Roux 699c30ed85 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings

For FormRenderer.java it was accidentally removed for OFBIZ-12422
2021-11-30 19:03:24 +01:00
Jacques Le Roux 6274fbedbe Improved: Adds the Attributs French label 2021-11-30 12:24:15 +01:00
Jacques Le Roux 23177b182d Improved: Search/find in web tools - entity-engine generates an error (OFBIZ-12422)
I blindly followed SpotBugs advice, using a "try with resource" because the
EntityListIterator was not closed. Forgetting that it's done by purpose.

Thanks: Thanks Pierre Smits for report
2021-11-30 10:38:38 +01:00
Jacques Le Roux a3a53b5b72 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings in PackingSession.java and FormRenderer.java

Also a try with resource for FormRenderer because the EntityListIterator was not
closed.

Also removes not used setShipmentBoxTypeId method and shipmentBoxTypeId var in
PackingSession.java
2021-11-29 14:20:07 +01:00
Jacques Le Roux cfb5de4246 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes possible null dereferencings
2021-11-29 14:00:09 +01:00
Jacques Le Roux 4ac3da1082 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
If userLogin is null none of the blocks below makes sense
2021-11-29 09:56:00 +01:00
Jacques Le Roux 997cf16ed3 Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Useless self assignment
2021-11-19 17:51:30 +01:00
Jacques Le Roux 7ac626b23d Improved: Fix some bugs Spotbugs reports (OFBIZ-12386)
Repeated conditional test
2021-11-19 17:46:25 +01:00
Jacques Le Roux 59dd946078 Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a Spotbugs worry and simplifies code
2021-11-18 17:09:08 +01:00
Jacques Le Roux 5dfdb5095f Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Fixes a Spotbugs worry and clarifies code
2021-11-18 17:09:08 +01:00
Jacques Le Roux 4d9d191dfd Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Need to check for null before return
2021-11-18 08:07:53 +01:00
Jacques Le Roux 103dd6afee Improved: no functional change
Removes useless (not used) local var
2021-11-17 16:28:24 +01:00
Jacques Le Roux 185569c8aa Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Incorrect lazy initialisation

Thanks: Spotbugs
2021-11-17 16:26:11 +01:00
Jacques Le Roux dc8d6d504a Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ternary operator post increment does not work, pre increment does

Thanks: Spotbugs
2021-11-17 15:49:18 +01:00
Jacques Le Roux f126bae89c Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
Char arrays can't use toString()

Thanks: Spotbugs :)
2021-11-16 16:02:51 +01:00
Pierre Smits 24fb8a99e7 Improved: entity element descriptions (OFBIZ-12383) (#343)
added:
entitymodel.xsd: desriptions for
1. table-name
2. default-resource-name
3. dependent-on
2021-11-16 12:11:58 +01:00
Pierre Smits d3ace542f0 Improved: Dutch labels for DateTime (OFBIZ-12379) (#339)
added:
Dutch tranlations for various labels in DateTimeLabels.xml
2021-11-12 18:15:34 +01:00
Jacques Le Roux 49362441b7 Improved: Use NPM with gradle to get external JS dependencies (OFBIZ-11960)
After checking that we don't have any possible vulnerability using
jquery-ui-dist (ie 1.12.1) vs jquery-ui (1.13.0) based on* and checking in code
I decided to use jquery-ui-dist from npm. I just had to modify OfbizUtil.js to
get back to element.form() (for 1.12.1) vs element._form() for 1.13.0

I hope the npm jquery-ui-dist package will be updated soon. The release of
1.13.0 is quite fresh (<1 month).

We also need a mechanism to check the update or our npm packages.
As Aditya explained:
<<Minor updates can be handled implicitly by node when specified with tilde
range or caret range for version. For major updates, we just have to change
the version and use npm install.>>
So for now it will be manual. Later something like** could be used (I wonder
about https://snyk.io/, but that needs Infra agreement)

* https://blog.jqueryui.com/2021/10/jquery-ui-1-13-0-released/
** https://dev.to/dennismphil/automate-your-node-dependency-updates-4aga
2021-11-11 16:05:35 +01:00
wpaetzold 3d93c2709e Fixed: Builds fail due to unauthorized access to repo.spring.io/plugins-release (OFBIZ-12351) (#334)
Replaces repository syndication by rometools

Thanks Mart Naum for report
2021-11-09 14:34:44 +01:00