Commit Graph
85 Commits
Author SHA1 Message Date
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
Michael Brohl 89b36c49a8 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.
(OFBIZ-9716)

I modified the patch slightly.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813640 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 15:19:56 +00:00
Michael Brohl 972cf88c01 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.condition.
(OFBIZ-9713)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813633 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 14:10:07 +00:00
Michael Brohl e687edb25f Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.finder.
(OFBIZ-9712)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813632 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 13:39:24 +00:00
Michael Brohl e3665de1f2 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.cache.
(OFBIZ-9711)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813631 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 13:36:26 +00:00
Michael Brohl 8392d41d95 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.transaction.
(OFBIZ-9707)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812915 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:27:03 +00:00
Michael Brohl a886588282 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.test.
(OFBIZ-9706)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812912 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:07:12 +00:00
Michael Brohl dfbf625956 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.entity.serialize.
(OFBIZ-9705)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812910 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:03:31 +00:00
Jacques Le Roux a27122f819 Improved: Using try-with-resources with JDBC objects
(OFBIZ-9839)

Use try with resources for SQL objects like ResultSet and other objects. 
SQL classes have AutoCloseable interface.

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812466 13f79535-47bb-0310-9956-ffa450edef68
2017-10-18 07:56:49 +00:00
Deepak Dixit 2a8a37f308 Improved: Manage life span of SecurityGroupPermission entity.
Applied patch from jira issue(OFBIZ-9801) Thanks Suraj Khurana for your contribution


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812383 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 10:47:47 +00:00
Deepak Dixit 0bff35af99 Inconsistent String Comparisons, Applied patch for framework entity classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812257 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 08:25:33 +00:00
Jacques Le Roux 8f74333bc3 Improved: Implement AutoCloseable interface in SQLProcessor Class
(OFBIZ-9841)

Added AutoCloseable interface to SQLProcessor class and overridden Close method
Added closing of ResultSet, PreparedStatement and Connection Objects.
While calling SQLProcessor object in GenericDAO used Try-with-Resources and 
removed unnecessary calls of the same object before actual use, also removed 
finally blocks for method invocation. 

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812144 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 15:32:38 +00:00
Jacques Le Roux 20e8b43214 Improved: Using try-with-resources with JDBC objects
(OFBIZ-9839)

Use try with resources for SQL objects like ResultSet and other objects. 
SQL classes have AutoCloseable interface.

Thanks: Pradhan Yash Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812104 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 10:18:48 +00:00
Jacques Le Roux 793f6c586a Reverted: Bug SQL Count Distinct command in GenericDAO.java
(OFBIZ-5701)

Reverts
trunk r1804319
R16.11 r1804320
R15.12 r1804321
R14.12 r1804322
R13.07 r1804323

This raised 2 issues:
  MSSQL as reported by Wei Zhang in OFBIZ-9676
  Dynamic View Entities as reported by Pawan Verma in OFBIZ-5701

I asked kieuanhvu to see if he can provide a new patch taking these 2 issues in
consideration


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1810054 13f79535-47bb-0310-9956-ffa450edef68
2017-09-29 06:21:16 +00:00
Jacques Le Roux 29a3f4d2f1 Fixed: NullPointerException when calling EntityQuery#getFieldList
(OFBIZ-9624)

When performing EntityQuery#getFieldList without specifying distinct a 
NullPointerException is thrown, because of the condition if (this.distinct). 
It implicitly calls this.distinct.booleanValue() which throws the exception if 
distinct is null.

Thanks: Tobias Laufkötter

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806220 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 19:49:15 +00:00
Taher A. Alkhateeb 3806cad490 Refactor OFBiz containers and remove StartupCommandToArgsAdapter
(OFBIZ-9441)

A major refactoring patch that applies the following changes:

- Fully refactor the EntityDataLoadContainer
- Fully refactor the TestRunContainer
- In both above mentioned containers the logic is broken up into smaller
  methods to enhance code readability. It also changes the signature of
  the method calls to rely on StartupCommand instead of String[] arrays
- Remove most old documentation and commented out code where applicable
- Delete the StratupCommandToArgsAdapter as it is no longer needed
- Create a new feature in which OFBiz by default fails if any data file
  fails to load. This can be overridden by passing a flag called
  "continue-on-failure" e.g. ./gradlew "ofbiz --load-data continue-on-failure"
