Commit Graph
38 Commits
Author SHA1 Message Date
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
Jacopo Cappellato 92b5652156 Improved: cleaned up some old code without altering its functional behavior.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1790520 13f79535-47bb-0310-9956-ffa450edef68
2017-04-07 08:34:57 +00:00
Jacques Le Roux 16f0d33d79 Improved: Use try-with-resources statement wherever it's possible
(OFBIZ-8202)

Replace finally blocks closing EntityListIterator by 
try-with-resource, and refactors around

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1787949 13f79535-47bb-0310-9956-ffa450edef68
2017-03-21 12:20:55 +00:00
Jacques Le Roux 9b2209ef5d Fixed: Missing reference to the delegator in HtmlFormMacroLibrary.ftl
(OFBIZ-9230)

This has been temporarily fixed with r1784259. After a discussion on dev ML and
a code analysis reported in the Jira issue, I decided to follow Rishi Solanki's 
idea of using the delegatorName.

Since we have no context when executing a macro in the widget form, I decided 
to pass it to the macro. I had though to create an 
EntityUtilProperties.getPropertyValueFromDelegatorName() method to eventually 
pass the delegatorName. Two macros were concerned renderLookupField and 
renderTextField.

Note: while analysing the code I found that EntityExpr.checkRhsType() can face
a related kind of problem. I'll commit an improvement later...

Thanks: Wai for report and discussion and Rishi for pursuing his idea of using 
the delegatorName

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1785882 13f79535-47bb-0310-9956-ffa450edef68
2017-03-07 20:33:09 +00:00
Jacques Le Roux 18dfa2e799 No functional change, from Debug.Info to Debug.logError
More to test the Buildbot triggering

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1785485 13f79535-47bb-0310-9956-ffa450edef68
2017-03-04 13:44:30 +00:00
Jacques Le Roux 97a98e7d4c No functional change, related with "Missing reference to the delegator in
framework/widget/templates/HtmlFormMacroLibrary.ftl"
(OFBIZ-9230)

To reproduce

1. Load test data <SystemProperty systemResourceId="widget" 
systemPropertyId="widget.autocompleter.defaultMinLength" 
systemPropertyValue="3"/> 
2. Open https://localhost:8443/partymgr/control/main
3. You will still get warning below in log file


|EntityUtilProperties          |I| Could not get a system property for 
widget.autocompleter.defaultMinLength : null


jleroux: the reason is in the context of a FTL macro we lose the delegator 
(in context) when calling  
executeMacro(writer, sr.toString()); 
from 
MacroFormRenderer.renderTextField()
So we need to find a way to pass the delegator to be used when evaluating 
the Freemarker template. For now I have simply added a clearer explanation 
of the reason.

Thanks: Wei Zhang for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1784259 13f79535-47bb-0310-9956-ffa450edef68
2017-02-24 10:52:09 +00:00
Jacques Le Roux 49df69cdd6 No functional change, remove unused and failing EntityClassLoader
Relates with OFBIZ-6210

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1782943 13f79535-47bb-0310-9956-ffa450edef68
2017-02-14 09:57:00 +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
Michael Brohl 97ba34128e Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774815 13f79535-47bb-0310-9956-ffa450edef68
2016-12-17 23:34:51 +00:00
Jacopo Cappellato 635657bbc5 Fixed: removed a redundant null check and parenthesis.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773405 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 14:21:56 +00:00
Jacopo Cappellato bd40d8526f Fixed: a series of wrong argument names in Javadoc comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773338 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 08:49:56 +00:00
Paul Foxworthy 40119e0db0 [Improved]: Recognise BASE TABLE table type in database metadata (OFBIZ-7129)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1771995 13f79535-47bb-0310-9956-ffa450edef68
2016-11-30 06:42:42 +00:00
Paul Foxworthy 90c531b032 Fixed typo in error messages
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768808 13f79535-47bb-0310-9956-ffa450edef68
2016-11-09 00:44:27 +00:00
Divesh Dutta 8e8272b4fa Improvement: Generic value is null or not should be checked using native checks. Utility method isEmpty or isNotEmpty is not needed to check if generic value is null or not because generic values can never be empty. They can be null or not nulls. So made changes accordingly all over the places.
(OFBIZ-8471)

