Skip to content

Commit

Permalink
♻️ : clean small code
Browse files Browse the repository at this point in the history
  • Loading branch information
cdubuisson committed Aug 1, 2019
1 parent 58735ee commit e3fac2d
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class TerraformCLIRepository {
private String terraformReleasesVersionMin;
private RestTemplate restTemplate;

private class CLIVersion {
private static class CLIVersion {
private short major;
private short minor;
private short patch;
Expand All @@ -50,8 +50,6 @@ public TerraformCLIRepository(
/**
* Returns acceptable Terraform CLI versions by scanning HashiCorp releases url for terraform.
* Versions lower than the one in parameter and non final versions are ignored.
*
* @return
*/
public List<String> listCLIVersion() {
var response = restTemplate.exchange(
Expand Down Expand Up @@ -103,9 +101,9 @@ private Optional<CLIVersion> getCLIVersion(String version) {
if (!matcher.matches()) {
return Optional.empty();
}
var result = new CLIVersion(Short.valueOf(matcher.group(1)),
Short.valueOf(matcher.group(2)),
Short.valueOf(matcher.group(3)));
var result = new CLIVersion(Short.parseShort(matcher.group(1)),
Short.parseShort(matcher.group(2)),
Short.parseShort(matcher.group(3)));
return Optional.of(result);
}

Expand Down

0 comments on commit e3fac2d

Please sign in to comment.