Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 259434 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/bugzilla/core/messages.properties (-1 lines)
Lines 109-115 Link Here
109
IBugzillaConstants_requested_operation_not_permitted=The requested operation is not permitted.
109
IBugzillaConstants_requested_operation_not_permitted=The requested operation is not permitted.
110
110
111
SaxMultiBugReportContentHandler_Bug_id_from_server_did_not_match_requested_id=Bug id from server did not match requested id.
111
SaxMultiBugReportContentHandler_Bug_id_from_server_did_not_match_requested_id=Bug id from server did not match requested id.
112
SaxMultiBugReportContentHandler_CREATED_AN_ATTACHEMENT_ID=Created an attachment (id=
113
SaxMultiBugReportContentHandler_id_not_found=\ id not found.
112
SaxMultiBugReportContentHandler_id_not_found=\ id not found.
114
113
115
BugzillaStatus_errorRepository = Repository error from {0}:\n\n{1}
114
BugzillaStatus_errorRepository = Repository error from {0}:\n\n{1}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java (-8 / +26 lines)
Lines 32-43 Link Here
32
 * Parser for xml bugzilla reports.
32
 * Parser for xml bugzilla reports.
33
 * 
33
 * 
34
 * @author Rob Elves
34
 * @author Rob Elves
35
 * @author Hiroyuki Inaba (internationalization)
35
 */
36
 */
36
public class SaxMultiBugReportContentHandler extends DefaultHandler {
37
public class SaxMultiBugReportContentHandler extends DefaultHandler {
37
38
38
	private static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
39
	private static final String ATTRIBUTE_NAME = "name"; //$NON-NLS-1$
39
40
40
	private static final String COMMENT_ATTACHMENT_STRING = Messages.SaxMultiBugReportContentHandler_CREATED_AN_ATTACHEMENT_ID;
41
	private static final String ID_STRING_BEGIN = " (id="; //$NON-NLS-1$
42
43
	private static final String ID_STRING_END = ")"; //$NON-NLS-1$
41
44
42
	private StringBuffer characters;
45
	private StringBuffer characters;
43
46
Lines 574-588 Link Here
574
577
575
	/** determines attachment id from comment */
578
	/** determines attachment id from comment */
576
	private void parseAttachment(TaskCommentMapper comment) {
579
	private void parseAttachment(TaskCommentMapper comment) {
577
578
		String attachmentID = ""; //$NON-NLS-1$
580
		String attachmentID = ""; //$NON-NLS-1$
579
		String commentText = comment.getText();
581
		String commentText = comment.getText();
580
		if (commentText.startsWith(COMMENT_ATTACHMENT_STRING)) {
582
		int firstDelimiter = commentText.indexOf("\n"); //$NON-NLS-1$
581
			int endIndex = commentText.indexOf(")"); //$NON-NLS-1$
583
		if (firstDelimiter < 0) {
582
			if (endIndex > 0 && endIndex < commentText.length()) {
584
			firstDelimiter = commentText.length();
583
				attachmentID = commentText.substring(COMMENT_ATTACHMENT_STRING.length(), endIndex);
585
		}
584
				if (!attachmentID.equals("")) { //$NON-NLS-1$
586
		int startIndex = commentText.indexOf(ID_STRING_BEGIN);
585
					attachIdToComment.put(attachmentID, comment);
587
		if (startIndex > 0 && startIndex < firstDelimiter) {
588
			int endIndex = commentText.indexOf(ID_STRING_END, startIndex);
589
			if (endIndex > 0 && endIndex < firstDelimiter) {
590
				startIndex += ID_STRING_BEGIN.length();
591
				int p = startIndex;
592
				while (p < endIndex) {
593
					char c = commentText.charAt(p);
594
					if (c < '0' || c > '9') {
595
						break;
596
					}
597
					p++;
598
				}
599
				if (p == endIndex) {
600
					attachmentID = commentText.substring(startIndex, endIndex);
601
					if (!attachmentID.equals("")) { //$NON-NLS-1$
602
						attachIdToComment.put(attachmentID, comment);
603
					}
586
				}
604
				}
587
			}
605
			}
588
		}
606
		}
(-)src/org/eclipse/mylyn/internal/bugzilla/core/Messages.java (-2 lines)
Lines 235-242 Link Here
235
235
236
	public static String SaxMultiBugReportContentHandler_Bug_id_from_server_did_not_match_requested_id;
236
	public static String SaxMultiBugReportContentHandler_Bug_id_from_server_did_not_match_requested_id;
237
237
238
	public static String SaxMultiBugReportContentHandler_CREATED_AN_ATTACHEMENT_ID;
239
240
	public static String SaxMultiBugReportContentHandler_id_not_found;
238
	public static String SaxMultiBugReportContentHandler_id_not_found;
241
239
242
	public static String BugzillaStatus_repositoryLoginFailure;
240
	public static String BugzillaStatus_repositoryLoginFailure;

Return to bug 259434