Skip to content

Commit

Permalink
Clean up logs and minimize get() operations on Optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gavin Killough committed Apr 30, 2018
1 parent 2d854bb commit 72d57c6
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private File[] runScan(final SimpleScanUtility simpleScanService) throws Illegal
}

private void printConfiguration(final HubScanConfig hubScanConfig, final ProjectRequest projectRequest) {
logger.alwaysLog(String.format("--> Log Level : %s", logger.getLogLevel().name()));
logger.alwaysLog(String.format("--> Log Level: %s", logger.getLogLevel().name()));
String projectName = null;
String projectVersionName = null;
String projectVersionPhase = null;
Expand All @@ -126,10 +126,11 @@ private void printConfiguration(final HubScanConfig hubScanConfig, final Project
private void preScan(final HubServerConfig hubServerConfig, final HubScanConfig hubScanConfig, final ProjectRequest projectRequest) throws IntegrationException {
final Optional<String> localHostName = HostNameHelper.getMyHostName();
if (localHostName.isPresent()) {
logger.info("Running on machine : " + localHostName);
final String hostNameString = localHostName.get();
logger.info("Running on machine: " + hostNameString);
printConfiguration(hubScanConfig, projectRequest);
final CurrentVersionView currentVersion = hubService.getResponse(ApiDiscovery.CURRENT_VERSION_LINK_RESPONSE);
cliDownloadService.performInstallation(hubScanConfig.getToolsDir(), ciEnvironmentVariables, hubServerConfig.getHubUrl().toString(), currentVersion.version, localHostName.get());
cliDownloadService.performInstallation(hubScanConfig.getToolsDir(), ciEnvironmentVariables, hubServerConfig.getHubUrl().toString(), currentVersion.version, hostNameString);
} else {
throw new IntegrationException("Unable to resolve the host name.");
}
Expand Down

0 comments on commit 72d57c6

Please sign in to comment.