[
https://issues.apache.org/jira/browse/OFBIZ-6783?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Taher Alkhateeb updated OFBIZ-6783:
-----------------------------------
Attachment: OFBIZ-6783.patch
Hey everyone, please check this patch, I've done the following so far:
- remove private comments relating to the class to the JavaDoc location at the top of the class
- relocate class fields to the top of the class as per Java conventions
- relocate the constructor with its singleton instance to the top of the class below the fields
- sort all the methods starting with main, followed by public, default and private
- add JavaDoc to main
- remove System.exit(99) from main and replace it with throw new StartException(e); I did this because main declares that it throws a StartupException which it never does
- breakup the logic part to evaluate ofbiz command to a new method called evaluateOfbizCommand(String[] args). I will replace this eventually with apache commons-cli
- make startStartLoaders private, since it is not called outside Start.java
> 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
>
>
> 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)