- Add a new property to --test called "loglevel" (old code but working properly)
- Add many new properties to the --load-data command including repair-columns,
  try-inserts, maintain-txs, etc ... These properties are old, but somehow
  did not make it into the command line arguments. This code is now exposed
  through the command line to set a direction in the future of whether to
  keep or delete these extra commands
- Update the documentation output of ./gradlew "ofbiz --help" to incorporate
  the new mentioned properties
- Refactor README.md to incorporate the changes to the gradle commands for both
  "-load-data" and "-test" properties. Also remove the gradle GUI
  documentation as it is now deprecated.
- Also refactor README.md in other locations to cleanup and make it more
  consistent. This icludes moving long notes into new sections and reducing
  the verbosity of the security header. Furthermore, created a new header
  called Miscellaneous documentation to house the newly created sections
- lots of small changes to remove EOL white space

Thanks: Jacques Le Roux for reviewing and testing


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805947 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 18:56:15 +00:00
Jacques Le Roux d6b89bc509 Fixed: Collection added to itself
(OFBIZ-9578)

In a recent github mirror, I've found suspicious code.
Branch: master
path: framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

...
1588         protected final List<String> messages = new LinkedList<String>();
...
1596         protected int updateData(Collection<String> messages) {
1597             if (messages != null && UtilValidate.isNotEmpty(this.messages)) {
1598                 messages.addAll(messages);
1599             }
1600             return count;
1601         }
1602     }

In Line 1598, `messages.addAll' should be `this.messages.addAll'? 
This might not be an issue but I wanted to report this just in case.

Thanks: JC (jaechang.nam@gmail.com)for report 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805143 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 07:41:31 +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
Nicolas Malin 082d629aa9 Implemented: Connect OFBiz to a read only database (OFBIZ-6401)
Add a DAO helper class to use a datasource as readonly
This helper is disable by default. To enable it change the helper class on your datasource use in entityengine.xml like

    <datasource name="localderby"
            helper-class="org.ofbiz.entity.datasource.ReadOnlyHelperDAO"
            schema-name="OFBIZ" ...



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804826 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 17:09:08 +00:00
Nicolas Malin 8deead6052 Fixed: Related to the issue OFBIZ-6401Connect OFBiz to a read only database
Escape null pointer exception stack trace when the helper return no value 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804824 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 17:02:34 +00:00
Jacques Le Roux f1fb12bd0b Improved: Refactor EntityListIterator
(OFBIZ-9549)

The EntityListIterator contains duplicate code and has need for refactoring in 
general.

Thanks: Tobias Laufkötter

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804328 13f79535-47bb-0310-9956-ffa450edef68
2017-08-07 12:43:54 +00:00
Jacques Le Roux 82ce693f5a Fixed: Bug SQL Count Distinct command in GenericDAO.java
(OFBIZ-5701)

jleroux: Kieuanhvu's explanation was not totally clear. So I rather provide
Renuka Srishti's at OFBIZ-9428 "getResultsSizeAfterPartialList() return wrong 
count with distinct() for View Entity"

Here is the code sample to test the issue:

EntityListIterator productAssocListItr = null;
productAssocListItr = from("ProductAndAssoc").distinct().queryIterator();
productAssocListSize = productAssocListItr.getResultsSizeAfterPartialList();

productAssocListSize will differ from the actual distinct records in the 
ProductAndAssoc View Entity.
This issue exists because it gives distinct records on the basis of the 
first column in the table.

Thanks: Kieuanhvu for the patch, Renuka Srishti for a clear explanation and a 
simple way to test (in a groovy for me)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804319 13f79535-47bb-0310-9956-ffa450edef68
2017-08-07 10:40:32 +00:00
Deepak Dixit ca74d2496a Improved: Remove unnecessary field types (OFBIZ-9351)
Applied patch from jira issue, also removed -ne field refereces from code.

