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 66042 Details for
Bug 170536
[api] unified error handling
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.
makes status API more robust
status-refactoring.patch (text/plain), 65.65 KB, created by
Steffen Pingel
on 2007-05-06 22:46:21 EDT
(
hide
)
Description:
makes status API more robust
Filename:
MIME Type:
Creator:
Steffen Pingel
Created:
2007-05-06 22:46:21 EDT
Size:
65.65 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.jira.ui >Index: src/org/eclipse/mylar/internal/jira/ui/JiraAttachmentHandler.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.jira.ui/src/org/eclipse/mylar/internal/jira/ui/JiraAttachmentHandler.java,v >retrieving revision 1.2 >diff -u -r1.2 JiraAttachmentHandler.java >--- src/org/eclipse/mylar/internal/jira/ui/JiraAttachmentHandler.java 6 May 2007 21:04:11 -0000 1.2 >+++ src/org/eclipse/mylar/internal/jira/ui/JiraAttachmentHandler.java 7 May 2007 02:35:55 -0000 >@@ -24,7 +24,7 @@ > import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; > import org.eclipse.mylar.tasks.core.IAttachmentHandler; >-import org.eclipse.mylar.tasks.core.MylarStatus; >+import org.eclipse.mylar.tasks.core.IMylarStatusConstants; > import org.eclipse.mylar.tasks.core.RepositoryAttachment; > import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylar.tasks.core.TaskRepository; >@@ -42,11 +42,11 @@ > public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, File file) throws CoreException { > String id = attachment.getAttributeValue(RepositoryTaskAttribute.ATTACHMENT_ID); > if (id == null) { >- throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, MylarStatus.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment id.", null)); >+ throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment id.", null)); > } > String key = attachment.getTaskId(); > if (key == null) { >- throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, MylarStatus.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment key.", null)); >+ throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment key.", null)); > } > > JiraServer server = JiraServerFacade.getDefault().getJiraServer(repository); >@@ -93,11 +93,11 @@ > public byte[] getAttachmentData(TaskRepository repository, RepositoryAttachment attachment) throws CoreException { > String id = attachment.getAttributeValue(RepositoryTaskAttribute.ATTACHMENT_ID); > if (id == null) { >- throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, MylarStatus.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment id.", null)); >+ throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment id.", null)); > } > String key = attachment.getTaskId(); > if (key == null) { >- throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, MylarStatus.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment key.", null)); >+ throw new CoreException(new Status(IStatus.ERROR, JiraUiPlugin.PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment key.", null)); > } > > JiraServer server = JiraServerFacade.getDefault().getJiraServer(repository); >#P org.eclipse.mylar.tasks.core >Index: src/org/eclipse/mylar/tasks/core/IMylarStatusConstants.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.core/src/org/eclipse/mylar/tasks/core/IMylarStatusConstants.java,v >retrieving revision 1.4 >diff -u -r1.4 IMylarStatusConstants.java >--- src/org/eclipse/mylar/tasks/core/IMylarStatusConstants.java 8 Feb 2007 00:31:32 -0000 1.4 >+++ src/org/eclipse/mylar/tasks/core/IMylarStatusConstants.java 7 May 2007 02:35:55 -0000 >@@ -11,9 +11,9 @@ > > package org.eclipse.mylar.tasks.core; > >- > /** > * @author Rob Elves >+ * @author Steffen Pingel > */ > public interface IMylarStatusConstants { > >@@ -45,5 +45,7 @@ > public final static int LOGGED_OUT_OF_REPOSITORY = 10; > > public final static int NETWORK_ERROR = 11; >+ >+ public final static int PERMISSION_DENIED_ERROR = 12; > > } >Index: src/org/eclipse/mylar/tasks/core/MylarStatus.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.core/src/org/eclipse/mylar/tasks/core/MylarStatus.java,v >retrieving revision 1.6 >diff -u -r1.6 MylarStatus.java >--- src/org/eclipse/mylar/tasks/core/MylarStatus.java 21 Mar 2007 17:24:34 -0000 1.6 >+++ src/org/eclipse/mylar/tasks/core/MylarStatus.java 7 May 2007 02:35:55 -0000 >@@ -11,98 +11,77 @@ > > package org.eclipse.mylar.tasks.core; > >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.Status; > > /** > * @author Rob Elves >+ * @author Steffen Pingel > */ > public class MylarStatus extends Status implements IMylarStatusConstants { > >- private String errorMessage; >+ private String htmlMessage; > >- private String repositoryUrl = ""; >- >- public MylarStatus(int severity, String pluginId, int code) { >- super(severity, pluginId, code, "MylarStatus", null); >- this.errorMessage = null; >- } >- >- public MylarStatus(int severity, String pluginId, int code, String errorMessage) { >- super(severity, pluginId, code, "MylarStatus", null); >- this.errorMessage = errorMessage; >- } >- >- public MylarStatus(int severity, String pluginId, int code, String repositoryUrl, Throwable e) { >- super(severity, pluginId, code, "MylarStatus", e); >- this.repositoryUrl = repositoryUrl; >- this.errorMessage = e.getMessage(); >- } >- >- public MylarStatus(int severity, String pluginId, int code, String repositoryUrl, String errorMessage) { >- super(severity, pluginId, code, "MylarStatus", null); >- this.errorMessage = errorMessage; >- this.repositoryUrl = repositoryUrl; >+ /** >+ * Constructs a status object with a message. >+ */ >+ public MylarStatus(int severity, String pluginId, int code, String message) { >+ super(severity, pluginId, code, message, null); > } > >- public MylarStatus(int severity, String pluginId, int code, String repositoryUrl, String errorMessage, Throwable e) { >- super(severity, pluginId, code, "MylarStatus", e); >- this.errorMessage = errorMessage; >- this.repositoryUrl = repositoryUrl; >+ /** >+ * Constructs a status object with a message and an exception. that caused >+ * the error. >+ */ >+ public MylarStatus(int severity, String pluginId, int code, String message, Throwable e) { >+ super(severity, pluginId, code, message, e); > } > > /** > * Returns the message that is relevant to the code of this status. > */ > public String getMessage() { >- >- switch (getCode()) { >- case REPOSITORY_LOGIN_ERROR: >- return MylarMessages >- .bind(MylarMessages.repository_login_failure, this.getRepositoryUrl(), this.errorMessage); >- case REPOSITORY_NOT_FOUND: >- return MylarMessages.bind(MylarMessages.repository_not_found, this.errorMessage); >- case REPOSITORY_ERROR: >- return MylarMessages.bind(MylarMessages.repository_error, this.getRepositoryUrl(), this.errorMessage); >- case IO_ERROR: >- String string1 = "Unknown IO error occurred"; >- String string2 = "No message provided"; >- if(getException() != null) { >- string1 = getException().getClass().getSimpleName(); >- string2 = getException().getMessage(); >- } >- Object[] strings = { getRepositoryUrl(), string1, string2 }; >- return MylarMessages.bind(MylarMessages.io_error, strings); >- case INTERNAL_ERROR: >- return MylarMessages.bind(MylarMessages.internal_error, this.errorMessage); >- case OPERATION_CANCELLED: >- return MylarMessages.bind(MylarMessages.operation_cancelled, this.errorMessage); >- case REPOSITORY_COLLISION: >- return MylarMessages.bind(MylarMessages.repository_collision, this.errorMessage); >- case REPOSITORY_COMMENT_REQD: >- if (errorMessage == null) { >- return MylarMessages.repository_comment_reqd; >- } else { >- return errorMessage; >- } >+ String message = super.getMessage(); >+ if (message != null && !"".equals(message)) { >+ return message; > } >- if (errorMessage != null) { >- return errorMessage; >- } else if (getException() != null) { >- String message = getException().getMessage(); >- if (message != null) { >- return message; >- } else { >- return getException().toString(); >+ >+ Throwable exception = getException(); >+ if (exception != null) { >+ if (exception.getMessage() != null) { >+ return exception.getMessage(); > } >+ return exception.toString(); > } >- return "Unknown"; >+ >+ return ""; >+ } >+ >+ protected void setHtmlMessage(String htmlMessage) { >+ this.htmlMessage = htmlMessage; >+ } >+ >+ public String getHtmlMessage() { >+ return htmlMessage; >+ } >+ >+ public boolean isHtmlMessage() { >+ return htmlMessage != null; > } > >- public String getRepositoryUrl() { >- return repositoryUrl; >+ public static MylarStatus createInternalError(String pluginId, String message, Throwable t) { >+ return new MylarStatus(IStatus.ERROR, pluginId, IMylarStatusConstants.INTERNAL_ERROR, message, t); > } > >- public void setRepositoryUrl(String repositoryUrl) { >- this.repositoryUrl = repositoryUrl; >+ public static MylarStatus createHtmlStatus(int severity, String pluginId, int code, String message, >+ String htmlMessage) { >+ if (htmlMessage == null) { >+ throw new IllegalArgumentException("htmlMessage must not be null"); >+ } >+ >+ MylarStatus status = new MylarStatus(severity, pluginId, code, message); >+ status.setHtmlMessage(htmlMessage); >+ return status; > } >+ > } >Index: src/org/eclipse/mylar/tasks/core/RepositoryStatus.java >=================================================================== >RCS file: src/org/eclipse/mylar/tasks/core/RepositoryStatus.java >diff -N src/org/eclipse/mylar/tasks/core/RepositoryStatus.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/tasks/core/RepositoryStatus.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,101 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 2006 University Of British Columbia and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * University Of British Columbia - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylar.tasks.core; >+ >+import org.eclipse.core.runtime.Status; >+import org.eclipse.osgi.util.NLS; >+ >+/** >+ * @author Rob Elves >+ * @author Steffen Pingel >+ */ >+public class RepositoryStatus extends MylarStatus { >+ >+ private String repositoryUrl; >+ >+ public RepositoryStatus(TaskRepository repository, int severity, String pluginId, int code, String message) { >+ this(repository.getUrl(), severity, pluginId, code, message, null); >+ } >+ >+ public RepositoryStatus(TaskRepository repository, int severity, String pluginId, int code, String message, >+ Throwable e) { >+ this(repository.getUrl(), severity, pluginId, code, message, e); >+ } >+ >+ public RepositoryStatus(String repositoryUrl, int severity, String pluginId, int code, String message) { >+ this(repositoryUrl, severity, pluginId, code, message, null); >+ } >+ >+ public RepositoryStatus(String repositoryUrl, int severity, String pluginId, int code, String message, Throwable e) { >+ super(severity, pluginId, code, message, e); >+ >+ if (repositoryUrl == null) { >+ throw new IllegalArgumentException("repositoryUrl must not be null"); >+ } >+ >+ this.repositoryUrl = repositoryUrl; >+ } >+ >+ public String getRepositoryUrl() { >+ return repositoryUrl; >+ } >+ >+ public static RepositoryStatus createStatus(TaskRepository repository, int severity, String pluginId, String message) { >+ return createStatus(repository.getUrl(), severity, pluginId, message); >+ } >+ >+ public static RepositoryStatus createStatus(String repositoryUrl, int severity, String pluginId, String message) { >+ return new RepositoryStatus(repositoryUrl, severity, pluginId, IMylarStatusConstants.REPOSITORY_ERROR, message); >+ } >+ >+ public static RepositoryStatus createLoginError(String repositoryUrl, String pluginId) { >+ return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, >+ IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, NLS.bind( >+ "Unable to login to {0}. Please validate credentials via Task Repositories view.", >+ repositoryUrl)); >+ } >+ >+ public static RepositoryStatus createNotFoundError(String repositoryUrl, String pluginId) { >+ return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, IMylarStatusConstants.REPOSITORY_NOT_FOUND, >+ NLS.bind("Repository {0} could not be found.", repositoryUrl)); >+ } >+ >+ public static RepositoryStatus createCollisionError(String repositoryUrl, String pluginId) { >+ return new RepositoryStatus( >+ repositoryUrl, >+ Status.ERROR, >+ pluginId, >+ IMylarStatusConstants.REPOSITORY_COLLISION, >+ NLS >+ .bind( >+ "Mid-air collision occurred while submitting to {0}.\n\nSynchronize task and re-submit changes.", >+ repositoryUrl)); >+ } >+ >+ public static RepositoryStatus createCommentRequiredError(String repositoryUrl, String pluginId) { >+ return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, >+ IMylarStatusConstants.REPOSITORY_COMMENT_REQD, >+ "You have to specify a new comment when making this change. Please comment on the reason for this change."); >+ } >+ >+ public static RepositoryStatus createHtmlStatus(String repositoryUrl, int severity, String pluginId, int code, >+ String message, String htmlMessage) { >+ if (htmlMessage == null) { >+ throw new IllegalArgumentException("htmlMessage must not be null"); >+ } >+ >+ RepositoryStatus status = new RepositoryStatus(repositoryUrl, severity, pluginId, code, message); >+ status.setHtmlMessage(htmlMessage); >+ return status; >+ } >+ >+} >Index: .refactorings/2007/5/19/refactorings.index >=================================================================== >RCS file: .refactorings/2007/5/19/refactorings.index >diff -N .refactorings/2007/5/19/refactorings.index >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/5/19/refactorings.index 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,4 @@ >+1178496696564 Rename type 'MylarStatus' >+1178496823479 Move compilation unit >+1178500216905 Rename type 'TracStatus' >+1178500237279 Rename type 'TracStatus' >Index: .refactorings/2007/5/19/refactorings.history >=================================================================== >RCS file: .refactorings/2007/5/19/refactorings.history >diff -N .refactorings/2007/5/19/refactorings.history >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ .refactorings/2007/5/19/refactorings.history 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,7 @@ >+<?xml version="1.0" encoding="utf-8"?> >+<session version="1.0"> >+<refactoring comment="Rename type 'org.eclipse.mylar.tasks.core.MylarStatus' to 'BugzillaStatus' - Original project: 'org.eclipse.mylar.tasks.core' - Original element: 'org.eclipse.mylar.tasks.core.MylarStatus' - Renamed element: 'org.eclipse.mylar.tasks.core.BugzillaStatus' - Update references to refactored element - Update textual occurrences in comments and strings" description="Rename type 'MylarStatus'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src<org.eclipse.mylar.tasks.core{MylarStatus.java[MylarStatus" matchStrategy="1" name="BugzillaStatus" qualified="false" references="true" similarDeclarations="false" stamp="1178496696564" textual="false" version="1.0"/> >+<refactoring comment="Move 1 elements(s) to 'org.eclipse.mylar.bugzilla.core/src/org.eclipse.mylar.internal.bugzilla.core' - Original project: 'org.eclipse.mylar.tasks.core' - Destination element: 'org.eclipse.mylar.bugzilla.core/src/org.eclipse.mylar.internal.bugzilla.core' - Original element: 'org.eclipse.mylar.tasks.core.BugzillaStatus.java' - Update references to refactored element" description="Move compilation unit" destination="/src<org.eclipse.mylar.internal.bugzilla.core" element1="/src<org.eclipse.mylar.tasks.core{BugzillaStatus.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.move" policy="org.eclipse.jdt.ui.moveResources" qualified="false" references="true" stamp="1178496823479" units="1" version="1.0"/> >+<refactoring comment="Rename type 'org.eclipse.mylar.tasks.core.TracStatus' to 'MylarStatus' - Original project: 'org.eclipse.mylar.tasks.core' - Original element: 'org.eclipse.mylar.tasks.core.TracStatus' - Renamed element: 'org.eclipse.mylar.tasks.core.MylarStatus' - Update references to refactored element - Update textual occurrences in comments and strings" description="Rename type 'TracStatus'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src<org.eclipse.mylar.tasks.core{TracStatus.java[TracStatus" matchStrategy="1" name="MylarStatus" qualified="false" references="true" similarDeclarations="false" stamp="1178500216905" textual="false" version="1.0"/> >+<refactoring comment="Rename type 'org.eclipse.mylar.tasks.core.TracStatus' to 'RepositoryStatus' - Original project: 'org.eclipse.mylar.tasks.core' - Original element: 'org.eclipse.mylar.tasks.core.TracStatus' - Renamed element: 'org.eclipse.mylar.tasks.core.RepositoryStatus' - Update references to refactored element - Update textual occurrences in comments and strings" description="Rename type 'TracStatus'" flags="589830" id="org.eclipse.jdt.ui.rename.type" input="/src<org.eclipse.mylar.tasks.core{TracStatus.java[TracStatus" matchStrategy="1" name="RepositoryStatus" qualified="false" references="true" similarDeclarations="false" stamp="1178500237279" textual="false" version="1.0"/> >+</session> >#P org.eclipse.mylar.tasks.ui >Index: src/org/eclipse/mylar/tasks/ui/SynchronizeQueryJob.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/SynchronizeQueryJob.java,v >retrieving revision 1.42 >diff -u -r1.42 SynchronizeQueryJob.java >--- src/org/eclipse/mylar/tasks/ui/SynchronizeQueryJob.java 25 Apr 2007 22:19:21 -0000 1.42 >+++ src/org/eclipse/mylar/tasks/ui/SynchronizeQueryJob.java 7 May 2007 02:35:56 -0000 >@@ -29,10 +29,9 @@ > import org.eclipse.mylar.tasks.core.AbstractQueryHit; > import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.IMylarStatusConstants; > import org.eclipse.mylar.tasks.core.ITaskDataHandler; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.QueryHitCollector; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; > import org.eclipse.mylar.tasks.core.TaskList; > import org.eclipse.mylar.tasks.core.TaskRepository; >@@ -84,8 +83,8 @@ > TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository( > repositoryQuery.getRepositoryKind(), repositoryQuery.getRepositoryUrl()); > if (repository == null) { >- repositoryQuery.setStatus(new MylarStatus(Status.ERROR, TasksUiPlugin.PLUGIN_ID, >- IMylarStatusConstants.REPOSITORY_NOT_FOUND, repositoryQuery.getRepositoryUrl())); >+ repositoryQuery.setStatus(RepositoryStatus.createNotFoundError(repositoryQuery.getRepositoryUrl(), >+ TasksUiPlugin.PLUGIN_ID)); > } else { > > QueryHitCollector collector = new QueryHitCollector(TasksUiPlugin.getTaskListManager().getTaskList()); >@@ -204,7 +203,8 @@ > continue; > } > if (taskData != null) { >- TasksUiPlugin.getDefault().getTaskDataManager().setNewTaskData(hit.getHandleIdentifier(), taskData); >+ TasksUiPlugin.getDefault().getTaskDataManager().setNewTaskData(hit.getHandleIdentifier(), >+ taskData); > } > monitor.worked(1); > } >Index: src/org/eclipse/mylar/tasks/ui/wizards/NewTaskWizard.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/wizards/NewTaskWizard.java,v >retrieving revision 1.3 >diff -u -r1.3 NewTaskWizard.java >--- src/org/eclipse/mylar/tasks/ui/wizards/NewTaskWizard.java 30 Mar 2007 21:18:50 -0000 1.3 >+++ src/org/eclipse/mylar/tasks/ui/wizards/NewTaskWizard.java 7 May 2007 02:35:56 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.mylar.internal.tasks.ui.TaskListPreferenceConstants; > import org.eclipse.mylar.tasks.core.AbstractAttributeFactory; > import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; >+import org.eclipse.mylar.tasks.core.IMylarStatusConstants; > import org.eclipse.mylar.tasks.core.ITaskDataHandler; > import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; >@@ -64,7 +65,7 @@ > final ITaskDataHandler taskDataHandler = (ITaskDataHandler) connector.getTaskDataHandler(); > if (taskDataHandler == null) { > MylarStatusHandler.displayStatus("Error creating new task", new MylarStatus(IStatus.ERROR, >- TasksUiPlugin.PLUGIN_ID, MylarStatus.REPOSITORY_ERROR, "The selected repository does not support creating new tasks.")); >+ TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.REPOSITORY_ERROR, "The selected repository does not support creating new tasks.")); > return false; > } > >@@ -80,7 +81,7 @@ > try { > if (!taskDataHandler.initializeTaskData(taskRepository, taskData, monitor)) { > throw new CoreException(new MylarStatus(IStatus.ERROR, >- TasksUiPlugin.PLUGIN_ID, MylarStatus.REPOSITORY_ERROR, "The selected repository does not support creating new tasks.")); } >+ TasksUiPlugin.PLUGIN_ID, IMylarStatusConstants.REPOSITORY_ERROR, "The selected repository does not support creating new tasks.")); } > } catch (CoreException e) { > throw new InvocationTargetException(e); > } >Index: src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.tasks.ui/src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java,v >retrieving revision 1.6 >diff -u -r1.6 SearchHitCollector.java >--- src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java 21 Apr 2007 16:49:36 -0000 1.6 >+++ src/org/eclipse/mylar/tasks/ui/search/SearchHitCollector.java 7 May 2007 02:35:56 -0000 >@@ -19,8 +19,8 @@ > import org.eclipse.mylar.tasks.core.AbstractQueryHit; > import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector; > import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.QueryHitCollector; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.TaskList; > import org.eclipse.mylar.tasks.core.TaskRepository; > import org.eclipse.mylar.tasks.ui.TasksUiPlugin; >@@ -89,8 +89,8 @@ > > public ISearchResult getSearchResult() { > if (searchResult.getMatchCount() >= QueryHitCollector.MAX_HITS) { >- MylarStatusHandler.displayStatus("Maximum hits reached", new MylarStatus(Status.WARNING, >- TasksUiPlugin.PLUGIN_ID, MylarStatus.INTERNAL_ERROR, MAX_HITS_REACHED)); >+ MylarStatusHandler.displayStatus("Maximum hits reached", RepositoryStatus.createStatus(repository.getUrl(), >+ IStatus.WARNING, TasksUiPlugin.PLUGIN_ID, MAX_HITS_REACHED)); > } > return searchResult; > } >#P org.eclipse.mylar.trac.core >Index: .refactorings/2007/5/19/refactorings.history >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/.refactorings/2007/5/19/refactorings.history,v >retrieving revision 1.1 >diff -u -r1.1 refactorings.history >--- .refactorings/2007/5/19/refactorings.history 6 May 2007 02:15:18 -0000 1.1 >+++ .refactorings/2007/5/19/refactorings.history 7 May 2007 02:35:56 -0000 >@@ -1,4 +1,6 @@ > <?xml version="1.0" encoding="utf-8"?> > <session version="1.0"> > <refactoring comment="Copy 1 elements(s) to 'org.eclipse.mylar.jira.ui/src/org.eclipse.mylar.internal.jira.ui' - Original project: 'org.eclipse.mylar.trac.core' - Destination element: 'org.eclipse.mylar.jira.ui/src/org.eclipse.mylar.internal.jira.ui' - Original element: 'org.eclipse.mylar.internal.trac.core.TracAttachmentHandler.java'" description="Copy compilation unit" destination="/src<org.eclipse.mylar.internal.jira.ui" element1="/src<org.eclipse.mylar.internal.trac.core{TracAttachmentHandler.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.copy" log="/src<org.eclipse.mylar.internal.trac.core{TracAttachmentHandler.java	true	false" policy="org.eclipse.jdt.ui.copyResources" stamp="1178414109265" units="1" version="1.0"/> >+<refactoring comment="Copy 1 elements(s) to 'org.eclipse.mylar.tasks.core/src/org.eclipse.mylar.tasks.core' - Original project: 'org.eclipse.mylar.trac.core' - Destination element: 'org.eclipse.mylar.tasks.core/src/org.eclipse.mylar.tasks.core' - Original element: 'org.eclipse.mylar.internal.trac.core.TracStatus.java'" description="Copy compilation unit" destination="/src<org.eclipse.mylar.tasks.core" element1="/src<org.eclipse.mylar.internal.trac.core{TracStatus.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.copy" log="/src<org.eclipse.mylar.internal.trac.core{TracStatus.java	true	false" policy="org.eclipse.jdt.ui.copyResources" stamp="1178500209747" units="1" version="1.0"/> >+<refactoring comment="Copy 1 elements(s) to 'org.eclipse.mylar.tasks.core/src/org.eclipse.mylar.tasks.core' - Original project: 'org.eclipse.mylar.trac.core' - Destination element: 'org.eclipse.mylar.tasks.core/src/org.eclipse.mylar.tasks.core' - Original element: 'org.eclipse.mylar.internal.trac.core.TracStatus.java'" description="Copy compilation unit" destination="/src<org.eclipse.mylar.tasks.core" element1="/src<org.eclipse.mylar.internal.trac.core{TracStatus.java" files="0" flags="589830" folders="0" id="org.eclipse.jdt.ui.copy" log="/src<org.eclipse.mylar.internal.trac.core{TracStatus.java	true	false" policy="org.eclipse.jdt.ui.copyResources" stamp="1178500223981" units="1" version="1.0"/> > </session> >Index: .refactorings/2007/5/19/refactorings.index >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/.refactorings/2007/5/19/refactorings.index,v >retrieving revision 1.1 >diff -u -r1.1 refactorings.index >--- .refactorings/2007/5/19/refactorings.index 6 May 2007 02:15:18 -0000 1.1 >+++ .refactorings/2007/5/19/refactorings.index 7 May 2007 02:35:56 -0000 >@@ -1 +1,3 @@ > 1178414109265 Copy compilation unit >+1178500209747 Copy compilation unit >+1178500223981 Copy compilation unit >Index: src/org/eclipse/mylar/internal/trac/core/TracStatus.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/src/org/eclipse/mylar/internal/trac/core/TracStatus.java,v >retrieving revision 1.3 >diff -u -r1.3 TracStatus.java >--- src/org/eclipse/mylar/internal/trac/core/TracStatus.java 14 Feb 2007 01:56:19 -0000 1.3 >+++ src/org/eclipse/mylar/internal/trac/core/TracStatus.java 7 May 2007 02:35:56 -0000 >@@ -11,67 +11,17 @@ > > package org.eclipse.mylar.internal.trac.core; > >-import org.eclipse.core.runtime.Status; >+import org.eclipse.core.runtime.IStatus; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.osgi.util.NLS; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > > /** >- * @author Rob Elves > * @author Steffen Pingel > */ >-public class TracStatus extends Status implements IMylarStatusConstants { >+public class TracStatus { > >- public static final int PERMISSION_DENIED_ERROR = 1001; >- >- private String repositoryUrl; >- >- public TracStatus(int severity, String pluginId, int code) { >- super(severity, pluginId, code, null, null); >- } >- >- public TracStatus(int severity, String pluginId, int code, String message) { >- super(severity, pluginId, code, message, null); >+ public static IStatus createPermissionDeniedError(String repositoryUrl, String pluginId) { >+ return new RepositoryStatus(repositoryUrl, IStatus.ERROR, TracCorePlugin.PLUGIN_ID, IMylarStatusConstants.PERMISSION_DENIED_ERROR, "Permission denied."); > } > >- public TracStatus(int severity, String pluginId, int code, String message, Throwable e) { >- super(severity, pluginId, code, message, e); >- } >- >- /** >- * Returns the message that is relevant to the code of this status. >- */ >- public String getMessage() { >- String message = super.getMessage(); >- if (message != null && !"".equals(message)) { >- return message; >- } >- >- Throwable exception = getException(); >- if (exception != null) { >- if (exception.getMessage() != null) { >- return exception.getMessage(); >- } >- return exception.toString(); >- } >- >- switch (getCode()) { >- case REPOSITORY_LOGIN_ERROR: >- return NLS.bind("Unable to login to {0}. Please validate credentials via Task Repositories view.", getRepositoryUrl()); >- case REPOSITORY_NOT_FOUND: >- return NLS.bind("Repository {0} could not be found.", getRepositoryUrl()); >- case PERMISSION_DENIED_ERROR: >- return "Insufficient permissions."; >- default: >- return ""; >- } >- } >- >- public String getRepositoryUrl() { >- return repositoryUrl; >- } >- >- public void setRepositoryUrl(String repsitoryUrl) { >- this.repositoryUrl = repsitoryUrl; >- } >- > } >Index: src/org/eclipse/mylar/internal/trac/core/TracRepositoryConnector.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/src/org/eclipse/mylar/internal/trac/core/TracRepositoryConnector.java,v >retrieving revision 1.30 >diff -u -r1.30 TracRepositoryConnector.java >--- src/org/eclipse/mylar/internal/trac/core/TracRepositoryConnector.java 20 Apr 2007 17:49:00 -0000 1.30 >+++ src/org/eclipse/mylar/internal/trac/core/TracRepositoryConnector.java 7 May 2007 02:35:56 -0000 >@@ -37,6 +37,7 @@ > import org.eclipse.mylar.tasks.core.ITaskDataHandler; > import org.eclipse.mylar.tasks.core.QueryHitCollector; > import org.eclipse.mylar.tasks.core.RepositoryOperation; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; > import org.eclipse.mylar.tasks.core.TaskRepository; >@@ -323,8 +324,7 @@ > ITracClient client = getClientManager().getRepository(repository); > client.updateAttributes(monitor, true); > } catch (Exception e) { >- throw new CoreException(new TracStatus(IStatus.INFO, TracCorePlugin.PLUGIN_ID, Status.WARNING, >- "Could not update attributes", null)); >+ throw new CoreException(RepositoryStatus.createStatus(repository.getUrl(), IStatus.WARNING, TracCorePlugin.PLUGIN_ID, "Could not update attributes")); > } > } > >Index: src/org/eclipse/mylar/internal/trac/core/TracAttachmentHandler.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/src/org/eclipse/mylar/internal/trac/core/TracAttachmentHandler.java,v >retrieving revision 1.9 >diff -u -r1.9 TracAttachmentHandler.java >--- src/org/eclipse/mylar/internal/trac/core/TracAttachmentHandler.java 10 Feb 2007 04:06:01 -0000 1.9 >+++ src/org/eclipse/mylar/internal/trac/core/TracAttachmentHandler.java 7 May 2007 02:35:56 -0000 >@@ -23,7 +23,9 @@ > import org.eclipse.mylar.internal.trac.core.model.TracTicket; > import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; > import org.eclipse.mylar.tasks.core.IAttachmentHandler; >+import org.eclipse.mylar.tasks.core.IMylarStatusConstants; > import org.eclipse.mylar.tasks.core.RepositoryAttachment; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylar.tasks.core.TaskRepository; > >@@ -38,7 +40,8 @@ > this.connector = connector; > } > >- public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, File file) throws CoreException { >+ public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, File file) >+ throws CoreException { > byte[] data = getAttachmentData(repository, attachment); > try { > writeData(file, data); >@@ -56,15 +59,18 @@ > } > } > >- public void uploadAttachment(TaskRepository repository, AbstractRepositoryTask task, String comment, String description, File file, String contentType, boolean isPatch) throws CoreException { >+ public void uploadAttachment(TaskRepository repository, AbstractRepositoryTask task, String comment, >+ String description, File file, String contentType, boolean isPatch) throws CoreException { > if (!TracRepositoryConnector.hasAttachmentSupport(repository, task)) { >- throw new CoreException(new TracStatus(IStatus.INFO, TracCorePlugin.PLUGIN_ID, TracStatus.INTERNAL_ERROR, "Attachments are not supported by this repository access type.", null)); >+ throw new CoreException(new RepositoryStatus(repository.getUrl(), IStatus.INFO, TracCorePlugin.PLUGIN_ID, >+ IMylarStatusConstants.REPOSITORY_ERROR, >+ "Attachments are not supported by this repository access type")); > } > > try { > ITracClient client = connector.getClientManager().getRepository(repository); > int id = Integer.parseInt(task.getTaskId()); >- byte[] data = readData(file); >+ byte[] data = readData(file); > client.putAttachmentData(id, file.getName(), description, data); > if (comment != null && comment.length() > 0) { > TracTicket ticket = new TracTicket(id); >@@ -104,7 +110,7 @@ > return TracRepositoryConnector.hasAttachmentSupport(repository, task); > } > >- public boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment) { >+ public boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment) { > return false; > } > >@@ -115,7 +121,9 @@ > public byte[] getAttachmentData(TaskRepository repository, RepositoryAttachment attachment) throws CoreException { > String filename = attachment.getAttributeValue(RepositoryTaskAttribute.ATTACHMENT_FILENAME); > if (filename == null) { >- throw new CoreException(new TracStatus(IStatus.ERROR, TracCorePlugin.PLUGIN_ID, TracStatus.INTERNAL_ERROR, "Attachment download from " + repository.getUrl() + " failed, missing attachment filename.", null)); >+ throw new CoreException(new RepositoryStatus(repository.getUrl(), IStatus.ERROR, TracCorePlugin.PLUGIN_ID, >+ IMylarStatusConstants.REPOSITORY_ERROR, "Attachment download from " + repository.getUrl() >+ + " failed, missing attachment filename.")); > } > > try { >@@ -126,5 +134,5 @@ > throw new CoreException(TracCorePlugin.toStatus(e)); > } > } >- >+ > } >Index: src/org/eclipse/mylar/internal/trac/core/TracCorePlugin.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.core/src/org/eclipse/mylar/internal/trac/core/TracCorePlugin.java,v >retrieving revision 1.5 >diff -u -r1.5 TracCorePlugin.java >--- src/org/eclipse/mylar/internal/trac/core/TracCorePlugin.java 20 Feb 2007 01:37:22 -0000 1.5 >+++ src/org/eclipse/mylar/internal/trac/core/TracCorePlugin.java 7 May 2007 02:35:56 -0000 >@@ -17,6 +17,9 @@ > import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Plugin; > import org.eclipse.core.runtime.Status; >+import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >+import org.eclipse.mylar.tasks.core.MylarStatus; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.TaskRepository; > import org.osgi.framework.BundleContext; > >@@ -78,25 +81,33 @@ > return cacheFile; > } > >- public static TracStatus toStatus(Throwable e, TaskRepository repository) { >- TracStatus status = toStatus(e); >- status.setRepositoryUrl(repository.getUrl()); >- return status; >+ public static IStatus toStatus(Throwable e, TaskRepository repository) { >+ if (e instanceof TracLoginException) { >+ return RepositoryStatus.createLoginError(repository.getUrl(), PLUGIN_ID); >+ } else if (e instanceof TracPermissionDeniedException) { >+ return TracStatus.createPermissionDeniedError(repository.getUrl(), PLUGIN_ID); >+ } >+ >+ return toStatus(e); > } > >- public static TracStatus toStatus(Throwable e) { >+ public static IStatus toStatus(Throwable e) { > if (e instanceof TracLoginException) { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.REPOSITORY_LOGIN_ERROR); >+ throw new RuntimeException("Invoke TracCorePlugin.toStatus(Throwable, TaskRepository)"); > } else if (e instanceof TracPermissionDeniedException) { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.PERMISSION_DENIED_ERROR); >+ throw new RuntimeException("Invoke TracCorePlugin.toStatus(Throwable, TaskRepository)"); > } else if (e instanceof TracException) { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.IO_ERROR, e.getMessage()); >+ String message = e.getMessage(); >+ if (message == null) { >+ message = "I/O error has occured"; >+ } >+ return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, message, e); > } else if (e instanceof ClassCastException) { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.IO_ERROR, "Unexpected server response: " + e.getMessage(), e); >+ return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, "Unexpected server response: " + e.getMessage(), e); > } else if (e instanceof MalformedURLException) { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.IO_ERROR, "Repository URL is invalid", e); >+ return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.IO_ERROR, "Repository URL is invalid", e); > } else { >- return new TracStatus(Status.ERROR, PLUGIN_ID, TracStatus.INTERNAL_ERROR, "Unexpected error", e); >+ return new MylarStatus(Status.ERROR, PLUGIN_ID, IMylarStatusConstants.INTERNAL_ERROR, "Unexpected error", e); > } > } > >#P org.eclipse.mylar.trac.ui >Index: src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.trac.ui/src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java,v >retrieving revision 1.22 >diff -u -r1.22 TracRepositorySettingsPage.java >--- src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java 23 Feb 2007 01:36:13 -0000 1.22 >+++ src/org/eclipse/mylar/internal/trac/ui/wizard/TracRepositorySettingsPage.java 7 May 2007 02:35:57 -0000 >@@ -23,9 +23,9 @@ > import org.eclipse.mylar.internal.trac.core.TracException; > import org.eclipse.mylar.internal.trac.core.TracLoginException; > import org.eclipse.mylar.internal.trac.core.TracPermissionDeniedException; >-import org.eclipse.mylar.internal.trac.core.TracStatus; > import org.eclipse.mylar.internal.trac.core.ITracClient.Version; > import org.eclipse.mylar.internal.trac.ui.TracUiPlugin; >+import org.eclipse.mylar.tasks.core.RepositoryStatus; > import org.eclipse.mylar.tasks.core.RepositoryTemplate; > import org.eclipse.mylar.tasks.core.TaskRepository; > import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi; >@@ -168,7 +168,7 @@ > // public for testing > public class TracValidator extends Validator { > >- final String serverUrl; >+ final String repositoryUrl; > > final Version version; > >@@ -181,7 +181,7 @@ > private Version result; > > public TracValidator(TaskRepository repository, Version version) { >- this.serverUrl = repository.getUrl(); >+ this.repositoryUrl = repository.getUrl(); > this.username = repository.getUserName(); > this.password = repository.getPassword(); > this.proxy = repository.getProxy(); >@@ -192,43 +192,47 @@ > try { > validate(); > } catch (MalformedURLException e) { >- throw new CoreException(new TracStatus(IStatus.ERROR, TracUiPlugin.PLUGIN_ID, 0, INVALID_REPOSITORY_URL)); >+ throw new CoreException(RepositoryStatus.createStatus(repositoryUrl, IStatus.ERROR, >+ TracUiPlugin.PLUGIN_ID, INVALID_REPOSITORY_URL)); > } catch (TracLoginException e) { >- throw new CoreException(new TracStatus(IStatus.ERROR, TracUiPlugin.PLUGIN_ID, 0, INVALID_LOGIN)); >- } catch(TracPermissionDeniedException e) { >- throw new CoreException(new TracStatus(IStatus.ERROR, TracUiPlugin.PLUGIN_ID, 0, >- "Insufficient permissions for selected access type.")); >+ throw new CoreException(RepositoryStatus.createStatus(repositoryUrl, IStatus.ERROR, >+ TracUiPlugin.PLUGIN_ID, INVALID_LOGIN)); >+ } catch (TracPermissionDeniedException e) { >+ throw new CoreException(RepositoryStatus.createStatus(repositoryUrl, IStatus.ERROR, >+ TracUiPlugin.PLUGIN_ID, "Insufficient permissions for selected access type.")); > } catch (TracException e) { > String message = "No Trac repository found at url"; > if (e.getMessage() != null) { > message += ": " + e.getMessage(); > } >- throw new CoreException(new TracStatus(IStatus.ERROR, TracUiPlugin.PLUGIN_ID, 0, message)); >+ throw new CoreException(RepositoryStatus.createStatus(repositoryUrl, IStatus.ERROR, >+ TracUiPlugin.PLUGIN_ID, message)); > } > } > > public void validate() throws MalformedURLException, TracException { > if (version != null) { >- ITracClient client = TracClientFactory.createClient(serverUrl, version, username, password, proxy); >+ ITracClient client = TracClientFactory.createClient(repositoryUrl, version, username, password, proxy); > client.validate(); > } else { > // probe version: XML-RPC access first, then web > // access > try { >- ITracClient client = TracClientFactory.createClient(serverUrl, Version.XML_RPC, username, password, >- proxy); >+ ITracClient client = TracClientFactory.createClient(repositoryUrl, Version.XML_RPC, username, >+ password, proxy); > client.validate(); > result = Version.XML_RPC; > } catch (TracException e) { > try { >- ITracClient client = TracClientFactory.createClient(serverUrl, Version.TRAC_0_9, username, >+ ITracClient client = TracClientFactory.createClient(repositoryUrl, Version.TRAC_0_9, username, > password, proxy); > client.validate(); > result = Version.TRAC_0_9; > > if (e instanceof TracPermissionDeniedException) { >- setStatus(new TracStatus(IStatus.INFO, TracUiPlugin.PLUGIN_ID, IStatus.OK, >- "Authentication credentials are valid. Note: Insufficient permissions for XML-RPC access, falling back to web access.")); >+ setStatus(RepositoryStatus >+ .createStatus(repositoryUrl, IStatus.INFO, TracUiPlugin.PLUGIN_ID, >+ "Authentication credentials are valid. Note: Insufficient permissions for XML-RPC access, falling back to web access.")); > } > } catch (TracLoginException e2) { > throw e; >#P org.eclipse.mylar.bugzilla.core >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaClient.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaClient.java,v >retrieving revision 1.63 >diff -u -r1.63 BugzillaClient.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaClient.java 20 Apr 2007 17:48:40 -0000 1.63 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaClient.java 7 May 2007 02:35:57 -0000 >@@ -57,7 +57,6 @@ > import org.eclipse.mylar.internal.bugzilla.core.history.TaskHistory; > import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.QueryHitCollector; > import org.eclipse.mylar.tasks.core.RepositoryOperation; > import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; >@@ -241,7 +240,7 @@ > code = httpClient.executeMethod(getMethod); > } catch (IOException e) { > getMethod.releaseConnection(); >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repositoryUrl.toString(), e)); > } > >@@ -258,20 +257,20 @@ > authenticated = false; > getMethod.getResponseBody(); > getMethod.releaseConnection(); >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), > "Proxy authentication required")); > } else { > getMethod.getResponseBody(); > getMethod.releaseConnection(); >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.NETWORK_ERROR, "Http error: " + HttpStatus.getStatusText(code))); > // throw new IOException("HttpClient connection error response > // code: " + code); > } > } > >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "All connection attempts to " + repositoryUrl.toString() > + " failed. Please verify connection and authentication information.")); > } >@@ -302,12 +301,12 @@ > } > } > >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.NETWORK_ERROR, repositoryUrl.toString(), "Logout unsuccessful.")); > > } catch (ParseException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString() > + ".")); > } finally { >@@ -320,7 +319,7 @@ > public void authenticate() throws CoreException { > if (!hasAuthenticationCredentials()) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), > "Authentication credentials missing.")); > } >@@ -350,7 +349,7 @@ > int code = httpClient.executeMethod(postMethod); > if (code == HttpURLConnection.HTTP_UNAUTHORIZED || code == HttpURLConnection.HTTP_FORBIDDEN) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), > "HTTP authentication failed.")); > } >@@ -369,7 +368,7 @@ > // LoginException(IBugzillaConstants.INVALID_CREDENTIALS); > responseReader.close(); > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), > IBugzillaConstants.INVALID_CREDENTIALS)); > } >@@ -380,12 +379,12 @@ > authenticated = true; > } catch (ParseException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString() > + ".")); > > } catch (IOException e) { >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repositoryUrl.toString(), e)); > } finally { > if (postMethod != null) { >@@ -603,7 +602,7 @@ > parseHtmlError(bufferedReader); > > } else { >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.NETWORK_ERROR, repositoryUrl.toString(), "Http error: " > + HttpStatus.getStatusText(status))); > // throw new IOException("Communication error occurred during >@@ -748,7 +747,7 @@ > return result; > } catch (ParseException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString() > + ".")); > } finally { >@@ -922,19 +921,19 @@ > || (title.indexOf("invalid") != -1 && title.indexOf("password") != -1) > || title.indexOf("check e-mail") != -1) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), title)); > } else if (title.indexOf(IBugzillaConstants.ERROR_MIDAIR_COLLISION) != -1) { >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_COLLISION, repositoryUrl.toString())); > } else if (title.indexOf(IBugzillaConstants.ERROR_COMMENT_REQUIRED) != -1) { >- throw new CoreException(new MylarStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_COMMENT_REQD)); > } else if (title.indexOf(IBugzillaConstants.LOGGED_OUT) != -1) { > authenticated = false; > // throw new > // BugzillaException(IBugzillaConstants.LOGGED_OUT); >- throw new CoreException(new MylarStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.INFO, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.LOGGED_OUT_OF_REPOSITORY, > "You have been logged out. Please retry operation.")); > } else if (title.indexOf(IBugzillaConstants.CHANGES_SUBMITTED) != -1) { >@@ -944,12 +943,12 @@ > } > } > >- throw new CoreException(new MylarStatus(IStatus.INFO, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.INFO, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_ERROR_HTML, repositoryUrl.toString(), body)); > > } catch (ParseException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " + repositoryUrl.toString() > + ".")); > } finally { >@@ -973,12 +972,12 @@ > return parser.retrieveHistory(); > } catch (LoginException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_LOGIN_ERROR, repositoryUrl.toString(), > IBugzillaConstants.INVALID_CREDENTIALS)); > } catch (ParseException e) { > authenticated = false; >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.INTERNAL_ERROR, "Unable to parse response from " > + repositoryUrl.toString() + ".")); > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaTaskDataHandler.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaTaskDataHandler.java,v >retrieving revision 1.11 >diff -u -r1.11 BugzillaTaskDataHandler.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaTaskDataHandler.java 21 Feb 2007 01:09:13 -0000 1.11 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaTaskDataHandler.java 7 May 2007 02:35:57 -0000 >@@ -23,7 +23,6 @@ > import org.eclipse.mylar.tasks.core.AbstractAttributeFactory; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; > import org.eclipse.mylar.tasks.core.ITaskDataHandler; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryOperation; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; > import org.eclipse.mylar.tasks.core.TaskRepository; >@@ -97,7 +96,7 @@ > return null; > > } catch (IOException e) { >- throw new CoreException(new MylarStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repository.getUrl(), e)); > } > } >@@ -118,7 +117,7 @@ > } > > } catch (IOException e) { >- throw new CoreException(new MylarStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repository.getUrl(), e)); > } > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaAttachmentHandler.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaAttachmentHandler.java,v >retrieving revision 1.35 >diff -u -r1.35 BugzillaAttachmentHandler.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaAttachmentHandler.java 10 Feb 2007 05:13:53 -0000 1.35 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaAttachmentHandler.java 7 May 2007 02:35:57 -0000 >@@ -23,7 +23,6 @@ > import org.eclipse.mylar.tasks.core.AbstractRepositoryTask; > import org.eclipse.mylar.tasks.core.IAttachmentHandler; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryAttachment; > import org.eclipse.mylar.tasks.core.RepositoryTaskAttribute; > import org.eclipse.mylar.tasks.core.TaskRepository; >@@ -46,7 +45,7 @@ > byte[] data = client.getAttachmentData(attachment.getId()); > return data; > } catch (IOException e) { >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repository.getUrl(), e)); > } > } >@@ -90,7 +89,7 @@ > BugzillaClient client = connector.getClientManager().getClient(repository); > client.postAttachment(bugId, comment, description, file, contentType, isPatch); > } catch (IOException e) { >- throw new CoreException(new MylarStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.IO_ERROR, repository.getUrl(), e)); > } > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/RepositoryReportFactory.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/RepositoryReportFactory.java,v >retrieving revision 1.23 >diff -u -r1.23 RepositoryReportFactory.java >--- src/org/eclipse/mylar/internal/bugzilla/core/RepositoryReportFactory.java 8 Feb 2007 00:31:29 -0000 1.23 >+++ src/org/eclipse/mylar/internal/bugzilla/core/RepositoryReportFactory.java 7 May 2007 02:35:57 -0000 >@@ -18,7 +18,6 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; > > /** >@@ -43,12 +42,12 @@ > String errorResponse = contentHandler.getErrorMessage().toLowerCase(Locale.ENGLISH); > if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTFOUND) > || errorResponse.equals(IBugzillaConstants.XML_ERROR_INVALIDBUGID)) { >- throw new CoreException(new MylarStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_ERROR, bugReport.getRepositoryUrl(), > IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID)); > } > if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTPERMITTED)) { >- throw new CoreException(new MylarStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_ERROR, bugReport.getRepositoryUrl(), > IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED)); > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/MultiBugReportFactory.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/MultiBugReportFactory.java,v >retrieving revision 1.1 >diff -u -r1.1 MultiBugReportFactory.java >--- src/org/eclipse/mylar/internal/bugzilla/core/MultiBugReportFactory.java 27 Mar 2007 00:30:47 -0000 1.1 >+++ src/org/eclipse/mylar/internal/bugzilla/core/MultiBugReportFactory.java 7 May 2007 02:35:57 -0000 >@@ -19,7 +19,6 @@ > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryTaskData; > > /** >@@ -44,12 +43,12 @@ > String errorResponse = contentHandler.getErrorMessage().toLowerCase(Locale.ENGLISH); > if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTFOUND) > || errorResponse.equals(IBugzillaConstants.XML_ERROR_INVALIDBUGID)) { >- throw new CoreException(new MylarStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_ERROR, "", > IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID)); > } > if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTPERMITTED)) { >- throw new CoreException(new MylarStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, >+ throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, > IMylarStatusConstants.REPOSITORY_ERROR, "", > IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED)); > } >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaStatus.java >=================================================================== >RCS file: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaStatus.java >diff -N src/org/eclipse/mylar/internal/bugzilla/core/BugzillaStatus.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaStatus.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,110 @@ >+/******************************************************************************* >+ * Copyright (c) 2004 - 2006 University Of British Columbia and others. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * University Of British Columbia - initial API and implementation >+ *******************************************************************************/ >+ >+package org.eclipse.mylar.internal.bugzilla.core; >+ >+import org.eclipse.core.runtime.Status; >+import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >+import org.eclipse.mylar.tasks.core.MylarMessages; >+ >+/** >+ * @author Rob Elves >+ */ >+public class BugzillaStatus extends Status implements IMylarStatusConstants { >+ >+ private String errorMessage; >+ >+ private String repositoryUrl = ""; >+ >+ public BugzillaStatus(int severity, String pluginId, int code) { >+ super(severity, pluginId, code, "MylarStatus", null); >+ this.errorMessage = null; >+ } >+ >+ public BugzillaStatus(int severity, String pluginId, int code, String errorMessage) { >+ super(severity, pluginId, code, "MylarStatus", null); >+ this.errorMessage = errorMessage; >+ } >+ >+ public BugzillaStatus(int severity, String pluginId, int code, String repositoryUrl, Throwable e) { >+ super(severity, pluginId, code, "MylarStatus", e); >+ this.repositoryUrl = repositoryUrl; >+ this.errorMessage = e.getMessage(); >+ } >+ >+ public BugzillaStatus(int severity, String pluginId, int code, String repositoryUrl, String errorMessage) { >+ super(severity, pluginId, code, "MylarStatus", null); >+ this.errorMessage = errorMessage; >+ this.repositoryUrl = repositoryUrl; >+ } >+ >+ public BugzillaStatus(int severity, String pluginId, int code, String repositoryUrl, String errorMessage, Throwable e) { >+ super(severity, pluginId, code, "MylarStatus", e); >+ this.errorMessage = errorMessage; >+ this.repositoryUrl = repositoryUrl; >+ } >+ >+ /** >+ * Returns the message that is relevant to the code of this status. >+ */ >+ public String getMessage() { >+ >+ switch (getCode()) { >+ case REPOSITORY_LOGIN_ERROR: >+ return MylarMessages >+ .bind(MylarMessages.repository_login_failure, this.getRepositoryUrl(), this.errorMessage); >+ case REPOSITORY_NOT_FOUND: >+ return MylarMessages.bind(MylarMessages.repository_not_found, this.errorMessage); >+ case REPOSITORY_ERROR: >+ return MylarMessages.bind(MylarMessages.repository_error, this.getRepositoryUrl(), this.errorMessage); >+ case IO_ERROR: >+ String string1 = "Unknown IO error occurred"; >+ String string2 = "No message provided"; >+ if(getException() != null) { >+ string1 = getException().getClass().getSimpleName(); >+ string2 = getException().getMessage(); >+ } >+ Object[] strings = { getRepositoryUrl(), string1, string2 }; >+ return MylarMessages.bind(MylarMessages.io_error, strings); >+ case INTERNAL_ERROR: >+ return MylarMessages.bind(MylarMessages.internal_error, this.errorMessage); >+ case OPERATION_CANCELLED: >+ return MylarMessages.bind(MylarMessages.operation_cancelled, this.errorMessage); >+ case REPOSITORY_COLLISION: >+ return MylarMessages.bind(MylarMessages.repository_collision, this.errorMessage); >+ case REPOSITORY_COMMENT_REQD: >+ if (errorMessage == null) { >+ return MylarMessages.repository_comment_reqd; >+ } else { >+ return errorMessage; >+ } >+ } >+ if (errorMessage != null) { >+ return errorMessage; >+ } else if (getException() != null) { >+ String message = getException().getMessage(); >+ if (message != null) { >+ return message; >+ } else { >+ return getException().toString(); >+ } >+ } >+ return "Unknown"; >+ } >+ >+ public String getRepositoryUrl() { >+ return repositoryUrl; >+ } >+ >+ public void setRepositoryUrl(String repositoryUrl) { >+ this.repositoryUrl = repositoryUrl; >+ } >+} >#P org.eclipse.mylar.bugzilla.ui >Index: src/org/eclipse/mylar/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.ui/src/org/eclipse/mylar/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java,v >retrieving revision 1.55 >diff -u -r1.55 BugzillaRepositorySettingsPage.java >--- src/org/eclipse/mylar/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 14 Mar 2007 21:14:31 -0000 1.55 >+++ src/org/eclipse/mylar/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java 7 May 2007 02:35:57 -0000 >@@ -25,11 +25,11 @@ > import org.eclipse.mylar.internal.bugzilla.core.BugzillaClient; > import org.eclipse.mylar.internal.bugzilla.core.BugzillaClientFactory; > import org.eclipse.mylar.internal.bugzilla.core.BugzillaCorePlugin; >+import org.eclipse.mylar.internal.bugzilla.core.BugzillaStatus; > import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants; > import org.eclipse.mylar.internal.bugzilla.core.RepositoryConfiguration; > import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion; > import org.eclipse.mylar.tasks.core.IMylarStatusConstants; >-import org.eclipse.mylar.tasks.core.MylarStatus; > import org.eclipse.mylar.tasks.core.RepositoryTemplate; > import org.eclipse.mylar.tasks.core.TaskRepository; > import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi; >@@ -346,15 +346,15 @@ > private void displayError(final String serverUrl, Throwable e) { > IStatus status; > if (e instanceof MalformedURLException) { >- status = new MylarStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR, >+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR, > "Server URL is invalid."); > } else if (e instanceof CoreException) { > status = ((CoreException) e).getStatus(); > } else if (e instanceof IOException) { >- status = new MylarStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.IO_ERROR, >+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.IO_ERROR, > serverUrl, e.getMessage()); > } else { >- status = new MylarStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR, >+ status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, IMylarStatusConstants.NETWORK_ERROR, > serverUrl, e.getMessage()); > } > MylarStatusHandler.displayStatus("Validation failed", status);
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 Raw
Actions:
View
Attachments on
bug 170536
:
56935
|
56936
| 66042 |
66043