Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsuen2008-02-10 21:32:31 +0000
committerrsuen2008-02-10 21:32:31 +0000
commit0b6ab4d3dba643caef60e0a47589c28fb1d5d9b1 (patch)
tree11d9872e69eea49bd1f8b17bc2874d9c4707ace7 /applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos
parent4c6b617fd7e7c6bac2ba401a9980c236772d06d6 (diff)
downloadorg.eclipse.ecf-0b6ab4d3dba643caef60e0a47589c28fb1d5d9b1.tar.gz
org.eclipse.ecf-0b6ab4d3dba643caef60e0a47589c28fb1d5d9b1.tar.xz
org.eclipse.ecf-0b6ab4d3dba643caef60e0a47589c28fb1d5d9b1.zip
Consider the case where a bug has no 'resolution'.
Diffstat (limited to 'applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos')
-rw-r--r--applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java14
-rw-r--r--applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/custom.properties2
2 files changed, 12 insertions, 4 deletions
diff --git a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
index 1292c83e5..9e73c8d14 100644
--- a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
+++ b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/ChatRoomMessageHandler.java
@@ -116,7 +116,6 @@ public class ChatRoomMessageHandler implements IChatRoomMessageHandler {
private static final String BUG_SEVERITY_OPEN_TAG = "<bug_severity>"; //$NON-NLS-1$
private static final String BUG_SEVERITY_CLOSE_TAG = "</bug_severity>"; //$NON-NLS-1$
- private static final String ASSIGNED_TO_OPEN_TAG = "<assigned_to>"; //$NON-NLS-1$
private static final String ASSIGNED_TO_CLOSE_TAG = "</assigned_to>"; //$NON-NLS-1$
private static final String BUG_NOT_FOUND_TAG = "<bug error=\"NotFound\">"; //$NON-NLS-1$
@@ -346,11 +345,18 @@ public class ChatRoomMessageHandler implements IChatRoomMessageHandler {
String platform = webPage.substring(webPage.indexOf(REP_PLATFORM_OPEN_TAG) + REP_PLATFORM_OPEN_TAG.length(), webPage.indexOf(REP_PLATFORM_CLOSE_TAG));
String os = webPage.substring(webPage.indexOf(OP_SYS_OPEN_TAG) + OP_SYS_OPEN_TAG.length(), webPage.indexOf(OP_SYS_CLOSE_TAG));
String status = webPage.substring(webPage.indexOf(BUG_STATUS_OPEN_TAG) + BUG_STATUS_OPEN_TAG.length(), webPage.indexOf(BUG_STATUS_CLOSE_TAG));
- String resolution = webPage.substring(webPage.indexOf(RESOLUTION_OPEN_TAG) + RESOLUTION_OPEN_TAG.length(), webPage.indexOf(RESOLUTION_CLOSE_TAG));
String severity = webPage.substring(webPage.indexOf(BUG_SEVERITY_OPEN_TAG) + BUG_SEVERITY_OPEN_TAG.length(), webPage.indexOf(BUG_SEVERITY_CLOSE_TAG));
String assignee = webPage.substring(webPage.substring(0, webPage.indexOf(ASSIGNED_TO_CLOSE_TAG)).lastIndexOf('>') + 1, webPage.indexOf(ASSIGNED_TO_CLOSE_TAG));
- sendMessage(roomID, (target != null ? target + ": " : "") + NLS.bind(CustomMessages.getString(CustomMessages.BugContent),
- new Object[] { number, urlString, product, component, version, platform, os, status, resolution, severity, assignee, xmlDecode(summary) }));
+
+ int resolutionStartIndex = webPage.indexOf(RESOLUTION_OPEN_TAG);
+ if (resolutionStartIndex != -1) {
+ String resolution = webPage.substring(resolutionStartIndex + RESOLUTION_OPEN_TAG.length(), webPage.indexOf(RESOLUTION_CLOSE_TAG));
+ sendMessage(roomID, (target != null ? target + ": " : "") + NLS.bind(CustomMessages.getString(CustomMessages.BugContent),
+ new Object[] { number, urlString, product, component, version, platform, os, status, resolution, severity, assignee, xmlDecode(summary) }));
+ } else {
+ sendMessage(roomID, (target != null ? target + ": " : "") + NLS.bind(CustomMessages.getString(CustomMessages.BugContent2),
+ new Object[] { number, urlString, product, component, version, platform, os, status, severity, assignee, xmlDecode(summary) }));
+ }
} catch (RuntimeException e) {
sendMessage(roomID, (target != null ? target + ": " : "") + NLS.bind(CustomMessages.getString(CustomMessages.Bug),
new Object[] { number, urlString }));
diff --git a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/custom.properties b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/custom.properties
index d071aebeb..8280da83f 100644
--- a/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/custom.properties
+++ b/applications/kosmos/bundles/org.eclipse.ecf.presence.bot.kosmos/src/org/eclipse/ecf/internal/presence/bot/kosmos/custom.properties
@@ -43,6 +43,8 @@ BugContent_Regex = (bug|bug |)([0-9]+c[0-9]+)
# {10} = assignee
# {11} = summary
BugContent = Bug {0} - {1} - {2} / {3} / {4} - {5} / {6} - {7} / {8} / {9} / - Assignee:{10} - {11}
+# For bugs that have no resolution, BugContent2 is used
+BugContent2 = Bug {0} - {1} - {2} / {3} / {4} - {5} / {6} - {7} / {8} / - Assignee:{9} - {10}
Bug_Not_Found = Bug {0} does not exist.
Javadoc_Regex = (api |javadoc )(.+)

Back to the top