summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Elsemore2013-06-25 10:14:56 (EDT)
committerGerrit Code Review @ Eclipse.org2013-08-01 16:57:44 (EDT)
commitb55ba73481f324bd04e780bc05a8adae312d84af (patch)
tree234d9fb7f5922dd6f18c66fc089dee6318837a4d
parent0fe431cf30eb7ab09f6cc552d3c15c4d4f21c5be (diff)
downloadorg.eclipse.mylyn.tasks-b55ba73481f324bd04e780bc05a8adae312d84af.zip
org.eclipse.mylyn.tasks-b55ba73481f324bd04e780bc05a8adae312d84af.tar.gz
org.eclipse.mylyn.tasks-b55ba73481f324bd04e780bc05a8adae312d84af.tar.bz2
411420: Improve hyperlink detectionrefs/changes/45/14045/4
Improve regex so that "Bug: <bugId>" pattern, commonly used in commit messages, is recognized. Bug: 411420 Change-Id: I3f16b180c10bff46e59e63a908ea766a10ce4f21 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=411420 Signed-off-by: Stephen Elsemore <selsemore@collab.net>
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaHyperlinkDetectorTest.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java2
2 files changed, 4 insertions, 1 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaHyperlinkDetectorTest.java
index 7652ad5..3e8f561 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaHyperlinkDetectorTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaHyperlinkDetectorTest.java
@@ -112,6 +112,8 @@ public class BugzillaHyperlinkDetectorTest extends TestCase {
assertHyperlinks("bug 123", link(0, 8, "123"));
assertHyperlinks("bug#123", link(0, 7, "123"));
assertHyperlinks("bug # 123", link(0, 11, "123"));
+ assertHyperlinks("Bug: 123", link(0, 8, "123"));
+ assertHyperlinks("bug: 123", link(0, 8, "123"));
}
public void testFindHyperlinksTask() {
@@ -151,6 +153,7 @@ public class BugzillaHyperlinkDetectorTest extends TestCase {
public void testFindHyperlinksMultiple() {
assertHyperlinks("bug 456#comment#12", link(0, 7, "456"), link(8, 10, "123", "12"));
assertHyperlinks("bug 123 bug 456", link(0, 7, "123"), link(20, 7, "456"));
+ assertHyperlinks("bug: 123 bug: 456", link(0, 8, "123"), link(21, 8, "456"));
}
public void testFindHyperlinksLinebreak() {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java
index 2cc13e6..b00cff4 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java
@@ -53,7 +53,7 @@ import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard;
*/
public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi {
- private static final String BUG = "(?:duplicate of|bug|task)[ \t]*#?[ \t]*(\\d+)"; //$NON-NLS-1$
+ private static final String BUG = "(?:duplicate of|bug|task)[ \t]*(?:#|:)?[ \t]*(\\d+)"; //$NON-NLS-1$
private static final String COMMENT = "comment[ \t]*#?[ \t]*(\\d+)"; //$NON-NLS-1$