Commit Graph
30 Commits
Author SHA1 Message Date
Jacques Le Roux 8f6a1d361e Fixed: Fix some bugs Spotbugs reports (OFBIZ-12386)
In ternary operator post increment does not work, pre increment does

Thanks: Spotbugs
2021-11-19 09:34:34 +01:00
Jacques Le Roux cbab9e6a45 "Applied fix from trunk for revision: 1857099"
------------------------------------------------------------------------
r1857099 | jleroux | 2019-04-08 11:17:55 +0200 (lun. 08 avr. 2019) | 12 lignes

Improved: Using try-with-resources with File IO Objects.
(OFBIZ-9855)

Uses try with resources for File IO objects like ObjectInputStream and other 
objects. File classes have the AutoCloseable interface.

jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...

All tests pass

Thanks: Pradhan Yash Sharma
------------------------------------------------------------------------


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1857486 13f79535-47bb-0310-9956-ffa450edef68
2019-04-13 17:50:10 +00:00
Jacques Le Roux bbfc62d47a Improved: Fix or Silence various warnings
(OFBIZ-10701)

In order to detect potential issues early, the linting compiler option should be 
used by default and disabled with {{./gradlew -PXlint:none build}}.

Additionally it is important to reduce the number of warnings otherwise new 
warnings will remain unnoticed.

The warning related to the com.googlecode.concurrentlinkedhashmap dependency 
should resolves itself once we handle upgrade to Caffeine like proposed in 
OFBIZ-6747.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848673 13f79535-47bb-0310-9956-ffa450edef68
2018-12-11 13:33:49 +00:00
Gil Portenseigne ceea6ce791 Improved : Remove all unnecessary boxing and unboxing in Java classes
(OFBIZ-10504)

Thanks Taher, Jacques, Mathieu and Rishi for the review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837577 13f79535-47bb-0310-9956-ffa450edef68
2018-08-07 07:30:43 +00:00
Jacques Le Roux 62fce8c184 Fixed:: Dynamic values not rendering properly in property tag of fail-property
attribute
(OFBIZ-10406)

While calling checkProductRelatedPermission, if permission is failed ten 
fail-property tag uses ${checkActionLabel} which is not handled properly in 
MessageElement.java.
There are 2-3 other occurrences as well of such type but not in working 
condition.

Thanks: Suraj

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831831 13f79535-47bb-0310-9956-ffa450edef68
2018-05-18 08:11:55 +00:00
Deepak Dixit a52c62d726 Improved: In 'ValidateMethod.java', when we don't pass any className from xml files. default value 'org.apache.ofbiz.base.util.UtilValidate' should be set for className. (OFBIZ-9969)
Thanks Suraj Khurana and Sonal Patwari for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1825197 13f79535-47bb-0310-9956-ffa450edef68
2018-02-24 08:31:14 +00:00
Jacques Le Roux b06570590e Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

UtilNumber class
 Deprecates and replaces both getBigDecimalRoundingMode() by getRoundingMode()
 Deprecates toPercentString()
 Puts a log for a NumberFormatException

Calculate class
 Uses RoundingMode where necessary. No deprecation, this should be only used
 by Minilang

The rest
 Adapts the whole code for that
 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823931 13f79535-47bb-0310-9956-ffa450edef68
2018-02-12 10:04:29 +00:00
Deepak Dixit 1c0e3a8dbe Reverted: Revision #1819126 causing test failure, reverted for now (OFBIZ-9969)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819132 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 10:27:27 +00:00
Deepak Dixit 0aabb0b015 Fixed: Added missing import in ValidateMethod.java (OFBIZ-9969)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819129 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 09:45:08 +00:00
Deepak Dixit 78a1b15a25 Improved: In 'ValidateMethod.java', when we don't pass any className from xml files. default value 'org.apache.ofbiz.base.util.UtilValidate' should be set for className. (OFBIZ-9969)
Thanks Sonal Patwari and Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819126 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 09:29:58 +00:00
Jacques Le Roux d1bdee2c6c Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes the work done so far by removing double check in cases not using 
brackets, like
if (Debug.verboseOn())
  if (Debug.verboseOn()) Debug.logVerbose()

Thanks: Michael for reporting this case I missed.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818445 13f79535-47bb-0310-9956-ffa450edef68
2017-12-16 19:00:19 +00:00
Jacques Le Roux 40e8be83df Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

This completes r1818010, there were much more cases.
Also few tabs automatically replaced by spaces

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818020 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 14:11:38 +00:00
Jacques Le Roux e0d2057456 Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

We discussed on this point: http://markmail.org/message/mplvusuqn7oshl4v 
and we agreed about better doing a check when using Debug.logVerbose().

I checked there are 300+ cases like that. Since it's an easy S/R 
This implements it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818005 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:43:05 +00:00
Jacques Le Roux 557a6194d5 No functional changes, removes useless code
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817701 13f79535-47bb-0310-9956-ffa450edef68
2017-12-10 11:44:28 +00:00
Jacques Le Roux bfd533ccc3 Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

No functional change.

We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html : 
<<Using the integer fields in this class (such as ROUND_HALF_UP) to represent 
rounding mode is largely obsolete; the enumeration values of the RoundingMode 
enum, (such as RoundingMode.HALF_UP) should be used instead.>>

That's an easy global replacement. But it also needs to import the RoundingMode 
class. It was 26 files so I decided to rather clean all the imports in all files
 with the help of Eclipse.

