Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor BisqEnvironment #3362

Merged
merged 1 commit into from
Oct 15, 2019
Merged

Refactor BisqEnvironment #3362

merged 1 commit into from
Oct 15, 2019

Conversation

lusarz
Copy link
Contributor

@lusarz lusarz commented Oct 3, 2019

In this pull request I introduced private getProperty (PropertySource properties, String propertyKey, String defaultValue) method, to eliminate repetitions.

For example instead of:

logLevel = commandLineProperties.containsProperty(CommonOptionKeys.LOG_LEVEL_KEY) ?
            (String) commandLineProperties.getProperty(CommonOptionKeys.LOG_LEVEL_KEY) :
            LOG_LEVEL_DEFAULT;

I do:

logLevel = getProperty(commandLineProperties, CommonOptionKeys.LOG_LEVEL_KEY, LOG_LEVEL_DEFAULT);

@lusarz lusarz requested a review from ripcurlx as a code owner October 3, 2019 17:34
Copy link

@blabno blabno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@@ -205,158 +205,74 @@ public BisqEnvironment(OptionSet options) {
options)));
}

private String getProperty (PropertySource properties, String propertyKey, String defaultValue) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Uncle Bob it's good to keep public methods at the top, because they declare contract, while keeping private methods below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I moved it down.

Although there is a real mess in this file - public and private methods are mixed together :)

@ripcurlx
Copy link
Contributor

@lusarz Since another PR of yours got merged you have to resolve conflicts within this PR now.

@lusarz
Copy link
Contributor Author

lusarz commented Oct 14, 2019

@ripcurlx Resolved

@lusarz
Copy link
Contributor Author

lusarz commented Oct 15, 2019

@ripcurlx Merge ?

@ripcurlx ripcurlx merged commit 2178dbd into bisq-network:master Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants