Commit Graph
11 Commits
Author SHA1 Message Date
Jacopo Cappellato 8150cf2e2d Throw an exception rather than failing with a NPE if delegatorInfo is null: this can happen for example when the entityconfig.xml file is missing.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759372 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:18:01 +00:00
Jacopo Cappellato 4cbedfc518 Improved error message logged by DelegatorFactoryImpl.getInstance(...) when a delegator can't be created; added a TODO comment to remind that the code should be refactored to throw the exception instead.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759371 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:15:21 +00:00
Jacopo Cappellato 8fdaa37885 Fixed wrong module name in the DelegatorFactory class.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759370 13f79535-47bb-0310-9956-ffa450edef68
2016-09-06 07:12:28 +00:00
Shi Jinghai 5981061dcf OFBIZ-8137 Entityname starts with schema name causes error in PostgreSQL
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759155 13f79535-47bb-0310-9956-ffa450edef68
2016-09-04 08:57:44 +00:00
Jacques Le Roux 4dd6a0475b Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
No functional changes, simply use the try-with-resources statement everywhere it's possible, mostly to clean the finally statements and have consistent code

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759088 13f79535-47bb-0310-9956-ffa450edef68
2016-09-03 12:49:47 +00:00
Jacques Le Roux 38e9885d3d Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
At r1758927 I tried to fixe a bunch of closes missing, reported as warnings in Eclipse

Jacopo noticed and reported on dev ML http://markmail.org/message/b4hvzi7foftfq3j5 2 possible issues:
1) you are adding a close statement to code that already had the close statement in the "finally" block; your modification actually introduces a code pattern that is not correct (if an exception is thrown your close statement are not executed)
2) I suspect that you are closing the socket connection too early in PcChargeApi

1)The best option when closing resources (which implement AutoCloseable) is actually to use the try-with-resources statement. At least when there are no performance issues.
I have fixed the issue (only in DatabaseUtil.java) this way because
* there are not performance issues, we anyway create a Statement in both cases, we don't reuse one.
* The finally part is cleaner

I have also used the try-with-resources statement in other places where it fitted.

There is only 1 place where I was undecided: ScriptUtil.parseScript() which uses GroovyUtil.parseClass().
I put only a logError() there and returned null. 
I did not throw an IOException because else it spreads everywhere in FlexibleStringExpander.
Here introducing Optional would be better, but I have no time or that today.

2) was not a problem


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758951 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 13:18:35 +00:00
Jacques Le Roux 8bf34869da Reverts r1758927 to check issues reported by Jacopo on dev ML
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758935 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 10:47:30 +00:00
Jacques Le Roux 6636d4ae01 Fixes "a bunch of small leaks (closes missing, reported as warnings in Eclipse)" - https://issues.apache.org/jira/browse/OFBIZ-8115
Fixes a bunch of small leaks (closes missing, only warnings in Eclipse)
By-product: automatically sort few imports

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1758927 13f79535-47bb-0310-9956-ffa450edef68
2016-09-02 10:07:31 +00:00
Arun Patidar 3e7e7db27b Applied patch from jira issue - OFBIZ-7911 - Enforce noninstantiability to TransactionUtil class. Thanks Rishi Solanki and Pratik Kulshreshth for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1757962 13f79535-47bb-0310-9956-ffa450edef68
2016-08-27 07:56:48 +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