This is a 1st step. I will need to closely look at 2 special class: UtilNumber
and Calculate.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 08:32:21 +00:00
Jacques Le Roux b372360a85 Fixed: Wiki restructure issues
(OFBIZ-9416)

Replaces a bunch of deprecated links

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1799241 13f79535-47bb-0310-9956-ffa450edef68
2017-06-19 17:26:23 +00:00
Jacques Le Roux 93dc619f0a No functional changes.
Replaces EntityListIterator.close() in finally by try-with-ressource

I think I have done all these kinds of changes. This is tested.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798571 13f79535-47bb-0310-9956-ffa450edef68
2017-06-13 09:48:49 +00:00
Jacques Le Roux 60ebed29f1 Fixed: compareBigDecimals in org.ofbiz.minilang.method.conditional.Compare
does not compare certain values correctly
(OFBIZ-6386)

compareBigDecimals scales down and rounds up meaning you lose information and 
the comparison result is not as expected

Thanks: Gareth Carter for the patch, Mridul Pathak and Jacopo for discussing the
topic in all details (see the Jira issue)

I'm not yet sure but maybe this has revealed some hidden issues in test, see https://ci.apache.org/projects/ofbiz/logs/trunk/html/

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1786079 13f79535-47bb-0310-9956-ffa450edef68
2017-03-08 21:27:30 +00:00
Jacques Le Roux b9f2477708 Fixed: SimpleMethod: FindByAnd never using EntityListIterator
(OFBIZ-9152)

Since the introduction of EntityQuery there was no distinction between a simple 
method tags 
<find-by-and use-iterator="true"> and <find-by-and use-iterator="false"> 
(except cache handling).
There is a condition "if (useIterator)" but with entityQueries did use 
"[...].queryList()".

Thanks: Mirko Vogelsmeier

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1782498 13f79535-47bb-0310-9956-ffa450edef68
2017-02-10 18:46:04 +00:00
Jacques Le Roux b057011c26 No functional change, reverts r1781366
I did not even notice I committed this bunch of WIP stuff. I guess I clicked 
somewhere while my machine was too buzy

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781367 13f79535-47bb-0310-9956-ffa450edef68
2017-02-02 10:54:06 +00:00
Jacques Le Roux e130654d28 No functional change, this was reverted in r1781367
I did not even notice I committed this bunch of WIP stuff. I guess I clicked 
somewhere while my machine was too buzy



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781366 13f79535-47bb-0310-9956-ffa450edef68
2017-02-02 10:33:59 +00:00
Michael Brohl 945a8afd9c Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774922 13f79535-47bb-0310-9956-ffa450edef68
2016-12-18 18:12:21 +00:00
Taher A. Alkhateeb 71f512a0d2 Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

This is the first commit to the above mentioned issue which fixes many javadoc
errors dispersed through the different components. The fixes are not
necessarily improvements to the javadocs but rather making them valid javadocs
to prevent reporting errors from gradle


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774154 13f79535-47bb-0310-9956-ffa450edef68
2016-12-14 09:22:32 +00:00
Jacques Le Roux 07c0264392 Fixed: SimpleMethod: Problem with Variables in key-fields
(OFBIZ-9126)

I found that issue using ContactMechServices for updateContactMech:
The default-message is dynamically set regarding to what contactMechType you are
 using.
The problem was that the variable in property-field was never evaluated as that.

Thanks: Mirko Vogelsmeier

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1771440 13f79535-47bb-0310-9956-ffa450edef68
2016-11-26 09:02:11 +00:00
Arun Patidar 80498ef38d Implemented: Refer to objects by their interfaces rather than class when instantiating Collection implementation classes in Java files
(OFBIZ-9023) (OFBIZ-9026)(OFBIZ-9027)(OFBIZ-9032)(OFBIZ-9034)(OFBIZ-9036)(OFBIZ-9030)

Thanks: Divesh Dutta, Amit Gadaley and Shubham Agrawal for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768189 13f79535-47bb-0310-9956-ffa450edef68
2016-11-05 11:16:49 +00:00
Deepak Dixit b150af15ea Improved: UtilValidate isEmpty and isNotEmpty methods not used correctly
(OFBIZ-8413)

Thanks Pawan Verma for your contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1766868 13f79535-47bb-0310-9956-ffa450edef68
2016-10-27 19:21:41 +00:00
Jacques Le Roux 7e5a0db5df No functional change, renames files:
conditional.xml to conditionalLabels.xml
DefaultMessages.xml to DefaultMessagesLabels.xml
EmailPassword.xml to EmailPasswordLabels.xml
Found while working on OFBIZ-8321

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1764261 13f79535-47bb-0310-9956-ffa450edef68
2016-10-11 14:56:49 +00:00
Jacopo Cappellato a9835e4825 Improved: Removal of support for the Bean Scripting Framework (BSF).
(OFBIZ-8224)

This commit removes the support for the Bean Scripting Framework (BSF) from the OFBiz framework:
no application code was using this since several years and there are better and more modern tools at the present time.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760384 13f79535-47bb-0310-9956-ffa450edef68
2016-09-12 14:53:47 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Taher A. Alkhateeb b37ef2d280 Migrate ALL java files from /src to /src/main/java - OFBIZ-7790
This is the first of two steps in the above mentioned JIRA. This
first step changes the java source directory for every component
from /src to /src/main/java. The next step will be adding unit
tests to every component in /src/test/java

Thank you to Deepak Dixit for tips on how to use the SVN commands
to make the appropriate file moving.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752838 13f79535-47bb-0310-9956-ffa450edef68
2016-07-15 14:17:14 +00:00