Commit Graph
119 Commits
Author SHA1 Message Date
Deepak Dixit b7d0f87ae8 Improved: EntityUtilProperties.getProperties method should use cache.
(OFBIZ-10717)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849191 13f79535-47bb-0310-9956-ffa450edef68
2018-12-18 16:20:56 +00:00
Jacques Le Roux 47954445b4 Improved: Replace Callable objects with lambda expressions
(OFBIZ-10488)

Remove unused imports

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848744 13f79535-47bb-0310-9956-ffa450edef68
2018-12-12 11:07:01 +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
Jacques Le Roux 13f8b82f51 Improved: Replace Callable objects with lambda expressions
(OFBIZ-10488)

Since Java 8 it is possible to instantiate functional interfaces 
(interfaces with one non-static method) with lambda expressions instead 
of anonymous classes.

This replaces the creation of callable objects with lambda expressions.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848514 13f79535-47bb-0310-9956-ffa450edef68
2018-12-09 13:04:23 +00:00
Gil Portenseigne 699bbb9cf9 Improved: Rewrite EntityConditionVisitor interface to respect visitor Pattern
(OFBIZ-10593)

Remove visit methods from current EntityConditionBase type hierarchy.
Add or rewrite accept method in EntityCondition type hierachy.
Add documentation in EntityConditionVisitor, introducing implementation examples.
Add junit test validating documented examples.
Thanks to Mathieu Lirzin for your contribution, and Jacques for the review.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1843780 13f79535-47bb-0310-9956-ffa450edef68
2018-10-13 19:50:27 +00:00
Gil Portenseigne 3f23e45b7b Implemented: Refactor EntityUtil findBy methods using Stream API
(OFBIZ-10537)

Fixed variable name to make it more meaningful

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1839926 13f79535-47bb-0310-9956-ffa450edef68
2018-09-03 09:33:21 +00:00
Gil Portenseigne e316f2165d Implemented: Refactor EntityUtil findBy methods using Stream API
(OFBIZ-10537)

Thanks Jacques and Mathieu for the review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1839763 13f79535-47bb-0310-9956-ffa450edef68
2018-08-31 15:32:02 +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
Michael Brohl fc3c92f7d6 Fixed: Corrected wrong import introduced in 1813640.
Thanks Scott Gray for reporting.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836796 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 09:30:13 +00:00
Jacques Le Roux e20b34bc24 Implemented: Add a mechanism to prevent the usage of EntitySyncRemove
(OFBIZ-10008)

No configurations is available to disable usage of EntitySyncRemove. 
And it's creating problems when having a large database and frequent delete 
operations.

saveEntitySyncRemoveInfo is used to create EntitySyncRemove records in 
GenericDelegator.removeValue() and removeByPrimaryKey().

This adds a mechanism to prevent the usage of EntitySyncRemove by adding a 
property in general.properties file used to configure in entityengine.xml 






git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835296 13f79535-47bb-0310-9956-ffa450edef68
2018-07-07 07:46:04 +00:00
Rishi Solanki 8430ac5cc3 Improved: Generic message from entity-auto service can be enhanced. For example ProductStoreFacility Updated Successfully, we can have better success message as Product Store Facility Updated Successfully.
(OFBIZ-10409)
Thanks Suraj Khurana for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832309 13f79535-47bb-0310-9956-ffa450edef68
2018-05-26 13:00:56 +00:00
Jacques Le Roux 9e41a4a174 Improved: EntityUtilProperties
(OFBIZ-7112)

Remove useless redundant code.

results map is already initialised in the beginning with isExistInDb 
as "N" and value as "".
These values only changed when systemProperty != null. S
o except for this condition if we return results at any point it will have 
isExistInDb as "N" and value as "". 
If we remove the lines I removed in the patch, it will only remove put 
operations that are not necessary.

Thanks: Aditya

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1828217 13f79535-47bb-0310-9956-ffa450edef68
2018-04-03 10:51:29 +00:00
Jacques Le Roux 030b6b59de Fixed: EntitySaxReader mostly-insert (store after create-error) Fix
(OFBIZ-1032)

Karl:
Avoids rollback on create error to be able to store the entity instead 
(previous mostly-inserts feature).

