Committed by
Gerrit Code Review
Trim whitespaces before and after .cfg file arguments.
Change-Id: Iaf165b4e289075376deab806d3c7c15169e3dca7
Showing
4 changed files
with
7 additions
and
7 deletions
... | @@ -149,7 +149,7 @@ public class ReactiveForwarding { | ... | @@ -149,7 +149,7 @@ public class ReactiveForwarding { |
149 | try { | 149 | try { |
150 | String flag = (String) properties.get(propertyName); | 150 | String flag = (String) properties.get(propertyName); |
151 | if (flag != null) { | 151 | if (flag != null) { |
152 | - enabled = flag.equals("true"); | 152 | + enabled = flag.trim().equals("true"); |
153 | } | 153 | } |
154 | } catch (ClassCastException e) { | 154 | } catch (ClassCastException e) { |
155 | // No propertyName defined. | 155 | // No propertyName defined. | ... | ... |
... | @@ -158,13 +158,13 @@ public class DefaultTopologyProvider extends AbstractProvider | ... | @@ -158,13 +158,13 @@ public class DefaultTopologyProvider extends AbstractProvider |
158 | int newMaxEvents, newMaxBatchMs, newMaxIdleMs; | 158 | int newMaxEvents, newMaxBatchMs, newMaxIdleMs; |
159 | try { | 159 | try { |
160 | String s = (String) properties.get("maxEvents"); | 160 | String s = (String) properties.get("maxEvents"); |
161 | - newMaxEvents = isNullOrEmpty(s) ? maxEvents : Integer.parseInt(s); | 161 | + newMaxEvents = isNullOrEmpty(s) ? maxEvents : Integer.parseInt(s.trim()); |
162 | 162 | ||
163 | s = (String) properties.get("maxBatchMs"); | 163 | s = (String) properties.get("maxBatchMs"); |
164 | - newMaxBatchMs = isNullOrEmpty(s) ? maxBatchMs : Integer.parseInt(s); | 164 | + newMaxBatchMs = isNullOrEmpty(s) ? maxBatchMs : Integer.parseInt(s.trim()); |
165 | 165 | ||
166 | s = (String) properties.get("maxIdleMs"); | 166 | s = (String) properties.get("maxIdleMs"); |
167 | - newMaxIdleMs = isNullOrEmpty(s) ? maxIdleMs : Integer.parseInt(s); | 167 | + newMaxIdleMs = isNullOrEmpty(s) ? maxIdleMs : Integer.parseInt(s.trim()); |
168 | 168 | ||
169 | } catch (Exception e) { | 169 | } catch (Exception e) { |
170 | newMaxEvents = DEFAULT_MAX_EVENTS; | 170 | newMaxEvents = DEFAULT_MAX_EVENTS; | ... | ... |
... | @@ -147,9 +147,9 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { | ... | @@ -147,9 +147,9 @@ public class NullLinkProvider extends AbstractProvider implements LinkProvider { |
147 | int newRate; | 147 | int newRate; |
148 | try { | 148 | try { |
149 | String s = (String) properties.get("flicker"); | 149 | String s = (String) properties.get("flicker"); |
150 | - flickSetting = isNullOrEmpty(s) ? flicker : Boolean.valueOf(s); | 150 | + flickSetting = isNullOrEmpty(s) ? flicker : Boolean.valueOf(s.trim()); |
151 | s = (String) properties.get("eventRate"); | 151 | s = (String) properties.get("eventRate"); |
152 | - newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s); | 152 | + newRate = isNullOrEmpty(s) ? eventRate : Integer.valueOf(s.trim()); |
153 | } catch (Exception e) { | 153 | } catch (Exception e) { |
154 | log.warn(e.getMessage()); | 154 | log.warn(e.getMessage()); |
155 | flickSetting = flicker; | 155 | flickSetting = flicker; | ... | ... |
providers/null/packet/src/main/java/org/onosproject/provider/nil/packet/impl/NullPacketProvider.java
... | @@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements | ... | @@ -122,7 +122,7 @@ public class NullPacketProvider extends AbstractProvider implements |
122 | int newRate; | 122 | int newRate; |
123 | try { | 123 | try { |
124 | String s = String.valueOf(properties.get("pktRate")); | 124 | String s = String.valueOf(properties.get("pktRate")); |
125 | - newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s); | 125 | + newRate = isNullOrEmpty(s) ? pktRate : Integer.valueOf(s.trim()); |
126 | } catch (Exception e) { | 126 | } catch (Exception e) { |
127 | log.warn(e.getMessage()); | 127 | log.warn(e.getMessage()); |
128 | newRate = pktRate; | 128 | newRate = pktRate; | ... | ... |
-
Please register or login to post a comment