[
https://issues.apache.org/jira/browse/GEODE-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Cyrille Artho updated GEODE-3584:
---------------------------------
Attachment: GEODE-3584-WIP
I have started to refactor the "Builder" helper class, so common fields can be
shared.
Pros:
* Over 500 LOC were duplicated, including comments.
* Many fields and their accessors are now shared.
* In the long term, the code base will definitely be simpler.
Cons:
* Some work can't be done until GEODE-4183 is clarified/resolved.
* Java's typesystem requires now extra typecasts when chaining method calls and
a method specific to a subtype is used in a subsequent call in the chain.
* Slightly imperfect clones will require more work.
I have changed "Server/Locator" to "service", as this was used elsewhere when
referring to either implementation of the service launched by AbstractLauncher.
I have also made the camel case spelling of "hostName" consistent across all
the three classes, but this will require a few more adaptations elsewhere in
the code base.
Unfortunately, many compile errors are still to be resolved (in non-core code),
mainly through mechanical insertion of typecasts. Attached is a
work-in-progress patch vs. the current developer branch.
> 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
>
>
> 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)