Thanks: Ratnesh Upadhyay for reporting the improvement and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768192 13f79535-47bb-0310-9956-ffa450edef68
2016-11-05 11:27:46 +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
Taher A. Alkhateeb d44020f0d6 Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

This is a major refactoring exercise to simplify the startup sequence in
OFBiz. There are no functional changes, however, both the logic and the
API signatures of the core classes in OFBiz are changed to help simplify
the startup sequence. The changes insofar are summarized as:

- Rename ContainerConfig.Container to ContainerConfig.Configuration, the old
  nameing was very confusing as it confuses it with actual containers
- Change the signature of ContainerLoader and Container to accept
  List<StartupCommand> instead of String[]. And also migrate the adapter for
  converting these args into a standalone class called
  StartupCommandsToArgsAdapter
- Remove the LockedBy annotation as it is not used
- Substantially simplify the ContainerLoader load and unload logic and delete
  the start logic (merge it with load). The interface StartupLoader was updated
  accordingly
- Remove old logic to load containers in hot-deploy components
- Remove printThreadDump output from ContainerLoader which used to exist for
  debugging purposes and is no longer necessary
- Cleanup the AdminServer startup logic
- Change the StartupControlPanel logic to use only one StartupLoader instead
  of a list. The only implementation is ContainerLoader
- Remove the synchronized blocks in StartupControlPanel due to having only one
  loader
- Update the startup .properties files to reflect the changes in the startup
  logic
- Update the TestRunContainer to use List<StartupCommand> in its logic

We expect more commits (specifically to the containers) to complete this
refactoring initiative



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1765127 13f79535-47bb-0310-9956-ffa450edef68
2016-10-16 09:07:08 +00:00
Jacques Le Roux b551796ad3 Improves: too much warning "Could not get a system property for..." in log
This should not be a warning but an info. Also I wonder if we really need to 
show all these, after all a default fallback should exist in a properties file

Still OFBIZ-7754 needs to be solved...


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763103 13f79535-47bb-0310-9956-ffa450edef68
2016-10-02 21:45:21 +00:00
Jacopo Cappellato 7370ea5409 Improved: added some missing license headers.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762238 13f79535-47bb-0310-9956-ffa450edef68
2016-09-25 21:25:02 +00:00
Jacopo Cappellato 27c7baaa26 Improved: made several fields and methods of EntitySaxReader private.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762080 13f79535-47bb-0310-9956-ffa450edef68
2016-09-23 18:52:40 +00:00
Jacopo Cappellato 6f8da4c08d Implemented: converted EntitySaxReader to use the default Sax reader instead
of the legacy implementation from Javolution; removed a bunch of unused or 
deprecated methods; created some unit tests to test the EntitySaxReader in 
isolation. Removed the dependency from Javolution since this was the last class 
dependent on it.
(OFBIZ-5169)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762079 13f79535-47bb-0310-9956-ffa450edef68
2016-09-23 18:23:23 +00:00
Jacques Le Roux dc7c438e9a Improves: Use try-with-resources statement wherever it's possible
(OFBIZ-8202)

These are a non functional changes for the accounting component
I forgot to commit the change in EntityListIterator.java, hence a lot of confusion, sorry guys

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761047 13f79535-47bb-0310-9956-ffa450edef68
2016-09-16 15:15:34 +00:00
Jacques Le Roux d642114ff7 Fixes: reverts r1760566, unfortunately in this commit I did not see that not only the ToirtoiseSvn was removed but also other pending changes where ticked (I did not, thanks ToirtoiseSvn to make me show silly :/)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760567 13f79535-47bb-0310-9956-ffa450edef68
2016-09-13 16:07:50 +00:00
Jacques Le Roux 47761c3f62 Completes: (no functionnal change) remove the ToirtoiseSvn template to avoid confusion for other possible users of ToirtoiseSvn. I keep my local change, not a bid deal, to be revisited...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760566 13f79535-47bb-0310-9956-ffa450edef68
2016-09-13 16:02:31 +00:00
Jacopo Cappellato 66554a45a5 Improved: Removed the "geronimo" component and moved GeronimoTransactionFactory into the "entity" component.
(OFBIZ-8179)

Without functional changes, this design removes a cyclic dependency between the "entity" and "geronimo" components.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1760376 13f79535-47bb-0310-9956-ffa450edef68
2016-09-12 14:09:00 +00:00
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