Skip to content

Commit

Permalink
Fixed some sonar issues
Browse files Browse the repository at this point in the history
Signed-off-by: pierantoniomerlino <[email protected]>
  • Loading branch information
pierantoniomerlino committed Sep 3, 2024
1 parent 47390ca commit 89b6d07
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ protected void setConfigurationService(ConfigurationService configurationService
}

protected void unsetConfigurationService(ConfigurationService configurationService) {
this.configurationService = null;
if (this.configurationService.equals(configurationService)) {
this.configurationService = null;
}
}

private void startDefaultDbServiceInstance() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ public void setCryptoService(CryptoService cryptoService) {
}

public void unsetCryptoService(CryptoService cryptoService) {
this.cryptoService = null;
if (this.cryptoService.equals(cryptoService)) {
this.cryptoService = null;
}
}

// ----------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,7 @@ private void computeUrlParts() {
}
}

if ("mem".equals(protocol)) {
this.isInMemory = true;
} else if ("file".equals(protocol)) {
this.isFileBased = true;
} else if ("zip".equals(protocol)) {
this.isZipBased = true;
} else {
this.isRemote = true;
}
parseProtocol(protocol);

this.baseUrl = "jdbc:h2:" + protocol + ':' + url;

Expand All @@ -130,6 +122,18 @@ private void computeUrlParts() {
this.isFileBasedLogLevelSpecified = FILE_LOG_LEVEL_PATTERN.matcher(this.dbUrl).find();
}

private void parseProtocol(String protocol) {
if ("mem".equals(protocol)) {
this.isInMemory = true;
} else if ("file".equals(protocol)) {
this.isFileBased = true;
} else if ("zip".equals(protocol)) {
this.isZipBased = true;
} else {
this.isRemote = true;
}
}

public String getDbUrl() {
return this.dbUrl;
}
Expand Down

0 comments on commit 89b6d07

Please sign in to comment.