-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
Platform: All, OS: All
Code always tacks on a space onto the result, therefore if there is no X-Hudson
field, then the returned version will be the String "null "
String version = conn.getHeaderField("X-Hudson") + " ";
Matcher matcher = null;
if (version != null)
matcher = pattern.matcher(version);
The corrected code could be something like this:
String version = conn.getHeaderField("X-Hudson");
Matcher matcher = null;
if (version != null)
matcher = pattern.matcher(version + " ");