Skip to content

Commit

Permalink
Fix quality flaws
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Brandhof committed Mar 31, 2015
1 parent c162474 commit 3256510
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Expand Up @@ -110,8 +110,9 @@ private void configurePlugins(ImmutableSettings.Builder builder) {
}

private void configureNetwork(ImmutableSettings.Builder builder) {
String host = props.value(ProcessProperties.SEARCH_HOST);
Integer port = props.valueAsInt(ProcessProperties.SEARCH_PORT);
// the following properties can't be null as default values are defined by app process
String host = props.nonNullValue(ProcessProperties.SEARCH_HOST);
int port = Integer.parseInt(props.nonNullValue(ProcessProperties.SEARCH_PORT));
LOGGER.info("Elasticsearch listening on {}:{}", host, port);

// disable multicast
Expand Down
Expand Up @@ -347,10 +347,11 @@ private List<ActiveRuleChange> cascadeDeactivation(ActiveRuleKey key, DbSession
List<ActiveRuleChange> changes = Lists.newArrayList();
RuleActivatorContext context = contextFactory.create(key.qProfile(), key.ruleKey(), dbSession);
ActiveRuleChange change;
if (context.activeRule() == null) {
ActiveRuleDto activeRuleDto = context.activeRule();
if (activeRuleDto == null) {
return changes;
}
if (!force && !isCascade && context.activeRule().getInheritance() != null) {
if (!force && !isCascade && activeRuleDto.getInheritance() != null) {
throw new BadRequestException("Cannot deactivate inherited rule '" + key.ruleKey() + "'");
}
change = ActiveRuleChange.createFor(ActiveRuleChange.Type.DEACTIVATED, key);
Expand Down
Expand Up @@ -152,7 +152,6 @@ String defaultSeverity() {
return rule.getSeverityString();
}

@CheckForNull
Map<String, ActiveRuleParamDto> activeRuleParamsAsMap() {
return activeRuleParams;
}
Expand Down

0 comments on commit 3256510

Please sign in to comment.