Matin:
I think, the data load with "mostly inserts" activated should fail on a 
create-failure (what it does indeed already), so I see no need for a working 
solution of a fallback store attempt. Consistently the Feature should be renamed 
in the frontend from "mostly inserts" to "only inserts".

Kyra:
Additional trivial refactoring in the patch: I reduced the full qualified 
classname of org.xml.sax.SAXException in method signatures to the simple name.

This incorperates the changes that Martin has mentioned above. 
The unnecessary call to store() is removed, simplifying the process of creating 
and deleting entities. (These changes were already in Martins old patch but had 
the wrong format.) This means that the flag "mostly Inserts?" is not accurately 
worded since as long as there is only create fail, all operations are rolled 
back. So the second patch renames the flag and all appropriate parameters to 
"onlyInserts". 

jleroux: I made few no functional changes, apart not swallowing an exception

Thanks: Thanks Karl for the 1st patch, Martin to get further, and Kyra to 
complete the whole with a final touch and help to quickly test

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822310 13f79535-47bb-0310-9956-ffa450edef68
2018-01-26 15:13:42 +00:00
Deepak Dixit 47837aad8a Improved:Removed unused import.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822125 13f79535-47bb-0310-9956-ffa450edef68
2018-01-24 17:26:12 +00:00
Deepak Dixit fb77a3c477 Improved: Logging: change all System.out/.err/.. println to Debug.log... in the code base (OFBIZ-10045)
Thanks Michael Brohl and Kyra Pritzel-Hentley for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819124 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 09:08:04 +00:00
Michael Brohl 50c4bba4b2 Improved: Replace all "e.printStackTrace();" by calls to the Debug class.
(OFBIZ-10083)

Thanks Jacques Le Roux for reporting and Kyra Pritzel-Hentley 
for providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818921 13f79535-47bb-0310-9956-ffa450edef68
2017-12-21 12:33:04 +00:00
Michael Brohl f3a43c5c9e Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.cache.
(OFBIZ-9949)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818478 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 11:34:39 +00:00
Michael Brohl dd64039161 Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.serialize.
(OFBIZ-9951)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818476 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 11:27:15 +00:00
Michael Brohl b1bf88f68f Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.test.
(OFBIZ-9952)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818475 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 11:25:11 +00:00
Michael Brohl fc3c0d3780 Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.finder.
(OFBIZ-9953)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818474 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 11:19:19 +00:00
Michael Brohl f48b282587 Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.condition.
(OFBIZ-9956)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818469 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 10:37:49 +00:00
Michael Brohl 1cca5dc166 Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.
(OFBIZ-9957)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818468 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 09:56:54 +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
Michael Brohl b41f78ae1a Improved: General refactoring and code improvements, package
org.apache.ofbiz.entity.transaction.
(OFBIZ-9962)

I added some additional debug conditions.

Thanks Dennis Balkir for reporting and providing the patches.

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

This completes r1818075, there were still few cases, a last regexp search is 
never too much :)

Found 4 other loops with Strings concatenation, but who cares, it's only 
verbose logging...

There should not be anymore...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818077 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 22:37:16 +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 24b92d6921 Improved: Always check if debug verbose is on when using Debug.logVerbose()
(OFBIZ-10052)

As spotted by Nicolas and reported on dev ML there was a case w/ a double check
This removes it

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818010 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 13:09:52 +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
Deepak Dixit 7e19de9966 Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818003 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 12:03:17 +00:00
Deepak Dixit 63258e90f8 Reverted r#1817989, workign fine locally, reverted for now will check and commit again
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817998 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 10:42:32 +00:00
Deepak Dixit d1f85a7e5d Improved: Replace all delegator findByAnd and findOne method calling by EntityQuery methods (OFBIZ-10029)
Applied slightly modified patch, rearrange import properly, 
Thanks Suraj Khurana for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817989 13f79535-47bb-0310-9956-ffa450edef68
2017-12-13 09:21:33 +00:00
Jacques Le Roux c872ac1813 No functional change, damned hard day reviewing, these formattings I wanted to
keep 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817803 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 18:06:40 +00:00
Jacques Le Roux eb39aa5420 Removes some formatting which were also automated (w/o my consent, I must have
missed it at some point :/)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817799 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 17:35:42 +00:00
Jacques Le Roux a608c7ded1 No functional change, redo some formatting by hand to make code more legible
They obviously have been done with automated formatting (big formatted block).
Someone should check it's formatting width notably for comments and maybe JavaDoc

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817798 13f79535-47bb-0310-9956-ffa450edef68
2017-12-11 17:33:27 +00:00
Jacques Le Roux b2810ccd5f No functional changes, simply formatting
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817700 13f79535-47bb-0310-9956-ffa450edef68
2017-12-10 11:41:59 +00:00
Michael Brohl c06f835668 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.jdbc.
(OFBIZ-9782)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817637 13f79535-47bb-0310-9956-ffa450edef68
2017-12-09 17:34:02 +00:00
Jacques Le Roux 0ab019569e No functional change, fixes a typo in comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817574 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 21:28:12 +00:00
Michael Brohl 6ff220a8ec Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.datasource.
(OFBIZ-9723)

