Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 154709 Details for
Bug 285941
hyperlink detector does not check word boundaries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
commited patch
patch285941.txt (text/plain), 3.71 KB, created by
Frank Becker
on 2009-12-17 16:25:20 EST
(
hide
)
Description:
commited patch
Filename:
MIME Type:
Creator:
Frank Becker
Created:
2009-12-17 16:25:20 EST
Size:
3.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylyn.bugzilla.tests >Index: src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java,v >retrieving revision 1.3 >diff -u -r1.3 BugzillaTaskHyperlinkDetectorTest.java >--- src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java 12 Dec 2009 21:56:30 -0000 1.3 >+++ src/org/eclipse/mylyn/bugzilla/tests/ui/BugzillaTaskHyperlinkDetectorTest.java 17 Dec 2009 21:20:00 -0000 >@@ -113,6 +113,42 @@ > shell.dispose(); > } > >+ public void testBeginningWithSpecialChars() { >+ for (String format : formats) { >+ String testString = "First line\n:" + format + " is at the beginning"; >+ viewer.setDocument(new Document(testString)); >+ Region region = new Region(0, testString.length()); >+ IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); >+ assertNotNull(links); >+ assertEquals(1, links.length); >+ assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); >+ } >+ } >+ >+ public void testBeginningOfSecondLine() { >+ for (String format : formats) { >+ String testString = "First line\n" + format + " is at the beginning"; >+ viewer.setDocument(new Document(testString)); >+ Region region = new Region(0, testString.length()); >+ IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); >+ assertNotNull(links); >+ assertEquals(1, links.length); >+ assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); >+ } >+ } >+ >+ public void testBeginningOfSecondLineWithisWhitespace() { >+ for (String format : formats) { >+ String testString = "First line\n \t " + format + " is at the beginning"; >+ viewer.setDocument(new Document(testString)); >+ Region region = new Region(0, testString.length()); >+ IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); >+ assertNotNull(links); >+ assertEquals(1, links.length); >+ assertEquals(testString.indexOf(format), links[0].getHyperlinkRegion().getOffset()); >+ } >+ } >+ > public void testBeginning() { > for (String format : formats) { > String testString = format + " is at the beginning"; >#P org.eclipse.mylyn.bugzilla.ui >Index: src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java,v >retrieving revision 1.48 >diff -u -r1.48 BugzillaConnectorUi.java >--- src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java 12 Dec 2009 21:56:29 -0000 1.48 >+++ src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaConnectorUi.java 17 Dec 2009 21:20:02 -0000 >@@ -54,7 +54,7 @@ > > private static final int ATTACHMENT_NUM_GROUP = 6; > >- private static final String regexp = "(?:(duplicate of|(\\s|^)+bug|(\\s|^)+task)( ?#? ?)(\\d+))|(?:Created an attachment\\s*\\(id=(\\d+)\\))"; //$NON-NLS-1$ >+ private static final String regexp = "(?:(duplicate of|(\\W||^)+bug|(\\W|^)+task)( ?#? ?)(\\d+))|(?:Created an attachment\\s*\\(id=(\\d+)\\))"; //$NON-NLS-1$ > > private static final Pattern PATTERN = Pattern.compile(regexp, Pattern.CASE_INSENSITIVE); > >@@ -196,8 +196,7 @@ > start = m.start() + m.group().indexOf(m.group(TASK_NUM_GROUP)); > } else { > start = m.start(); >- if (m.group().startsWith(" ")) { //$NON-NLS-1$ >- start++; >+ for (int index = 0; index < m.group().length() && !Character.isLetter(m.group().charAt(index)); index++, start++) { > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 285941
:
151652
|
151653
|
151735
|
151736
| 154709 |
154710