Community
Participate
Working Groups
BugzillaClient uses String comparison to determine if the server has a certain release or higher installed: String bugzillaVersion = repositoryConfiguration.getInstallVersion(); if (bugzillaVersion.compareTo("2.18") < 0) { ... } This is not robust for versions > 10, e.g. 2.18 < 2.2 although was released in 1999 and 2.18 in 2005. JiraVersion has an implementation that compares version numbers by segment.
Created attachment 122875 [details] patch
Created attachment 122876 [details] mylyn/context/zip
That looks good. Minor nit: We should probably not define constants in the code that are not used and it would be nice to have a few test cases for this :).
Created attachment 123002 [details] patch with jUnit Should we add more tests?
Created attachment 123003 [details] mylyn/context/zip
Looks great. Rob, can you review?
Great. One thought is that we should consider guarding against the possibility of a NuberFormatException i.e. in case someone out there is running a custom or forked bugzilla with an alphanumeric version string.
Good catch. The same fix needs to be applied to JiraVersion and a test added (bug 262508).
Created attachment 124098 [details] updated patch JiraVersion fix included. But the catch of NumberFormatException is to do. For Bugzilla we catch this in setInstallVersion() and set the version to MIN_VERSION.
Created attachment 124099 [details] mylyn/context/zip
Patch applied, ip log updated. Updated JiraVersion.parse to catch the exception and return 0. Looks like the right behavior for JIRA, Steffen, please review.
*** Bug 262508 has been marked as a duplicate of this bug. ***