Skip to content

Commit

Permalink
rename classname and method name
Browse files Browse the repository at this point in the history
  • Loading branch information
liangl authored and liangl committed Jun 27, 2019
1 parent c91b963 commit d401c2f
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.util.Objects;


/**
* @author Eric Zhao
* @since 1.6.0
Expand Down Expand Up @@ -48,12 +49,18 @@ public int getMatchStrategy() {

@Override
public boolean equals(Object o) {
if (this == o) { return true; }
if (o == null || getClass() != o.getClass()) { return false; }
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

ApiPathPredicateItem that = (ApiPathPredicateItem)o;
ApiPathPredicateItem that = (ApiPathPredicateItem) o;

if (matchStrategy != that.matchStrategy) { return false; }
if (matchStrategy != that.matchStrategy) {
return false;
}
return Objects.equals(pattern, that.pattern);
}

Expand All @@ -67,8 +74,8 @@ public int hashCode() {
@Override
public String toString() {
return "ApiPathPredicateItem{" +
"pattern='" + pattern + '\'' +
", matchStrategy=" + matchStrategy +
'}';
"pattern='" + pattern + '\'' +
", matchStrategy=" + matchStrategy +
'}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ private static void initialize() {
}

private static void loadProps() {
Properties properties = SentinelConfigLocator.locateProperties();
Properties properties = SentinelConfigLoader.getProperties();
for (Object key : properties.keySet()) {
setConfig((String) key, (String) properties.get(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@
* @author lianglin
* @since 1.7.0
*/
public class SentinelConfigLocator {
public class SentinelConfigLoader {


private static final String DIR_NAME = "logs" + File.separator + "csp";
private static final String USER_HOME = "user.home";

private static String SENTINEL_CONFIG = "csp.sentinel.config.file";
public static final String SENTINEL_CONFIG = "csp.sentinel.config.file";
private static String DEFAULT_SENTINEL_CONFIG_FILE = "sentinel.properties";


private static Properties properties = new Properties();

static {
locate();
load();
}


private static void locate() {
private static void load() {

String fileName = System.getProperty(SENTINEL_CONFIG);
if (StringUtil.isBlank(fileName)) {
Expand Down Expand Up @@ -87,8 +87,7 @@ private static void locate() {
}



public static Properties locateProperties() {
public static Properties getProperties() {
return properties;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private static void initialize() {

private static void loadProperties() {

Properties properties = LogConfigLocator.locateProperties();
Properties properties = LogConfigLoader.getProperties();

logOutputType = properties.get(LOG_OUTPUT_TYPE) == null ? logOutputType : properties.getProperty(LOG_OUTPUT_TYPE);
if (!LOG_OUTPUT_TYPE_FILE.equalsIgnoreCase(logOutputType) && !LOG_OUTPUT_TYPE_CONSOLE.equalsIgnoreCase(logOutputType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
* @author lianglin
* @since 1.7.0
*/
public class LogConfigLocator {
public class LogConfigLoader {


private static final String LOG_CONFIG = "csp.sentinel.config.file";
public static final String LOG_CONFIG = "csp.sentinel.config.file";

private static final String DEFAULT_LOG_CONFIG_FILE = "sentinel.properties";

Expand Down Expand Up @@ -70,10 +70,9 @@ private static void locate() {

}

public static Properties locateProperties() {
public static Properties getProperties() {
return properties;
}



}

0 comments on commit d401c2f

Please sign in to comment.