Did some additional cleanup by removing commented out code.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817570 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 21:13:26 +00:00
Michael Brohl f56feb90fa Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.util.
(OFBIZ-9720)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817562 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 20:49:28 +00:00
Michael Brohl 4af8b2491d Improved: removed unnecessary condition check.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817561 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 20:48:14 +00:00
Michael Brohl a72f027892 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.model.
(OFBIZ-9719)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817559 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 20:18:41 +00:00
Michael Brohl c02d9de3ab Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.connection.
(OFBIZ-9718)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817552 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 19:44:27 +00:00
Michael Brohl 29d09d0cd5 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.config.model.
(OFBIZ-9717)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817550 13f79535-47bb-0310-9956-ffa450edef68
2017-12-08 19:38:12 +00:00
Jacques Le Roux c1a11e83ae Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

While reviewing r1812057 I spotted a bunch of swallowed ClassCastExceptions

I then reviewed all ClassCastExceptions and this fixes all of them with a 
minimal logging

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1815797 13f79535-47bb-0310-9956-ffa450edef68
2017-11-20 12:32:44 +00:00
Deepak Dixit 7976ea3ff3 Reverted: At r#1814155 RuntimeException was added to handle runtime exception as per pattern/best practise, but to maintain backward compatibility we need to handle Exception instead of throwing it.
Reason: When the field is encrypted with the old algorithm (3-DES), the new Shiro code will fail to decrypt it (using AES) and then it will
throw an org.apache.shiro.crypto.CryptoException that is a RuntimeException.
For backward compatibility we want instead to catch the exception and decrypt the code using the old algorithm.
This has been discussed at https://s.apache.org/b520

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814704 13f79535-47bb-0310-9956-ffa450edef68
2017-11-09 05:45:47 +00:00
Jacques Le Roux 5b311d6be2 Fixed: EntityListIterator.getComplateList returns error randomly
(OFBIZ-9919)
Using a dynamic view entity containing groupBy clause and after calling 
getCompleteList method, I am getting an error and it got fixed when I removed 
that ArrayList sizing.
IMO, it might be occurring due to improper size initialization and I see no 
reason for this and it is handled in ArrayList dynamically.

jleroux: moreover there is not much gain for cases where the pre-allocation
makes sense

Thanks: Suraj Khurana

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814561 13f79535-47bb-0310-9956-ffa450edef68
2017-11-08 09:17:41 +00:00
Michael Brohl 4a698b614b Improved: Remove deprecated method
GenericDelegator.decryptFieldValue(String, String).
(OFBIZ-9916)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814327 13f79535-47bb-0310-9956-ffa450edef68
2017-11-04 22:23:20 +00:00
Michael Brohl fb12f1fb4d Fixed: Corrected wrong FindBugs/refactoring change introduced in
r1813640.
(OFBIZ-9716)

Thanks Suraj Khurana for reporting and Dennis Balkir for providing the
patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814230 13f79535-47bb-0310-9956-ffa450edef68
2017-11-03 17:47:41 +00:00
Jacques Le Roux 4785a20bb5 No functional change, completes r1813964 as suggested on dev ML
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814155 13f79535-47bb-0310-9956-ffa450edef68
2017-11-03 09:49:21 +00:00
Deepak Dixit 1738e721b8 Fixed: doDecrypt method may return ClassNotFoundException, BadPaddingException,so instead of handling GeneralException used Exception class to handle all exception
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813964 13f79535-47bb-0310-9956-ffa450edef68
2017-11-01 10:43:14 +00:00