[ 
https://issues.apache.org/jira/browse/GEODE-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16317803#comment-16317803
 ] 

Cyrille Artho commented on GEODE-3584:
--------------------------------------

I have attached another work-in-progress patch (GEODE-3584-WIP-3). 
Unfortunately, the Java type checker is not smart enough to handle chained 
method calls with inheritance gracefully. Some type casts could be avoided by 
using subclasses before base classes in chained method calls.
Overall, it would have been better to take a top-down approach and refactor the 
outer classes only at first, although the work to refactor the inner classes is 
still necessary. With probably several thousand LOC copy/pasted and sometimes 
edited, there is still a lot of work to be done.
Unfortunately, I'm running out of time to work on this. I'd be glad to push my 
changes to the server on a new branch, if I can get permission.

> Refactor ServerLauncher and LocatorLauncher to eliminate code duplication
> -------------------------------------------------------------------------
>
>                 Key: GEODE-3584
>                 URL: https://issues.apache.org/jira/browse/GEODE-3584
>             Project: Geode
>          Issue Type: Improvement
>          Components: gfsh
>    Affects Versions: 1.2.0
>            Reporter: Kenneth Howe
>         Attachments: GEODE-3584-WIP, GEODE-3584-WIP-2, GEODE-3584-WIP-3
>
>
> There is some duplication of code in the Launcher classes that can be 
> eliminated. Both classes have methods such as getBindAddress (called 
> getServerBindAddress in ServerLauncher) that could be hoisted into  
> AbstractLauncher class that they both extend. The same goes for the inner 
> State classes of the Launchers; they have methods that could be moved to 
> AbstractLauncher.ServiceState.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to