From d33c0ebf8f8f52fb6fb82d615cec50a10627d267 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sun, 7 Dec 2014 10:46:12 +0100 Subject: [PATCH] Fix data type of telnet and ssh ports Define shell.ssh.port and shell.telnet.port as integer properties so that the generated meta-data exposes the proper type. Fixes gh-2076 --- .../actuate/autoconfigure/ShellProperties.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java index 84fb11f13d..957253dd4d 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ShellProperties.java @@ -236,12 +236,12 @@ public class ShellProperties { /** * SSH port. */ - private String port = "2000"; + private Integer port = 2000; @Override protected void applyToCrshShellConfig(Properties config) { if (this.enabled) { - config.put("crash.ssh.port", this.port); + config.put("crash.ssh.port", String.valueOf(this.port)); if (this.keyPath != null) { config.put("crash.ssh.keypath", this.keyPath); } @@ -267,10 +267,10 @@ public class ShellProperties { public void setPort(Integer port) { Assert.notNull(port, "port must not be null"); - this.port = port.toString(); + this.port = port; } - public String getPort() { + public Integer getPort() { return this.port; } @@ -291,12 +291,12 @@ public class ShellProperties { /** * Telnet port. */ - private String port = "5000"; + private Integer port = 5000; @Override protected void applyToCrshShellConfig(Properties config) { if (this.enabled) { - config.put("crash.telnet.port", this.port); + config.put("crash.telnet.port", String.valueOf(this.port)); } } @@ -310,10 +310,10 @@ public class ShellProperties { public void setPort(Integer port) { Assert.notNull(port, "port must not be null"); - this.port = port.toString(); + this.port = port; } - public String getPort() { + public Integer getPort() { return this.port; }