When you create an entity-condition in a form or grid under a compound element, to write a valid xml you write it with the namespace like this :
<wf:actions>
<wf:entity-condition entity-name="PartyRelationship"...>
<wf:condition-list>
<wf:condition-expr field-name="partyIdFrom" from-field="parameters.partyIdFrom"/>
<wf:condition-expr field-name="partyIdTo" from-field="parameters.partyIdTo"/>
</wf:condition-list>
</wf:entity-condition>
</wf:actions>
This failed when OFBiz execute the search with error Invalid element with name '[wf:condition-expr]' found under a condition-list element.
The error came from the class EntityFinderUtil.ConditionList who analyze the condition-list's children with the namespace + node name instead take only the node name.
if ("condition-expr".equals(subElement.getNodeName()))
To solve this issue we only check the local node name regardless from the namespace used.
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
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
At https://markmail.org/message/3mhzlqew3igad3r2 I reported an issue that I was
not able to really qualify. After exchanging with a Checkstyle expert
(see markmail thread).
I was unable to find what in our checkstyle.xml file was wrongly throwing these
warnings. I decided that there was no reason to throw those warnings.
So I decided to put the SuppressionCommentFilter in our checkstyle.xml file and
use CHECKSTYLE_OFF: ALMOST_ALL/CHECKSTYLE_ON: ALMOST_ALL around
the concerned lines as documented here
https://checkstyle.sourceforge.io/config_filters.html#SuppressionCommentFilter_Examples
This prevented to run the stable demo, hence the next, weirdly the trunk had
not this problem. Anyway better safe than sorry... Maybe related to Gradle
version or rather libs loaded?
The reason why the stable (and old) demos were not running is because the
EntitySaxReaderTests did not pass
The default padding scheme of ECB mode for
org.apache.shiro.crypto.AesCipherService is different between v1.4.1 and
v1.7.1, i.e.:
v1.4.1 getPaddingSchemeName() result is "PKCS5Padding"
v1.7.1 getPaddingSchemeName() result is "NoPadding"
This patch specify padding scheme explicitly, after that exception
mentioned in build.gradle does not raise anymore, and initial data can
load successfully.
As encountered in OFBIZ-6510, the ModelInduceFromDb does currently not include entity relations and foreign key constraints. Since they are an important part of the database model, we should fix that.
I could track down the problem to an incomplete invocation of the ModelEntity through the constructor used in the DatabaseUtil.induceModelFromDb() Methods. This constructor does not initialize the Relations.
Problem is, that the ModelEntity initialized through the "DB Names Constructor" does not cover references in its current state at all.
While working on an implementation I realized, that the API is not very congruent in this regards. I would expect that I could initialize ModelRelations the same way ModelFields are initialized in this context:
The create() Method takes a ModelEntity, DatabaseUtil.ColumnCheckInfo (respectively a DatabaseUtil.ReferenceCheckInfo) and a ModelFieldTypeReader (that could be left out for references) and creates ModelField (ModelRelation) objects that are added to the ModelEntity.
But that is not the case at the moment. On one hand not all fields that would be necessary are covered in the DatabaseUtil.ReferenceCheckInfo Objects (e.g. "type" is missing), on the other the object is missing public getters to make the values available in the first place.
Thanks a bunch Benjamin, nice add !
This due for many years
NOTE DEJ20071022: the use of ByteWrapper is not recommended and is deprecated,
only old data should be stored that way.
I have still to verify the implication of removing
deserializeField() in SqlJdbcUtil.getValue()
This reverts commit 8736162c74.
We have test integration issues to fix
Due to TortoiseGIt, something weird happened, confused me to revert the revert :/
"Description" and "comment" fields are restricted to 255 char.
However after some research I found that all the supported databases support
longer then 255 char
I would expect users to want to write more then 255 char in a comment
(I know I personally can).
A discussion has been started on dev ML:
https://markmail.org/message/7utrgejc2c44i37u
Also adds a note in DATAMODEL_CHANGES.adoc
Thanks: ddev
Removes last remaining "Must have at least one statement" issues by using
Debug.logVerbose
Decreases tasks.checkstyleMain.maxErrors from 543 to 535
Thanks: Suraj for report
We have a lot of "do nothing" in Java code. In case of catch we should at least
have Debug.logError(e, MODULE); and maybe an explanation in the comment.