[
https://issues.apache.org/jira/browse/OFBIZ-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15283467#comment-15283467 ]
Taher Alkhateeb commented on OFBIZ-6783:
----------------------------------------
Hi jacques, after further checking on the code, I suspect that start-batch and start-debug are both identical to start. The difference really is in the way it is called from ant. For example, in start-debug the real difference is in the JVM args passed, and the real difference in start-batch is in the spawn="true" ant attribute which spawns a new process for executing ofbiz.
It seems my refactoring is bringing to light a lot of old abandoned and ugly code. This just shows you how extremely nasty the old code is.
Anyway, I am inclined initially to delete the --batch and --debug targets completely both from build.xml and from Java code while keeping the ant targets but changing the argument to --start for both of them.
Any thoughts?
> Refactor start.java
> -------------------
>
> Key: OFBIZ-6783
> URL:
https://issues.apache.org/jira/browse/OFBIZ-6783> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Upcoming Branch
> Reporter: Taher Alkhateeb
> Assignee: Taher Alkhateeb
> Labels: framework, main, refactoring, start
> Attachments: OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, OFBIZ-6783.patch, StartCommandUtil.java
>
>
> Looking at the main method and design of Start.java looks ugly. The things I would like to fix so far are:
> - the file is too long
> - some variables are not even needed (loaderArgs?)
> - the level of abstraction is wrong
> - main throws an exception!
> - the arguments processing logic is terrible, need to move it to commons-cli
> It's just so messy and ugly to look at. So for me refactoring starts at Start! Given that this is an important file, I will provide a patch to be reviewed by the community before committing just to be on the safe side.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)