Thanks Aditya Sharma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804031 13f79535-47bb-0310-9956-ffa450edef68
2017-08-03 18:11:45 +00:00
Deepak Dixit 5f54acf159 Fixed: Corrected condition to ignore type check for datetime and time field.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1803025 13f79535-47bb-0310-9956-ffa450edef68
2017-07-26 08:14:17 +00:00
Deepak Dixit bedad64f14 Fixed: Added check to avoid datetime and time field warning (OFBIZ-9496)
The warning message generated by OFBiz is a false positive caused by the fact that the way OFBiz performs the check is too simplistic: OFBiz parses for the content of the "()" in the fieldtype mapping and assumes that it is the column size.
However, in MySQL and possibly other database management systems, this is only true for varchar field definitions but not for datetime fields.
The column size for DATETIME(3) is not 3.
We should probably refactor the code in DatabaseUtil to compare the SQL field type from the JDBC driver, if possible to retrieve, (i.e. from the database) with the whole content (without any sting manipulation) of the attribute sql-type of the element field-type-def type (in fieldtype*.xml) i.e. "DATETIME(3)"; if they differ then a warning should be printed.
In this way we will have a more generic, simpler and more reliable tool to spot differences in the database

This is a workaround to fix the warning.
Thanks Jacopo.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802693 13f79535-47bb-0310-9956-ffa450edef68
2017-07-22 13:14:43 +00:00
Nicolas Malin 7d3ad82758 Improved: for EntityQuery.findOne() with context,
Instead of iterating fields, used GenericPk class object to get the PK fileds from parameters/fieldMap.
Thanks Deepak for this nice improvement

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802684 13f79535-47bb-0310-9956-ffa450edef68
2017-07-22 12:23:59 +00:00
Nicolas Malin 3080813151 Improved: Improve EntityQuery.queryOne() function to resolve a record by auto matching the primary key on a given context. (OFBIZ-9447)
Like that :
     GenericValue product = from('Product').where(context).queryOne()
This improvement simulate the minilang element <entity-one entity-name=Product value-name=product/> for helping the minilang migration to groovy
Thanks Jacopo to help the conception, Taher for the review

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802660 13f79535-47bb-0310-9956-ffa450edef68
2017-07-22 09:02:44 +00:00
Jacques Le Roux df46ff51de No functional change
Improves the documentation of few methods which return an EntityListIterator

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798495 13f79535-47bb-0310-9956-ffa450edef68
2017-06-12 17:20:36 +00:00
Jacques Le Roux 29a55bc4b0 No functional change, just a debug log change
As mentioned by Scott on dev ML the stack trace at this point is irrelevant

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798422 13f79535-47bb-0310-9956-ffa450edef68
2017-06-12 07:35:54 +00:00
Jacques Le Roux b291ec839b No functional change.
Adds a suggestion to report in case of EntityListIterator Not Closed

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798104 13f79535-47bb-0310-9956-ffa450edef68
2017-06-08 18:39:23 +00:00
Jacques Le Roux d9a24d5a34 This fixes a bug introduced with r1797097
As noted in code the EntityListIterator was not closed for a "good" reason: it
might be used later by the framework though not passed as a var. I think I found
1 case where it's closed after the returned list have been used (in 
EntityAnd.getChildren() in ModelTree.java); but I have to check the whole thing

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798086 13f79535-47bb-0310-9956-ffa450edef68
2017-06-08 16:16:29 +00:00
Jacques Le Roux 004cd686b2 No functional change,
Improves EntityListIterator.close() warning

It was something like

ContentAssoc] has already been closed, not closing again.

It's now properly

This EntityListIterator for Entity [ContentAssoc] has already been closed, 
not closing again.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797356 13f79535-47bb-0310-9956-ffa450edef68
2017-06-02 09:49:32 +00:00
Jacques Le Roux 842e1b21cd No functional changes.
Replaces entityListIterator.close() in finally by try-with-ressource

This is a weirdo badly written double case but with some refactoring 
I can confirm it works at 
https://localhost:8443/facility/control/ViewFacilityInventoryByProduct
which uses the getProductInventoryAndFacilitySummary service

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797161 13f79535-47bb-0310-9956-ffa450edef68
2017-06-01 08:18:48 +00:00
Jacques Le Roux 12ecb8926f Improved: EntityListIterator closed but not in case of exception
(OFBIZ-9385)

This is an improvement only because no cases were reported. But obviously in 
case of unlucky exception after the EntityListIterator creation and before it's 
closed the EntityListIterator remains in memory. 
It should be closed in EntityListIterator.finalize() but the less happens there 
the better.

The solution is to use try-with-ressources

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797160 13f79535-47bb-0310-9956-ffa450edef68
2017-06-01 08:14:41 +00:00
Jacques Le Roux e49d09f7dd No functional changes.
Replaces entityListIterator.close() in finally by try-with-ressource

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797097 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 18:43:05 +00:00