-
Type:
Bug
-
Resolution: Tracked Elsewhere
-
Priority:
Medium
-
None
-
Affects Version/s: 3.13.4
-
Component/s: Import / Export [Deprecated]
-
3.13
The bugzilla importer scans comments for links to bug ids so we can create links to the newly created jira issues.
However this can fail causing the entire import to fail. We had a customer whose bugzilla data had a comment "luck Bug 7777777777777...". We try to convert the 7777... to an integer, but it threw a number format exception because it is outside the rage of an Integer.
The code in question is in BugzillaImportBean#rewriteBugLinkInText:
public void appendSubstitution(StringBuffer appendBuffer, MatchResult match, int substitutionCount, PatternMatcherInput originalInput, PatternMatcher matcher, Pattern pattern) { String bugId = match.group(1); Long jiraIssueId = (Long) importedKeys.get(new Integer(bugId)); // this is where it blows up if (jiraIssueId == null) { log("No imported issue found for bug reference " + bugId + " in " + parentIssueKey); appendBuffer.append(originalInput); }
We should check the bug id will actually fit into an Integer and fail in a similar manner to the case were a jira issue isn't found.