Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-07-22 21:21:19 +0000
committersminto2005-07-22 21:21:19 +0000
commitfff93e1a5f09d837dbaa70888092185e596c8eee (patch)
treece5d9c47fee53916fcaef9718f7afd6f40651aa7 /org.eclipse.mylyn.tasks.core
parent3c5c56b797a564123ad72f692393519feeb2ee29 (diff)
downloadorg.eclipse.mylyn.tasks-fff93e1a5f09d837dbaa70888092185e596c8eee.tar.gz
org.eclipse.mylyn.tasks-fff93e1a5f09d837dbaa70888092185e596c8eee.tar.xz
org.eclipse.mylyn.tasks-fff93e1a5f09d837dbaa70888092185e596c8eee.zip
small fix for hyperlink detector
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/java/BugzillaHyperLinkDetector.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/java/BugzillaHyperLinkDetector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/java/BugzillaHyperLinkDetector.java
index 96891f8f6..f6df0aacb 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/java/BugzillaHyperLinkDetector.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/java/BugzillaHyperLinkDetector.java
@@ -96,6 +96,7 @@ public class BugzillaHyperLinkDetector extends AbstractMylarHyperlinkDetector {
m = p.matcher(comment.toLowerCase().trim());
boolean b2 = m.matches();
+ // XXX walk forward from where we are
if(b || b2){
int start = comment.toLowerCase().indexOf("bug");
@@ -110,14 +111,19 @@ public class BugzillaHyperLinkDetector extends AbstractMylarHyperlinkDetector {
if(end == -1)
end = comment.length();
- int bugId = Integer.parseInt(comment.substring(endCommentStart, end).trim());
+ try{
+ int bugId = Integer.parseInt(comment.substring(endCommentStart, end).trim());
+
- start += commentStart;
- end += commentStart;
-
- if(startOffset >= start && endOffset <= end){
+ start += commentStart;
+ end += commentStart;
+
+ if(startOffset >= start && endOffset <= end){
IRegion sregion= new Region(start, end-start);
- return new IHyperlink[] {new BugzillaHyperLink(sregion, bugId)};
+ return new IHyperlink[] {new BugzillaHyperLink(sregion, bugId)};
+ }
+ } catch (NumberFormatException e){
+ return null;
}
}
return null;

Back to the top