From 1b12ce894977028db8b50af02b4886fb159b52c2 Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Wed, 10 Jun 2015 17:37:17 +0200 Subject: Target Explorer: Clear ping timeout property if it matches the default ping timeout --- .../src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java index 6cee2255d..e7862697c 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/PingTimeoutSection.java @@ -122,7 +122,12 @@ public class PingTimeoutSection extends AbstractSection implements IDataExchange String value = SWTControlUtil.getText(verbosity); if (value != null && !"".equals(value)) { //$NON-NLS-1$ - attributes.setProperty(IPeerProperties.PROP_PING_TIMEOUT, value); + int timeout = -1; + try { + timeout = Integer.decode(value).intValue(); + } catch (NumberFormatException e) { /* ignored on purpose */ } + + attributes.setProperty(IPeerProperties.PROP_PING_TIMEOUT, timeout != -1 && timeout != defaultPingTimeout ? value : Integer.toString(defaultPingTimeout)); } } -- cgit v1.2.3