diff options
author | mkersten | 2007-06-25 04:57:29 +0000 |
---|---|---|
committer | mkersten | 2007-06-25 04:57:29 +0000 |
commit | c0327370082f76161881bdb9ba6a6ff7559b3ab0 (patch) | |
tree | bb4da932dedca29c57a1bf372071ed2ef8a86706 | |
parent | 09f537e346aa5325d85c4afbc35e4ffe636af7a6 (diff) | |
download | org.eclipse.mylyn.tasks-c0327370082f76161881bdb9ba6a6ff7559b3ab0.tar.gz org.eclipse.mylyn.tasks-c0327370082f76161881bdb9ba6a6ff7559b3ab0.tar.xz org.eclipse.mylyn.tasks-c0327370082f76161881bdb9ba6a6ff7559b3ab0.zip |
RESOLVED - bug 194138: cleanup unnecesary casts and null checks
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194138
369 files changed, 2460 insertions, 2574 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AttachmentPartSource.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AttachmentPartSource.java index 8521425c2..503234d78 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AttachmentPartSource.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/AttachmentPartSource.java @@ -27,7 +27,7 @@ public class AttachmentPartSource implements PartSource { public AttachmentPartSource(ITaskAttachment attachment) { this.attachment = attachment; } - + public InputStream createInputStream() throws IOException { return attachment.createInputStream(); } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java index 3e9183e26..afa0a1c73 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttachmentHandler.java @@ -37,13 +37,14 @@ public class BugzillaAttachmentHandler extends AbstractAttachmentHandler { } @Override - public InputStream getAttachmentAsStream(TaskRepository repository, RepositoryAttachment attachment, IProgressMonitor monitor) throws CoreException { + public InputStream getAttachmentAsStream(TaskRepository repository, RepositoryAttachment attachment, + IProgressMonitor monitor) throws CoreException { try { BugzillaClient client = connector.getClientManager().getClient(repository); return client.getAttachmentData(attachment.getId()); } catch (IOException e) { throw new CoreException(new BugzillaStatus(Status.ERROR, BugzillaCorePlugin.PLUGIN_ID, - RepositoryStatus.ERROR_IO, repository.getUrl(), e)); + RepositoryStatus.ERROR_IO, repository.getUrl(), e)); } } @@ -81,4 +82,3 @@ public class BugzillaAttachmentHandler extends AbstractAttachmentHandler { } } - diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java index d84af4c72..2ec73608c 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaAttributeFactory.java @@ -33,17 +33,17 @@ public class BugzillaAttributeFactory extends AbstractAttributeFactory { private static final String creation_ts_format = DATE_FORMAT_1; /** - * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions - * use DATE_FORMAT_2 Using lowest common denominator DATE_FORMAT_1 + * public for testing Bugzilla 2.18 uses DATE_FORMAT_1 but later versions use DATE_FORMAT_2 Using lowest common + * denominator DATE_FORMAT_1 */ public static final String comment_creation_ts_format = DATE_FORMAT_1; private static final String attachment_creation_ts_format = DATE_FORMAT_1; - + private static final long serialVersionUID = 5087501781682994759L; @Override - public String mapCommonAttributeKey(String key) { + public String mapCommonAttributeKey(String key) { if (key.equals(RepositoryTaskAttribute.NEW_CC)) { return BugzillaReportElement.NEWCC.getKeyString(); } else if (key.equals(RepositoryTaskAttribute.COMMENT_DATE)) { @@ -52,7 +52,7 @@ public class BugzillaAttributeFactory extends AbstractAttributeFactory { return BugzillaReportElement.WHO.getKeyString(); } else if (key.equals(RepositoryTaskAttribute.USER_CC)) { return BugzillaReportElement.CC.getKeyString(); - } else if (key.equals(RepositoryTaskAttribute.COMMENT_TEXT)) { + } else if (key.equals(RepositoryTaskAttribute.COMMENT_TEXT)) { return BugzillaReportElement.THETEXT.getKeyString(); } else if (key.equals(RepositoryTaskAttribute.DATE_CREATION)) { return BugzillaReportElement.CREATION_TS.getKeyString(); @@ -94,7 +94,7 @@ public class BugzillaAttributeFactory extends AbstractAttributeFactory { return key; } } - + @Override public boolean isHidden(String key) { try { @@ -121,7 +121,7 @@ public class BugzillaAttributeFactory extends AbstractAttributeFactory { return true; } } - + @Override public Date getDateForAttributeType(String attributeKey, String dateString) { if (dateString == null || dateString.equals("")) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java index 626ac6f1a..4fa130d55 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientFactory.java @@ -33,7 +33,8 @@ public class BugzillaClientFactory { throws MalformedURLException { URL url = new URL(hostUrl); - BugzillaClient client = new BugzillaClient(url, username, password, htAuthUser, htAuthPass, encoding, configParameters); + BugzillaClient client = new BugzillaClient(url, username, password, htAuthUser, htAuthPass, encoding, + configParameters); client.setProxy(proxy); return client; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java index 7b501bd77..5cef28616 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClientManager.java @@ -37,8 +37,8 @@ public class BugzillaClientManager implements ITaskRepositoryListener { String htPass = taskRepository.getHttpPassword() != null ? taskRepository.getHttpPassword() : ""; client = BugzillaClientFactory.createClient(taskRepository.getUrl(), taskRepository.getUserName(), - taskRepository.getPassword(), htUser, htPass, taskRepository.getProxy(), taskRepository - .getCharacterEncoding(), taskRepository.getProperties()); + taskRepository.getPassword(), htUser, htPass, taskRepository.getProxy(), + taskRepository.getCharacterEncoding(), taskRepository.getProperties()); clientByUrl.put(taskRepository.getUrl(), client); } return client; diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java index 240df51a5..adc4ac227 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaCorePlugin.java @@ -267,14 +267,11 @@ public class BugzillaCorePlugin extends Plugin { // Get OS Lookup Map // Check that the result is in Values, if it is not, set it to other - RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS - .getKeyString()); - RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM - .getKeyString()); + RepositoryTaskAttribute opSysAttribute = newBugModel.getAttribute(BugzillaReportElement.OP_SYS.getKeyString()); + RepositoryTaskAttribute platformAttribute = newBugModel.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()); String OS = Platform.getOS(); String platform = Platform.getOSArch(); - String bugzillaOS = null; // Bugzilla String for OS String bugzillaPlatform = null; // Bugzilla String for Platform @@ -286,18 +283,18 @@ public class BugzillaCorePlugin extends Plugin { // // The search in casesensitive. if (opSysAttribute != null) { - while (bugzillaOS!= null && opSysAttribute.getOptionParameter(bugzillaOS) == null) { + while (bugzillaOS != null && opSysAttribute.getOptionParameter(bugzillaOS) == null) { int dotindex = bugzillaOS.lastIndexOf('.'); - if (dotindex > 0) + if (dotindex > 0) bugzillaOS = bugzillaOS.substring(0, dotindex); else { int spaceindex = bugzillaOS.lastIndexOf(' '); - if (spaceindex > 0) + if (spaceindex > 0) bugzillaOS = bugzillaOS.substring(0, spaceindex); - else + else bugzillaOS = null; } - } + } } else { bugzillaOS = null; } @@ -310,18 +307,17 @@ public class BugzillaCorePlugin extends Plugin { // // If the OS is "macosx" we change the Platform to "Macintosh" // - if (bugzillaPlatform!= null && - (bugzillaPlatform.compareTo("Power")== 0 || bugzillaPlatform.compareTo("PC")== 0) && - OS!= null && OS.compareTo("macosx")== 0) { + if (bugzillaPlatform != null + && (bugzillaPlatform.compareTo("Power") == 0 || bugzillaPlatform.compareTo("PC") == 0) + && OS != null && OS.compareTo("macosx") == 0) { bugzillaPlatform = "Macintosh"; - } else - if (platformAttribute != null && platformAttribute.getOptionParameter(bugzillaPlatform) == null) { + } else if (platformAttribute != null && platformAttribute.getOptionParameter(bugzillaPlatform) == null) { // If the platform we found is not int the list of available // optinos, set the // Bugzilla Platform to null, and juse use "other" bugzillaPlatform = null; } - } + } // Set the OS and the Platform in the taskData if (bugzillaOS != null && opSysAttribute != null) { opSysAttribute.setValue(bugzillaOS); @@ -331,7 +327,8 @@ public class BugzillaCorePlugin extends Plugin { if (bugzillaPlatform != null && platformAttribute != null) { platformAttribute.setValue(bugzillaPlatform); - } else if (opSysAttribute != null && platformAttribute != null && platformAttribute.getOptionParameter(OPTION_ALL) != null) { + } else if (opSysAttribute != null && platformAttribute != null + && platformAttribute.getOptionParameter(OPTION_ALL) != null) { opSysAttribute.setValue(OPTION_ALL); } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaMessages.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaMessages.java index e229e6690..1311bbbf4 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaMessages.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaMessages.java @@ -31,9 +31,9 @@ public final class BugzillaMessages extends NLS { public static String repositoryLoginFailure; public static String repositoryNotFound; - + public static String repositoryCommentReqd; - + public static String repositoryCollision; public static String operationCancelled; diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java index 2da998631..5e6edf423 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaReportElement.java @@ -12,100 +12,62 @@ package org.eclipse.mylyn.internal.bugzilla.core; /** - * Bugzilla XML element enum. Each enum has the attribute name - * and associated xml element tag name. + * Bugzilla XML element enum. Each enum has the attribute name and associated xml element tag name. * * @author Rob Elves */ public enum BugzillaReportElement { // Format: ENUM ( "pretty name", "xml key", <hidden: true/false>, <readonly: true/false>) // Hidden elements are not automatically displayed in ui - STATUS_WHITEBOARD ("Status Whiteboard:", "status_whiteboard", true, false), - ACTUAL_TIME ("Hours Worked:", "actual_time", true), - ADD_COMMENT ("Additional Comments:", "comment", true, false), - ASSIGNED_TO ("Assigned to:", "assigned_to", true, true), - ATTACHID ("attachid", "attachid"), - ATTACHMENT ("attachment", "attachment"), - BLOCKED ("Bug blocks:", "blocked", true, false), - BUG ("bug","bug", true), - BUG_FILE_LOC ("URL:", "bug_file_loc", true, false), - BUG_ID ("Bug:", "bug_id", true), - BUG_SEVERITY ("Severity:", "bug_severity", false), - BUG_STATUS ("Status:", "bug_status", true, true), - BUG_WHEN ("bug_when", "bug_when", true, true), - BUGZILLA ("bugzilla", "bugzilla", true), - CC ("CC:", "cc", true, true), - CCLIST_ACCESSIBLE ("CC List", "cclist_accessible", true), - CLASSIFICATION ("Classification:", "classification", true), - CLASSIFICATION_ID ("Classification ID:", "classification_id", true), - COMPONENT ("Component:", "component", false), - CREATION_TS ("Opened:", "creation_ts", true), - CTYPE ("Content Type", "ctype"), - DATA ("data", "data"), - DATE ("Date", "date"), - DEADLINE ("Deadline:", "deadline", true, true), - DELTA_TS ("Modified:", "delta_ts", true), - DEPENDSON ("Bug depends on:", "dependson", true, false), - DESC ("desc", "desc", true, true), - EVERCONFIRMED ("everconfirmed", "everconfirmed", true), - ESTIMATED_TIME ("Estimated Time:", "estimated_time", true), - FILENAME ("filename", "filename"), - GROUP ("Group", "group", true, true), - IS_OBSOLETE ("Obsolete", "isobsolete", true), - IS_PATCH("Patch", "ispatch", true), - KEYWORDS ("Keywords:", "keywords", true), - LONG_DESC ("Description:", "long_desc"), - LONGDESCLENGTH ("Number of comments", "longdesclength", true), - NEWCC ("Add CC:", "newcc", true), - OP_SYS ("OS:", "op_sys", false), - PRIORITY ("Priority:", "priority", false, false), - PRODUCT ("Product:", "product", false), - REP_PLATFORM ("Platform:", "rep_platform", false), - REPORTER ("Reporter:", "reporter", true, true), - REPORTER_ACCESSIBLE ("Reporter", "reporter_accessible", true), - RESOLUTION ("Resolution:", "resolution", false, true), // Exiting bug field, new cc - REMAINING_TIME( "Hours Left:", "remaining_time", true), - SHORT_DESC ("Summary:", "short_desc", true), - TARGET_MILESTONE ("Target milestone:", "target_milestone", false), - THETEXT ("thetext", "thetext", false, true), - TYPE ("type", "type"), - UNKNOWN ("UNKNOWN", "UNKNOWN"), - VERSION ("Version:", "version", false), - INSTALL_VERSION ("version of bugzilla installed", "install_version", true), - VOTES ("Votes:", "votes", true, true), - WORK_TIME("Add Time:", "work_time", true, false), - WHO ("who", "who"), - QA_CONTACT("QA Contact", "qa_contact", false, false), - ADDSELFCC ("Add self to CC", "addselfcc", true, false), + STATUS_WHITEBOARD("Status Whiteboard:", "status_whiteboard", true, false), ACTUAL_TIME("Hours Worked:", + "actual_time", true), ADD_COMMENT("Additional Comments:", "comment", true, false), ASSIGNED_TO( + "Assigned to:", "assigned_to", true, true), ATTACHID("attachid", "attachid"), ATTACHMENT("attachment", + "attachment"), BLOCKED("Bug blocks:", "blocked", true, false), BUG("bug", "bug", true), BUG_FILE_LOC( + "URL:", "bug_file_loc", true, false), BUG_ID("Bug:", "bug_id", true), BUG_SEVERITY("Severity:", + "bug_severity", false), BUG_STATUS("Status:", "bug_status", true, true), BUG_WHEN("bug_when", "bug_when", + true, true), BUGZILLA("bugzilla", "bugzilla", true), CC("CC:", "cc", true, true), CCLIST_ACCESSIBLE( + "CC List", "cclist_accessible", true), CLASSIFICATION("Classification:", "classification", true), CLASSIFICATION_ID( + "Classification ID:", "classification_id", true), COMPONENT("Component:", "component", false), CREATION_TS( + "Opened:", "creation_ts", true), CTYPE("Content Type", "ctype"), DATA("data", "data"), DATE("Date", "date"), DEADLINE( + "Deadline:", "deadline", true, true), DELTA_TS("Modified:", "delta_ts", true), DEPENDSON("Bug depends on:", + "dependson", true, false), DESC("desc", "desc", true, true), EVERCONFIRMED("everconfirmed", + "everconfirmed", true), ESTIMATED_TIME("Estimated Time:", "estimated_time", true), FILENAME("filename", + "filename"), GROUP("Group", "group", true, true), IS_OBSOLETE("Obsolete", "isobsolete", true), IS_PATCH( + "Patch", "ispatch", true), KEYWORDS("Keywords:", "keywords", true), LONG_DESC("Description:", "long_desc"), LONGDESCLENGTH( + "Number of comments", "longdesclength", true), NEWCC("Add CC:", "newcc", true), OP_SYS("OS:", "op_sys", + false), PRIORITY("Priority:", "priority", false, false), PRODUCT("Product:", "product", false), REP_PLATFORM( + "Platform:", "rep_platform", false), REPORTER("Reporter:", "reporter", true, true), REPORTER_ACCESSIBLE( + "Reporter", "reporter_accessible", true), RESOLUTION("Resolution:", "resolution", false, true), // Exiting bug field, new cc + REMAINING_TIME("Hours Left:", "remaining_time", true), SHORT_DESC("Summary:", "short_desc", true), TARGET_MILESTONE( + "Target milestone:", "target_milestone", false), THETEXT("thetext", "thetext", false, true), TYPE("type", + "type"), UNKNOWN("UNKNOWN", "UNKNOWN"), VERSION("Version:", "version", false), INSTALL_VERSION( + "version of bugzilla installed", "install_version", true), VOTES("Votes:", "votes", true, true), WORK_TIME( + "Add Time:", "work_time", true, false), WHO("who", "who"), QA_CONTACT("QA Contact", "qa_contact", false, + false), ADDSELFCC("Add self to CC", "addselfcc", true, false), // Used by search engine - LI ("used by search engine", "li", true), - ID ("used by search engine", "id", true), - SHORT_SHORT_DESC ("used by search engine", "short_short_desc", false), - SEQ ("used by search engine", "seq", false), - RESULT ("used by search engine", "result", false), - RDF ("used by search engine", "rdf", false), - INSTALLATION ("used by search engine", "installation", false), - BUGS ("used by search engine", "bugs", false), - STATUS_OPEN ("open status values", "status_open", true, true), - NEW_COMMENT ("new comment", "new_comment", true, false); - + LI("used by search engine", "li", true), ID("used by search engine", "id", true), SHORT_SHORT_DESC( + "used by search engine", "short_short_desc", false), SEQ("used by search engine", "seq", false), RESULT( + "used by search engine", "result", false), RDF("used by search engine", "rdf", false), INSTALLATION( + "used by search engine", "installation", false), BUGS("used by search engine", "bugs", false), STATUS_OPEN( + "open status values", "status_open", true, true), NEW_COMMENT("new comment", "new_comment", true, false); + private final boolean isHidden; - + private final boolean isReadOnly; - + private final String keyString; - + private final String prettyName; - BugzillaReportElement(String prettyName, String fieldName) { + BugzillaReportElement(String prettyName, String fieldName) { this(prettyName, fieldName, false, false); } - - BugzillaReportElement(String prettyName, String fieldName, boolean hidden) { + + BugzillaReportElement(String prettyName, String fieldName, boolean hidden) { this(prettyName, fieldName, hidden, false); } - - BugzillaReportElement(String prettyName, String fieldName, boolean hidden, boolean readonly) { + + BugzillaReportElement(String prettyName, String fieldName, boolean hidden, boolean readonly) { this.prettyName = prettyName; this.keyString = fieldName; this.isHidden = hidden; @@ -118,12 +80,12 @@ public enum BugzillaReportElement { public boolean isHidden() { return isHidden; - } - + } + public boolean isReadOnly() { return isReadOnly; } - + public String toString() { return prettyName; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java index 6595f407b..ab71e6faf 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaRepositoryConnector.java @@ -223,18 +223,17 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector { } @Override - public boolean updateTaskFromQueryHit(TaskRepository repository, AbstractTask existingTask, - AbstractTask newTask) { + public boolean updateTaskFromQueryHit(TaskRepository repository, AbstractTask existingTask, AbstractTask newTask) { // these properties are not provided by Bugzilla queries newTask.setCompleted(existingTask.isCompleted()); // newTask.setCompletionDate(existingTask.getCompletionDate()); - + boolean changed = super.updateTaskFromQueryHit(repository, existingTask, newTask); - + if (existingTask instanceof BugzillaTask && newTask instanceof BugzillaTask) { BugzillaTask existingBugzillaTask = (BugzillaTask) existingTask; BugzillaTask newBugzillaTask = (BugzillaTask) newTask; - + if (hasTaskPropertyChanged(existingBugzillaTask.getSeverity(), newBugzillaTask.getSeverity())) { existingBugzillaTask.setSeverity(newBugzillaTask.getSeverity()); changed = true; @@ -244,7 +243,7 @@ public class BugzillaRepositoryConnector extends AbstractRepositoryConnector { changed = true; } } - + return changed; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java index 0024e6937..743638f4f 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaStatus.java @@ -45,7 +45,8 @@ public class BugzillaStatus extends Status { this.repositoryUrl = repositoryUrl; } - public BugzillaStatus(int severity, String pluginId, int code, String repositoryUrl, String errorMessage, Throwable e) { + 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; @@ -59,8 +60,8 @@ public class BugzillaStatus extends Status { switch (getCode()) { case RepositoryStatus.ERROR_REPOSITORY_LOGIN: - return BugzillaMessages - .bind(BugzillaMessages.repositoryLoginFailure, this.getRepositoryUrl(), this.errorMessage); + return BugzillaMessages.bind(BugzillaMessages.repositoryLoginFailure, this.getRepositoryUrl(), + this.errorMessage); case RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND: return BugzillaMessages.bind(BugzillaMessages.repositoryNotFound, this.errorMessage); case RepositoryStatus.ERROR_REPOSITORY: @@ -68,7 +69,7 @@ public class BugzillaStatus extends Status { case RepositoryStatus.ERROR_IO: String string1 = "Unknown IO error occurred"; String string2 = "No message provided"; - if(getException() != null) { + if (getException() != null) { string1 = getException().getClass().getSimpleName(); string2 = getException().getMessage(); } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java index 72cb3b53a..8f2638679 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java @@ -17,7 +17,7 @@ public interface IBugzillaConstants { //public static final String POST_ARGS_PASSWORD = "&Bugzilla_password="; //public static final String POST_ARGS_LOGIN = "GoAheadAndLogIn=1&Bugzilla_login="; - + static final String ERROR_MIDAIR_COLLISION = "collision"; static final String ERROR_MSG_MIDAIR_COLLISION = "A mid-air collision has occurred. Please synchronize by selecting Synchronize in the task's context menu."; @@ -27,7 +27,7 @@ public interface IBugzillaConstants { static final String ERROR_MSG_COMMENT_REQUIRED = "You have to specify a new comment when making this change. Please comment on the reason for this change."; static final String ERROR_INVALID_USERNAME_OR_PASSWORD = "Invalid Username or Password"; - + static final String LOGGED_OUT = "logged out"; static final String MOST_RECENT_QUERY = "org.eclipse.mylyn.bugzilla.query.last"; @@ -37,41 +37,41 @@ public interface IBugzillaConstants { public static final int RETURN_ALL_HITS = -1; public static final String CONTENT_TYPE_RDF = "&ctype=rdf"; - + public static final String POST_INPUT_BUGZILLA_PASSWORD = "Bugzilla_password"; - + public static final String POST_INPUT_BUGZILLA_LOGIN = "Bugzilla_login"; - + public static final String POST_INPUT_BUGID = "bugid"; - + public static final String POST_INPUT_ACTION = "action"; - + public static final String POST_INPUT_COMMENT = "comment"; public static final String POST_INPUT_DESCRIPTION = "description"; - + public static final String POST_INPUT_DATA = "data"; - + public static final String URL_POST_LOGIN = "/index.cgi"; public static final String URL_POST_ATTACHMENT_UPLOAD = "/attachment.cgi"; public static final String URL_GET_ATTACHMENT_DOWNLOAD = "/attachment.cgi?id="; - + public static final String URL_GET_ATTACHMENT_SUFFIX = "/attachment.cgi?id="; - + public static final String URL_BUG_ACTIVITY = "/show_activity.cgi?id="; - + public static final String URL_SHOW_VOTES = "/votes.cgi?action=show_bug&bug_id="; - + public static final String URL_VOTE = "/votes.cgi?action=show_user&bug_id="; - + public static final String URL_DEPENDENCY_TREE = "/showdependencytree.cgi?id="; - + public static final String URL_DEPENDENCY_GRAPH = "/showdependencygraph.cgi?id="; public static final String URL_GET_SHOW_BUG = "/show_bug.cgi?id="; - + public static final String URL_GET_CONFIG_RDF = "/config.cgi?ctype=rdf"; //For including fields in the xml (XML Summary mode as they like to call it) @@ -82,19 +82,19 @@ public interface IBugzillaConstants { // and on bug#161321. Thanks -relves // (see also: https://bugzilla.mozilla.org/show_bug.cgi?id=136603https://bugzilla.mozilla.org/show_bug.cgi?id=136603) public static final String URL_GET_SHOW_BUG_XML = "/show_bug.cgi?ctype=xml&excludefield=attachmentdata&id="; - + public static final String URL_GET_SHOW_BUG_XML_NOID = "/show_bug.cgi?ctype=xml&excludefield=attachmentdata"; - + public static final String URL_POST_SHOW_BUG = "/show_bug.cgi"; - + public static final String XML_ERROR_INVALIDBUGID = "invalidbugid"; public static final String XML_ERROR_NOTFOUND = "notfound"; - - public static final String XML_ERROR_NOTPERMITTED = "notpermitted"; + + public static final String XML_ERROR_NOTPERMITTED = "notpermitted"; public static final String ENCODING_UTF_8 = "UTF-8"; - + /** Supported bugzilla repository versions */ static public enum BugzillaServerVersion { SERVER_218, SERVER_220, SERVER_222, SERVER_30; @@ -215,7 +215,7 @@ public interface IBugzillaConstants { public static final String VALUE_STATUS_ASSIGNED = "ASSIGNED"; public static final String VALUE_STATUS_VERIFIED = "VERIFIED"; - + public static final String VALUE_RESOLUTION_LATER = "LATER"; public static enum BUGZILLA_OPERATION { @@ -247,7 +247,7 @@ public interface IBugzillaConstants { public static final String CHANGES_SUBMITTED = "changes submitted"; public static final String SHOW_ACTIVITY = "/show_activity.cgi?id="; - + public static final String REPOSITORY_SETTING_SHORT_LOGIN = "bugzilla.shortLoginEnabled"; public static final String BUGZILLA_TASK_KIND = "Bug"; diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java index ea28f402c..1a20f7976 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/MultiBugReportFactory.java @@ -36,7 +36,8 @@ public class MultiBugReportFactory extends AbstractReportFactory { public void populateReport(Map<String, RepositoryTaskData> bugMap) throws IOException, CoreException { - SaxMultiBugReportContentHandler contentHandler = new SaxMultiBugReportContentHandler(bugzillaAttributeFactory, bugMap); + SaxMultiBugReportContentHandler contentHandler = new SaxMultiBugReportContentHandler(bugzillaAttributeFactory, + bugMap); collectResults(contentHandler, false); if (contentHandler.errorOccurred()) { @@ -44,13 +45,11 @@ public class MultiBugReportFactory extends AbstractReportFactory { if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTFOUND) || errorResponse.equals(IBugzillaConstants.XML_ERROR_INVALIDBUGID)) { throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, - RepositoryStatus.ERROR_REPOSITORY, "", - IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID)); + RepositoryStatus.ERROR_REPOSITORY, "", IBugzillaConstants.ERROR_MSG_INVALID_BUG_ID)); } if (errorResponse.equals(IBugzillaConstants.XML_ERROR_NOTPERMITTED)) { throw new CoreException(new BugzillaStatus(IStatus.WARNING, BugzillaCorePlugin.PLUGIN_ID, - RepositoryStatus.ERROR_REPOSITORY, "", - IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED)); + RepositoryStatus.ERROR_REPOSITORY, "", IBugzillaConstants.ERROR_MSG_OP_NOT_PERMITTED)); } } } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java index a068fe173..2980f4f8b 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java @@ -18,10 +18,8 @@ import java.util.HashMap; import java.util.List; import java.util.Map; - /** - * Class describing the configuration of products and components for a given - * Bugzilla installation. + * Class describing the configuration of products and components for a given Bugzilla installation. * * @author Rob Elves */ @@ -32,7 +30,7 @@ public class RepositoryConfiguration implements Serializable { private static final String VERSION_UNKNOWN = "unknown"; private String repositoryUrl = "<unknown>"; - + private Map<String, ProductEntry> products = new HashMap<String, ProductEntry>(); private List<String> platforms = new ArrayList<String>(); @@ -65,7 +63,7 @@ public class RepositoryConfiguration implements Serializable { super(); // ignore } - + public void addStatus(String status) { bugStatus.add(status); } @@ -102,8 +100,8 @@ public class RepositoryConfiguration implements Serializable { } /** - * Returns an array of names of component that exist for a given product or - * <code>null</code> if the product does not exist. + * Returns an array of names of component that exist for a given product or <code>null</code> if the product does + * not exist. */ public List<String> getComponents(String product) { ProductEntry entry = products.get(product); @@ -114,8 +112,8 @@ public class RepositoryConfiguration implements Serializable { } /** - * Returns an array of names of versions that exist for a given product or - * <code>null</code> if the product does not exist. + * Returns an array of names of versions that exist for a given product or <code>null</code> if the product does + * not exist. */ public List<String> getVersions(String product) { ProductEntry entry = products.get(product); @@ -348,7 +346,7 @@ public class RepositoryConfiguration implements Serializable { public void setRepositoryUrl(String repositoryUrl) { this.repositoryUrl = repositoryUrl; } - + /* * Intermediate step until configuration is made generic. */ @@ -384,6 +382,4 @@ public class RepositoryConfiguration implements Serializable { } } - - } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfigurationFactory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfigurationFactory.java index 355d49fe9..d7fa09572 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfigurationFactory.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfigurationFactory.java @@ -27,10 +27,10 @@ import org.xml.sax.SAXParseException; public class RepositoryConfigurationFactory extends AbstractReportFactory { public RepositoryConfigurationFactory(InputStream inStream, String encoding) { - super(inStream, encoding); + super(inStream, encoding); } - public RepositoryConfiguration getConfiguration() throws IOException, CoreException { + public RepositoryConfiguration getConfiguration() throws IOException, CoreException { SaxConfigurationContentHandler contentHandler = new SaxConfigurationContentHandler(); collectResults(contentHandler, true); RepositoryConfiguration config = contentHandler.getConfiguration(); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugReportContentHandler.java index 5d40e0ffd..87ef9b607 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugReportContentHandler.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxBugReportContentHandler.java @@ -104,8 +104,8 @@ public class SaxBugReportContentHandler extends DefaultHandler { attachment = new RepositoryAttachment(attributeFactory); if (attributes != null) { if ("1".equals(attributes.getValue(BugzillaReportElement.IS_OBSOLETE.getKeyString()))) { - attachment.addAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString(), attributeFactory - .createAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString())); + attachment.addAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString(), + attributeFactory.createAttribute(BugzillaReportElement.IS_OBSOLETE.getKeyString())); attachment.setObsolete(true); } if ("1".equals(attributes.getValue(BugzillaReportElement.IS_PATCH.getKeyString()))) { @@ -219,11 +219,9 @@ public class SaxBugReportContentHandler extends DefaultHandler { case BUG: // Reached end of bug. Need to set LONGDESCLENGTH to number of // comments - RepositoryTaskAttribute numCommentsAttribute = repositoryTaskData - .getAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString()); + RepositoryTaskAttribute numCommentsAttribute = repositoryTaskData.getAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString()); if (numCommentsAttribute == null) { - numCommentsAttribute = attributeFactory.createAttribute(BugzillaReportElement.LONGDESCLENGTH - .getKeyString()); + numCommentsAttribute = attributeFactory.createAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString()); numCommentsAttribute.setValue("" + repositoryTaskData.getComments().size()); repositoryTaskData.addAttribute(BugzillaReportElement.LONGDESCLENGTH.getKeyString(), numCommentsAttribute); @@ -235,11 +233,11 @@ public class SaxBugReportContentHandler extends DefaultHandler { for (RepositoryAttachment attachment : repositoryTaskData.getAttachments()) { TaskComment taskComment = attachIdToComment.get(attachment.getId()); if (taskComment != null) { - attachment.setCreator(taskComment.getAuthor()); + attachment.setCreator(taskComment.getAuthor()); } - attachment.setAttributeValue(RepositoryTaskAttribute.ATTACHMENT_URL, repositoryTaskData - .getRepositoryUrl() - + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachment.getId()); + attachment.setAttributeValue(RepositoryTaskAttribute.ATTACHMENT_URL, + repositoryTaskData.getRepositoryUrl() + IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + + attachment.getId()); attachment.setRepositoryKind(repositoryTaskData.getRepositoryKind()); attachment.setRepositoryUrl(repositoryTaskData.getRepositoryUrl()); attachment.setTaskId(repositoryTaskData.getId()); diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/UnrecognizedReponseException.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/UnrecognizedReponseException.java index e23408ee7..8b156b355 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/UnrecognizedReponseException.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/UnrecognizedReponseException.java @@ -13,7 +13,6 @@ package org.eclipse.mylyn.internal.bugzilla.core; import java.io.IOException; - /** * @author Rob Elves */ diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/XmlCleaner.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/XmlCleaner.java index ead67d1c9..e99527e08 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/XmlCleaner.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/XmlCleaner.java @@ -20,9 +20,8 @@ import org.eclipse.mylyn.web.core.HtmlTag; import org.eclipse.mylyn.web.core.HtmlStreamTokenizer.Token; /** - * This is in place to escape & characters within the resource and rdf:about - * attributes. Currently the values are not escaped which causes sax parser - * errors. This bug has been filed and can be found here: + * This is in place to escape & characters within the resource and rdf:about attributes. Currently the values are not + * escaped which causes sax parser errors. This bug has been filed and can be found here: * https://bugzilla.mozilla.org/show_bug.cgi?id=264785 * * @author Rob Elves diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java index 6ab1c05ea..75b054143 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AssignmentEvent.java @@ -11,15 +11,15 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public class AssignmentEvent extends TaskRevision { private static final long serialVersionUID = 3258693199936631348L; - + private final String assigned; - - public AssignmentEvent(String change){ + + public AssignmentEvent(String change) { this.what = TaskRevision.ASSIGNMENT; this.assigned = change; this.added = change; @@ -28,7 +28,7 @@ public class AssignmentEvent extends TaskRevision { public String getAssigned() { return this.assigned; } - + @Override public String toString() { return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java index b0011d968..702ea9b1c 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentEvent.java @@ -16,7 +16,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; /** - * @author John Anvik + * @author John Anvik */ public class AttachmentEvent extends TaskRevision { @@ -49,8 +49,7 @@ public class AttachmentEvent extends TaskRevision { } // Error situation - System.err.println("WARNING: Cannot find attachment id in " - + attachment); + System.err.println("WARNING: Cannot find attachment id in " + attachment); return -1; } @@ -74,63 +73,46 @@ public class AttachmentEvent extends TaskRevision { * Since we don't know if 'needs-work' applies to 'review' or * 'superreview', deny both */ - flags.add(new AttachmentFlag(AttachmentFlagStatus.REVIEW, - AttachmentFlagState.DENIED)); - flags.add(new AttachmentFlag(AttachmentFlagStatus.SUPERREVIEW, - AttachmentFlagState.DENIED)); + flags.add(new AttachmentFlag(AttachmentFlagStatus.REVIEW, AttachmentFlagState.DENIED)); + flags.add(new AttachmentFlag(AttachmentFlagStatus.SUPERREVIEW, AttachmentFlagState.DENIED)); } else { boolean startsWithReview = token.toLowerCase().startsWith( AttachmentFlagStatus.REVIEW.name().toLowerCase()); boolean firstOrSecondReview = token.toLowerCase().contains( AttachmentFlagStatus.REVIEW.name().toLowerCase()) - && (token.toLowerCase().startsWith("first-") || token - .toLowerCase().startsWith("second-")); + && (token.toLowerCase().startsWith("first-") || token.toLowerCase().startsWith("second-")); /* * if(firstOrSecondReview){ System.err.println("First/second * activated"); } */ if (startsWithReview || firstOrSecondReview) { flagStatus = AttachmentFlagStatus.REVIEW; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.SUPERREVIEW.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.SUPERREVIEW.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.SUPERREVIEW; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.APPROVAL.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.APPROVAL.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.APPROVAL; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.UI.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.UI.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.UI; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.BRANCH.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.BRANCH.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.BRANCH; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.COMMITTED.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.COMMITTED.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.COMMITTED; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.ACCEPTED.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.ACCEPTED.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.ACCEPTED; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.COMMENTED.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.COMMENTED.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.COMMENTED; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.NONE.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.NONE.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.NONE; - } else if (token.toLowerCase().startsWith( - AttachmentFlagStatus.REJECTED.name().toLowerCase())) { + } else if (token.toLowerCase().startsWith(AttachmentFlagStatus.REJECTED.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.REJECTED; } else if (token.equals("1") - || token.toLowerCase().startsWith( - AttachmentFlagStatus.OBSOLETE.name() - .toLowerCase())) { + || token.toLowerCase().startsWith(AttachmentFlagStatus.OBSOLETE.name().toLowerCase())) { flagStatus = AttachmentFlagStatus.OBSOLETE; } // Assure that flag was set to something meaningful - if (flagStatus.equals(AttachmentFlagStatus.UNKNOWN) - && token.equals("") == false) { - System.err - .println("WARNING: Attachment flag status unknown: " - + token); + if (flagStatus.equals(AttachmentFlagStatus.UNKNOWN) && token.equals("") == false) { + System.err.println("WARNING: Attachment flag status unknown: " + token); } if (token.length() > 0) { @@ -141,23 +123,18 @@ public class AttachmentEvent extends TaskRevision { } else if (token.charAt(token.length() - 1) == '-') { flagState = AttachmentFlagState.DENIED; } else if (flagStatus.equals(AttachmentFlagStatus.OBSOLETE) - || flagStatus - .equals(AttachmentFlagStatus.COMMITTED) + || flagStatus.equals(AttachmentFlagStatus.COMMITTED) || flagStatus.equals(AttachmentFlagStatus.ACCEPTED) - || flagStatus - .equals(AttachmentFlagStatus.COMMENTED) + || flagStatus.equals(AttachmentFlagStatus.COMMENTED) || flagStatus.equals(AttachmentFlagStatus.NONE) || flagStatus.equals(AttachmentFlagStatus.REJECTED) - || flagStatus.equals(AttachmentFlagStatus.REVIEW)){ + || flagStatus.equals(AttachmentFlagStatus.REVIEW)) { flagState = AttachmentFlagState.OFF; } } // Assure that flag state was set to something meaningful - if (flagState.equals(AttachmentFlagState.UNKNOWN) - && token.equals("") == false) { - System.err - .println("WARNING: Attachment flag state unknown: " - + token); + if (flagState.equals(AttachmentFlagState.UNKNOWN) && token.equals("") == false) { + System.err.println("WARNING: Attachment flag state unknown: " + token); } flags.add(new AttachmentFlag(flagStatus, flagState)); @@ -168,8 +145,8 @@ public class AttachmentEvent extends TaskRevision { @Override public String toString() { - return this.getName() + " | " + this.getDate() + " | " + this.getWhat() - + " | " + this.attachmentId + " | " + this.getFlagsString(); + return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.attachmentId + " | " + + this.getFlagsString(); } public List<AttachmentFlag> getFlags() { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java index b9d1cc98d..e9e53d9fa 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlag.java @@ -13,18 +13,19 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; import java.io.Serializable; /** - * @author John Anvik + * @author John Anvik */ public class AttachmentFlag implements Serializable { - + /** * */ private static final long serialVersionUID = 1L; - + private final AttachmentFlagStatus status; + private final AttachmentFlagState state; - + public AttachmentFlag(AttachmentFlagStatus status, AttachmentFlagState state) { this.status = status; this.state = state; @@ -40,6 +41,7 @@ public class AttachmentFlag implements Serializable { @Override public String toString() { - return this.status.name() + "[" + (this.state.equals(AttachmentFlagState.UNKNOWN) ? "" : this.state.name()) + "]"; + return this.status.name() + "[" + (this.state.equals(AttachmentFlagState.UNKNOWN) ? "" : this.state.name()) + + "]"; } }
\ No newline at end of file diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java index eac6a8944..d47fe4fa5 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagState.java @@ -11,8 +11,8 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ -public enum AttachmentFlagState{ +public enum AttachmentFlagState { OFF, GRANTED, DENIED, REQUESTED, UNKNOWN; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java index 7c6b5b6ee..9af5f7f26 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/AttachmentFlagStatus.java @@ -11,19 +11,8 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public enum AttachmentFlagStatus { - REVIEW /* Firefox */, - SUPERREVIEW /* Firefox */, - APPROVAL /* Firefox */, - UI /* Firefox */, - BRANCH /* Firefox */, - OBSOLETE, - UNKNOWN, - COMMITTED /* Gnome */, - ACCEPTED /* Gnome accepted-committ_now*/, - COMMENTED /* Gnome */, - NONE /* Gnome */, - REJECTED/* Gnome */ ; + REVIEW /* Firefox */, SUPERREVIEW /* Firefox */, APPROVAL /* Firefox */, UI /* Firefox */, BRANCH /* Firefox */, OBSOLETE, UNKNOWN, COMMITTED /* Gnome */, ACCEPTED /* Gnome accepted-committ_now*/, COMMENTED /* Gnome */, NONE /* Gnome */, REJECTED/* Gnome */; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java index ed23e850a..60f975190 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionEvent.java @@ -11,12 +11,12 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public class ResolutionEvent extends TaskRevision { private static final long serialVersionUID = 6609447743555687524L; - + private final ResolutionType type; public ResolutionEvent(ResolutionType type) { @@ -34,8 +34,8 @@ public class ResolutionEvent extends TaskRevision { @Override public String toString() { - return this.getName() + " | " + this.getDate() + " | " + this.getWhat() - + " | " + this.getRemoved() + " | " + (this.getType().equals(ResolutionType.UNKNOWN) ? "" : this.getType()); + return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " + + (this.getType().equals(ResolutionType.UNKNOWN) ? "" : this.getType()); } } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java index eaf799021..1c823f09b 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/ResolutionType.java @@ -11,13 +11,11 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public enum ResolutionType { - - FIXED, DUPLICATE, WONTFIX, INVALID, WORKSFORME, REOPENED, LATER, - REMIND, MOVED, UNKNOWN, NOTABUG, NOTGNOME, INCOMPLETE, OBSOLETE, EXPIRED, - NOTXIMIAN, NEXTRELEASE, ERRATA, RAWHIDE, UPSTREAM, CANTFIX, CURRENTRELEASE, INSUFFICIENT_DATA, DEFERRED; + + FIXED, DUPLICATE, WONTFIX, INVALID, WORKSFORME, REOPENED, LATER, REMIND, MOVED, UNKNOWN, NOTABUG, NOTGNOME, INCOMPLETE, OBSOLETE, EXPIRED, NOTXIMIAN, NEXTRELEASE, ERRATA, RAWHIDE, UPSTREAM, CANTFIX, CURRENTRELEASE, INSUFFICIENT_DATA, DEFERRED; public static ResolutionType convert(String change) { if (change.equals("FIXED")) { @@ -62,31 +60,31 @@ public enum ResolutionType { if (change.equals("OBSOLETE")) { // Gnome return ResolutionType.OBSOLETE; } - if(change.equals("NOTXIMIAN")){ // Gnome + if (change.equals("NOTXIMIAN")) { // Gnome return ResolutionType.NOTXIMIAN; } - if(change.equals("NEXTRELEASE")){ // Redhat + if (change.equals("NEXTRELEASE")) { // Redhat return ResolutionType.NEXTRELEASE; } - if(change.equals("ERRATA")){// Redhat + if (change.equals("ERRATA")) {// Redhat return ResolutionType.ERRATA; } - if(change.equals("RAWHIDE")){// Redhat + if (change.equals("RAWHIDE")) {// Redhat return ResolutionType.RAWHIDE; } - if(change.equals("UPSTREAM")){// Redhat + if (change.equals("UPSTREAM")) {// Redhat return ResolutionType.UPSTREAM; } - if(change.equals("CANTFIX")){// Redhat + if (change.equals("CANTFIX")) {// Redhat return ResolutionType.CANTFIX; } - if(change.equals("CURRENTRELEASE")){// Redhat + if (change.equals("CURRENTRELEASE")) {// Redhat return ResolutionType.CURRENTRELEASE; } - if(change.equals("INSUFFICIENT_DATA")){// Redhat + if (change.equals("INSUFFICIENT_DATA")) {// Redhat return ResolutionType.INSUFFICIENT_DATA; } - if(change.equals("DEFERRED")){// Redhat + if (change.equals("DEFERRED")) {// Redhat return ResolutionType.DEFERRED; } if (change.equals("") == false) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java index cb728f07c..1b2973adc 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusEvent.java @@ -11,12 +11,12 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public class StatusEvent extends TaskRevision { private static final long serialVersionUID = 245446279981920435L; - + private final StatusType type; public StatusEvent(StatusType type) { @@ -30,7 +30,7 @@ public class StatusEvent extends TaskRevision { @Override public String toString() { - return this.getName() + " | " + this.getDate() + " | " + this.getWhat() - + " | " + this.getRemoved() + " | " + this.getType(); + return this.getName() + " | " + this.getDate() + " | " + this.getWhat() + " | " + this.getRemoved() + " | " + + this.getType(); } } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java index d712c3cb1..d25800763 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/StatusType.java @@ -11,18 +11,11 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; /** - * @author John Anvik + * @author John Anvik */ public enum StatusType { - VERIFIED, - RESOLVED, - CLOSED, - REOPENED, - ASSIGNED, - NEW, - UNCONFIRMED, - NEEDINFO, /* ANT? */ - WAITING , /* GCC */ + VERIFIED, RESOLVED, CLOSED, REOPENED, ASSIGNED, NEW, UNCONFIRMED, NEEDINFO, /* ANT? */ + WAITING, /* GCC */ SUSPENDED, /* GCC */ MODIFIED, /* Redhat */ POST, /* Redhat */ @@ -58,43 +51,43 @@ public enum StatusType { if (change.equals("UNCONFIRMED")) { return UNCONFIRMED; } - if(change.startsWith("NEEDINFO")){ + if (change.startsWith("NEEDINFO")) { return NEEDINFO; } - if(change.equals("WAITING")){ + if (change.equals("WAITING")) { return WAITING; } - if(change.equals("SUSPENDED")){ + if (change.equals("SUSPENDED")) { return SUSPENDED; } - if(change.equals("MODIFIED")){ + if (change.equals("MODIFIED")) { return MODIFIED; } - if(change.equals("POST")){ + if (change.equals("POST")) { return POST; } - if(change.equals("INVESTIGATE")){ + if (change.equals("INVESTIGATE")) { return INVESTIGATE; } - if(change.equals("PASSES_QA")){ + if (change.equals("PASSES_QA")) { return PASSES_QA; } - if(change.equals("PROD_READY")){ + if (change.equals("PROD_READY")) { return PROD_READY; } - if(change.equals("RELEASE_PENDING")){ + if (change.equals("RELEASE_PENDING")) { return RELEASE_PENDING; } - if(change.equals("ON_QA")){ + if (change.equals("ON_QA")) { return ON_QA; } - if(change.equals("QA_READY")){ + if (change.equals("QA_READY")) { return QA_READY; } - if(change.equals("FAILS_QA")){ + if (change.equals("FAILS_QA")) { return FAILS_QA; } - if(change.equals("SPEC")){ + if (change.equals("SPEC")) { return SPEC; } if (change.equals("") == false) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java index e00bda578..9383d146f 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskHistory.java @@ -16,9 +16,8 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; - /** - * @author John Anvik + * @author John Anvik */ public class TaskHistory implements Iterable<TaskRevision>, Serializable { @@ -81,8 +80,8 @@ public class TaskHistory implements Iterable<TaskRevision>, Serializable { } public int size() { - return this.otherEvents.size() + this.statusEvents.size() - + this.resolutionEvents.size() + this.assignmentEvents.size(); + return this.otherEvents.size() + this.statusEvents.size() + this.resolutionEvents.size() + + this.assignmentEvents.size(); } @Override diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java index c71737dc5..8aa709d99 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/history/TaskRevision.java @@ -12,7 +12,6 @@ package org.eclipse.mylyn.internal.bugzilla.core.history; import java.io.Serializable; - /** * @author John Anvik */ @@ -46,7 +45,7 @@ public class TaskRevision implements Comparable<TaskRevision>, Serializable { TaskRevision event = new TaskRevision(); event.setWhat(type); - + if (STATUS.equals(type)) { event = new StatusEvent(StatusType.convert(change)); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java index 378710fdf..74fc63860 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/AbstractBugzillaTest.java @@ -50,7 +50,7 @@ public abstract class AbstractBugzillaTest extends TestCase { protected TaskRepository repository; protected TaskList taskList; - + protected ITaskFactory taskFactory; public AbstractBugzillaTest() { @@ -106,18 +106,20 @@ public abstract class AbstractBugzillaTest extends TestCase { assertEquals(abstractRepositoryClient.getConnectorKind(), DEFAULT_KIND); connector = (BugzillaRepositoryConnector) abstractRepositoryClient; - + taskFactory = new TaskFactory(repository); // connector.setForceSynchExecForTesting(true); TasksUiPlugin.getSynchronizationManager().setForceSyncExec(true); } protected BugzillaTask generateLocalTaskAndDownload(String taskNumber) throws CoreException { - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, new NullProgressMonitor()); + BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, taskNumber, + new NullProgressMonitor()); TasksUiPlugin.getSynchronizationManager().setTaskRead(task, true); assertNotNull(task); - TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); - + TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + return task; } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java index d388b3ec9..8f4adffee 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaConfigurationTest.java @@ -46,7 +46,8 @@ public class BugzillaConfigurationTest extends TestCase { } public void test222RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_222_URL), "","","","", "UTF-8"); + BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_222_URL), "", "", "", "", + "UTF-8"); RepositoryConfiguration config = client.getRepositoryConfiguration(); assertNotNull(config); assertEquals("2.22.1", config.getInstallVersion()); @@ -64,7 +65,8 @@ public class BugzillaConfigurationTest extends TestCase { } public void test2201RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_2201_URL), "","","","", "UTF-8"); + BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_2201_URL), "", "", "", "", + "UTF-8"); RepositoryConfiguration config = client.getRepositoryConfiguration(); assertNotNull(config); assertEquals("2.20.1", config.getInstallVersion()); @@ -82,7 +84,8 @@ public class BugzillaConfigurationTest extends TestCase { } public void test220RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_220_URL), "","","","", "UTF-8"); + BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_220_URL), "", "", "", "", + "UTF-8"); RepositoryConfiguration config = client.getRepositoryConfiguration(); assertNotNull(config); assertEquals("2.20.3", config.getInstallVersion()); @@ -100,7 +103,8 @@ public class BugzillaConfigurationTest extends TestCase { } public void test218RDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_218_URL), "","","","", "UTF-8"); + BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.TEST_BUGZILLA_218_URL), "", "", "", "", + "UTF-8"); RepositoryConfiguration config = client.getRepositoryConfiguration(); assertNotNull(config); assertEquals("2.18.6", config.getInstallVersion()); @@ -118,7 +122,8 @@ public class BugzillaConfigurationTest extends TestCase { } public void testEclipseRDFProductConfig() throws Exception { - BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.ECLIPSE_BUGZILLA_URL), "","","","", "UTF-8"); + BugzillaClient client = new BugzillaClient(new URL(IBugzillaConstants.ECLIPSE_BUGZILLA_URL), "", "", "", "", + "UTF-8"); RepositoryConfiguration config = client.getRepositoryConfiguration(); assertNotNull(config); assertEquals("2.22.1", config.getInstallVersion()); @@ -157,13 +162,11 @@ public class BugzillaConfigurationTest extends TestCase { BugzillaCorePlugin.readRepositoryConfigurationFile(); assertNotNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration1.getRepositoryUrl())); assertNotNull(BugzillaCorePlugin.getRepositoryConfiguration(configuration2.getRepositoryUrl())); - RepositoryConfiguration testLoadedConfig = BugzillaCorePlugin.getRepositoryConfiguration(configuration1 - .getRepositoryUrl()); + RepositoryConfiguration testLoadedConfig = BugzillaCorePlugin.getRepositoryConfiguration(configuration1.getRepositoryUrl()); assertEquals(1, testLoadedConfig.getProducts().size()); assertEquals(configuration1.getProducts().get(0), testLoadedConfig.getProducts().get(0)); } - // @SuppressWarnings("deprecation") // public void testHtmlCleaner() throws IOException, BugzillaException, GeneralSecurityException { // StringBuffer incoming = new StringBuffer(); @@ -179,22 +182,22 @@ public class BugzillaConfigurationTest extends TestCase { // StringBuffer result = XmlCleaner.clean(new StringReader(incoming.toString())); // System.err.println(result); // } - + /** - * Can use this to test config data submitted by users. Be sure not to commit user's config file though. - * The file included (rdfconfig218.txt) is from mylar.eclipse.org/bugs218 + * Can use this to test config data submitted by users. Be sure not to commit user's config file though. The file + * included (rdfconfig218.txt) is from mylar.eclipse.org/bugs218 */ public void testRepositoryConfigurationFromFile() throws Exception { - + URL entryURL = BugzillaTestPlugin.getDefault().getBundle().getEntry("testdata/configuration/rdfconfig218.txt"); assertNotNull(entryURL); URL fileURL = FileLocator.toFileURL(entryURL); - assertNotNull(fileURL); + assertNotNull(fileURL); BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(fileURL.getFile()))); if (true) { - StringBuffer result = XmlCleaner.clean(in); + StringBuffer result = XmlCleaner.clean(in); StringReader strReader = new StringReader(result.toString()); in = new BufferedReader(strReader); } @@ -217,11 +220,12 @@ public class BugzillaConfigurationTest extends TestCase { } }); reader.parse(new InputSource(in)); - + RepositoryConfiguration config = contentHandler.getConfiguration(); assertNotNull(config); - assertTrue(config.getProducts().contains("Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); + assertTrue(config.getProducts().contains( + "Test-Long-Named-Product-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")); // Add your additional checking for valid data here if necessary diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java index 823aabbe1..afe5a6d5a 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaProductParserTest.java @@ -55,7 +55,7 @@ public class BugzillaProductParserTest extends TestCase { repository.setAuthenticationCredentials(credentials.username, credentials.password); return repository; } - + public void test222Products() throws Exception { setRepository(IBugzillaConstants.TEST_BUGZILLA_222_URL); List<String> productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); @@ -65,7 +65,7 @@ public class BugzillaProductParserTest extends TestCase { } public void test2201Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_2201_URL); + setRepository(IBugzillaConstants.TEST_BUGZILLA_2201_URL); List<String> productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); Iterator<String> itr = productList.iterator(); assertTrue(itr.hasNext()); @@ -74,21 +74,21 @@ public class BugzillaProductParserTest extends TestCase { } public void test220Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_220_URL); + setRepository(IBugzillaConstants.TEST_BUGZILLA_220_URL); List<String> productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); assertEquals(2, productList.size()); assertTrue(productList.contains("TestProduct")); - assertTrue(productList.contains("Widget")); + assertTrue(productList.contains("Widget")); } public void test218Products() throws Exception { - setRepository(IBugzillaConstants.TEST_BUGZILLA_218_URL); + setRepository(IBugzillaConstants.TEST_BUGZILLA_218_URL); List<String> productList = BugzillaCorePlugin.getRepositoryConfiguration(repository, false).getProducts(); assertEquals(1, productList.size()); assertTrue(productList.contains("TestProduct")); } - + // No longer supporting 216 // public void test216Products() throws Exception { // diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java index fbee65a92..6f7018921 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaRepositoryConnectorTest.java @@ -184,7 +184,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // Get the task BugzillaTask task = generateLocalTaskAndDownload("3"); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), + task.getTaskId()); assertNotNull(taskData); TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, @@ -204,7 +205,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); // After submit task should be in SYNCHRONIZED state assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); - RepositoryTaskData taskData2 = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData2 = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertFalse(taskData2.getLastModified().equals(taskData.getLastModified())); // Still not read assertFalse(taskData2.getLastModified().equals(task.getLastReadTimeStamp())); @@ -265,7 +267,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { init222(); String taskNumber = "33"; BugzillaTask task = generateLocalTaskAndDownload(taskNumber); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertNotNull(task); assertNotNull(taskData); @@ -356,14 +359,16 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { init222(); String taskID = "4"; BugzillaTask task4 = generateLocalTaskAndDownload(taskID); - RepositoryTaskData taskData4 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task4.getRepositoryUrl(), task4.getTaskId()); + RepositoryTaskData taskData4 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task4.getRepositoryUrl(), + task4.getTaskId()); assertNotNull(task4); assertNotNull(taskData4); assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task4.getSynchronizationState()); assertEquals(taskID, taskData4.getId()); BugzillaTask task5 = generateLocalTaskAndDownload("5"); - RepositoryTaskData taskData5 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task5.getRepositoryUrl(), task5.getTaskId()); + RepositoryTaskData taskData5 = TasksUiPlugin.getTaskDataManager().getEditableCopy(task5.getRepositoryUrl(), + task5.getTaskId()); assertNotNull(task5); assertNotNull(taskData5); assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task5.getSynchronizationState()); @@ -431,7 +436,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { init222(); BugzillaTask task7 = generateLocalTaskAndDownload("7"); - RepositoryTaskData recentTaskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task7.getRepositoryUrl(), task7.getTaskId()); + RepositoryTaskData recentTaskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task7.getRepositoryUrl(), + task7.getTaskId()); assertNotNull(recentTaskData); TasksUiPlugin.getSynchronizationManager().setTaskRead(task7, true); assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task7.getSynchronizationState()); @@ -464,7 +470,7 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { recentTaskData.setAttributeValue(BugzillaReportElement.PRIORITY.getKeyString(), priority); } // REMOVE ALL TASK DATA - TasksUiPlugin.getTaskDataManager().clear(); + TasksUiPlugin.getTaskDataManager().clear(); connector.getTaskDataHandler().postTaskData(repository, recentTaskData, new NullProgressMonitor()); TasksUiPlugin.getSynchronizationManager().synchronizeChanged(connector, repository); assertEquals(RepositoryTaskSyncState.INCOMING, task7.getSynchronizationState()); @@ -498,7 +504,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { */ protected void timeTracker(int taskid, boolean enableDeadline) throws Exception { BugzillaTask bugtask = generateLocalTaskAndDownload("" + taskid); - RepositoryTaskData bugtaskdata = TasksUiPlugin.getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId()); + RepositoryTaskData bugtaskdata = TasksUiPlugin.getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), + bugtask.getTaskId()); assertNotNull(bugtaskdata); assertEquals(taskid + "", bugtaskdata.getId()); assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, bugtask.getSynchronizationState()); @@ -544,14 +551,15 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { // for (AbstractTask task : tasks) { // RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( // task.getHandleIdentifier()); - bugtaskdata.setAttributeValue(BugzillaReportElement.ADD_COMMENT.getKeyString(), "New Estimate: " - + estimatedTime + "\nNew Remaining: " + remainingTime + "\nAdd: " + addTime); - submit(bugtask, bugtaskdata); + bugtaskdata.setAttributeValue(BugzillaReportElement.ADD_COMMENT.getKeyString(), "New Estimate: " + + estimatedTime + "\nNew Remaining: " + remainingTime + "\nAdd: " + addTime); + submit(bugtask, bugtaskdata); // } synchAndAssertState(tasks, RepositoryTaskSyncState.SYNCHRONIZED); - bugtaskdata = TasksUiPlugin.getTaskDataManager().getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId()); + bugtaskdata = TasksUiPlugin.getTaskDataManager() + .getNewTaskData(bugtask.getRepositoryUrl(), bugtask.getTaskId()); assertEquals(estimatedTime, Float.parseFloat(bugtaskdata.getAttributeValue(BugzillaReportElement.ESTIMATED_TIME.getKeyString()))); @@ -588,8 +596,8 @@ public class BugzillaRepositoryConnectorTest extends AbstractBugzillaTest { boolean isPatch[] = { false, true, false, false, false, false, false, true, false, false }; boolean isObsolete[] = { false, true, false, true, false, false, false, false, false, false }; - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( - task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); Iterator<RepositoryAttachment> iter = taskData.getAttachments().iterator(); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java index e18b204c7..5f2061a12 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchDialogTest.java @@ -47,15 +47,14 @@ public class BugzillaSearchDialogTest extends TestCase { } /** - * Test that the search dialog is initialized properly with the given - * repository. + * Test that the search dialog is initialized properly with the given repository. * * @throws Exception */ public void testSearchDialogInit() throws Exception { TaskRepository repo = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL, IBugzillaConstants.BugzillaServerVersion.SERVER_222 - .toString()); + IBugzillaConstants.TEST_BUGZILLA_222_URL, + IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); manager.addRepository(repo, TasksUiPlugin.getDefault().getRepositoriesFilePath()); BugzillaSearchPage page = new BugzillaSearchPage(repo); Shell shell = BugzillaTestPlugin.getDefault().getWorkbench().getDisplay().getShells()[0]; @@ -67,6 +66,6 @@ public class BugzillaSearchDialogTest extends TestCase { * not retrieved properly, throw an exception if the page is not * initialized properly, or pass otherwise. */ - assertFalse(page.getProductCount() == 0); + assertFalse(page.getProductCount() == 0); } } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java index d2c3c3219..2f809b771 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaSearchEngineTest.java @@ -68,8 +68,8 @@ public class BugzillaSearchEngineTest extends TestCase { public void testSearching218() throws Exception { TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_218_URL, IBugzillaConstants.BugzillaServerVersion.SERVER_218 - .toString()); + IBugzillaConstants.TEST_BUGZILLA_218_URL, + IBugzillaConstants.BugzillaServerVersion.SERVER_218.toString()); TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_218_URL, SEARCH_DESCRIPTION).size()); @@ -77,8 +77,8 @@ public class BugzillaSearchEngineTest extends TestCase { public void testSearching220() throws Exception { TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_220_URL, IBugzillaConstants.BugzillaServerVersion.SERVER_220 - .toString()); + IBugzillaConstants.TEST_BUGZILLA_220_URL, + IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_220_URL, SEARCH_DESCRIPTION).size()); @@ -86,8 +86,8 @@ public class BugzillaSearchEngineTest extends TestCase { public void testSearching2201() throws Exception { TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_2201_URL, IBugzillaConstants.BugzillaServerVersion.SERVER_220 - .toString()); + IBugzillaConstants.TEST_BUGZILLA_2201_URL, + IBugzillaConstants.BugzillaServerVersion.SERVER_220.toString()); TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); assertEquals(NUM_EXPECTED_HITS, runQuery(IBugzillaConstants.TEST_BUGZILLA_2201_URL, SEARCH_DESCRIPTION).size()); @@ -95,8 +95,8 @@ public class BugzillaSearchEngineTest extends TestCase { public void testSearching222() throws Exception { TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, - IBugzillaConstants.TEST_BUGZILLA_222_URL, IBugzillaConstants.BugzillaServerVersion.SERVER_222 - .toString()); + IBugzillaConstants.TEST_BUGZILLA_222_URL, + IBugzillaConstants.BugzillaServerVersion.SERVER_222.toString()); TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); Set<AbstractTask> hits = runQuery(IBugzillaConstants.TEST_BUGZILLA_222_URL, SEARCH_DESCRIPTION); @@ -109,9 +109,8 @@ public class BugzillaSearchEngineTest extends TestCase { BugzillaCorePlugin.REPOSITORY_KIND, repositoryURL); assertNotNull(repository); - final BugzillaRepositoryQuery repositoryQuery = new BugzillaRepositoryQuery(repository.getUrl(), repository - .getUrl() - + BUG_DESC_SUBSTRING_SEARCH + SearchString, QUERY_NAME); + final BugzillaRepositoryQuery repositoryQuery = new BugzillaRepositoryQuery(repository.getUrl(), + repository.getUrl() + BUG_DESC_SUBSTRING_SEARCH + SearchString, QUERY_NAME); AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( BugzillaCorePlugin.REPOSITORY_KIND); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java index baf67f3b3..ea2e2b0bf 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskHyperlinkDetectorTest.java @@ -30,14 +30,14 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { private static final String DUPLICATE_NUMBER = "112233"; - private static final String DUPLICATE = "duplicate of "+DUPLICATE_NUMBER; - + private static final String DUPLICATE = "duplicate of " + DUPLICATE_NUMBER; + private String TASK_FORMAT_1 = "task#1"; private String TASK_FORMAT_2 = "task# 1"; private String TASK_FORMAT_3 = "task1"; - + private String TASK_FORMAT_4 = "task #1"; private String BUG_FORMAT_1 = "bug# 1"; @@ -45,11 +45,11 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { private String BUG_FORMAT_2 = "bug # 1"; private String BUG_FORMAT_3 = "bug1"; - + private String BUG_FORMAT_4 = "bug #1"; private String BUG_FORMAT_1_2 = "bug# 2"; - + //private BugzillaTaskHyperlinkDetector detector = new BugzillaTaskHyperlinkDetector(); private TaskHyperlinkDetector detector = new TaskHyperlinkDetector(); @@ -57,7 +57,8 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { private RepositoryTextViewer viewer = new RepositoryTextViewer(dummyRepository, new Shell(), SWT.NONE); - private String[] formats = { TASK_FORMAT_1, TASK_FORMAT_2, TASK_FORMAT_3, TASK_FORMAT_4, BUG_FORMAT_1, BUG_FORMAT_2, BUG_FORMAT_3, BUG_FORMAT_4 }; + private String[] formats = { TASK_FORMAT_1, TASK_FORMAT_2, TASK_FORMAT_3, TASK_FORMAT_4, BUG_FORMAT_1, + BUG_FORMAT_2, BUG_FORMAT_3, BUG_FORMAT_4 }; @Override protected void setUp() throws Exception { @@ -124,9 +125,9 @@ public class BugzillaTaskHyperlinkDetectorTest extends TestCase { assertEquals(1, links.length); assertEquals(testString.indexOf(BUG_FORMAT_1_2), links[0].getHyperlinkRegion().getOffset()); } - + public void testDuplicate() { - String testString = "*** This bug has been marked as a "+DUPLICATE+" ***"; + String testString = "*** This bug has been marked as a " + DUPLICATE + " ***"; viewer.setDocument(new Document(testString)); Region region = new Region(testString.indexOf(DUPLICATE), testString.length()); IHyperlink[] links = detector.detectHyperlinks(viewer, region, false); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java index c4dca0dd0..182f68035 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskListManagerTest.java @@ -92,7 +92,8 @@ public class BugzillaTaskListManagerTest extends TestCase { public void testRepositoryTaskExternalization() { BugzillaTask repositoryTask = new BugzillaTask("repo", "1", "label"); repositoryTask.setTaskKind("kind"); - manager.getTaskList().moveToContainer(repositoryTask, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + manager.getTaskList().moveToContainer(repositoryTask, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); manager.saveTaskList(); manager.resetTaskList(); @@ -101,8 +102,7 @@ public class BugzillaTaskListManagerTest extends TestCase { // manager.setTaskList(list); manager.readExistingOrCreateNewList(); assertEquals(1, manager.getTaskList().getDefaultCategory().getChildren().size()); - AbstractTask readTask = manager.getTaskList().getDefaultCategory().getChildren().iterator() - .next(); + AbstractTask readTask = manager.getTaskList().getDefaultCategory().getChildren().iterator().next(); assertEquals(repositoryTask.getHandleIdentifier(), readTask.getHandleIdentifier()); assertEquals(repositoryTask.getSummary(), readTask.getSummary()); @@ -146,7 +146,9 @@ public class BugzillaTaskListManagerTest extends TestCase { // manager.setTaskList(list); manager.readExistingOrCreateNewList(); assertEquals(1, manager.getTaskList().getQueries().size()); - BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery) manager.getTaskList().getQueries().iterator() + BugzillaRepositoryQuery readQuery = (BugzillaRepositoryQuery) manager.getTaskList() + .getQueries() + .iterator() .next(); assertTrue(readQuery.isCustomQuery()); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java index 9c9862b66..e2da20715 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskTest.java @@ -37,11 +37,11 @@ public class BugzillaTaskTest extends TestCase { private BugzillaAttributeFactory attributeFactory = new BugzillaAttributeFactory(); - @Override protected void setUp() throws Exception { super.setUp(); - new BugzillaTaskDataHandler((BugzillaRepositoryConnector)TasksUiPlugin.getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND)); + new BugzillaTaskDataHandler((BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() + .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND)); } @Override @@ -53,32 +53,31 @@ public class BugzillaTaskTest extends TestCase { BugzillaTask task = new BugzillaTask("repo", "1", "summary"); RepositoryTaskData taskData = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.ECLIPSE_BUGZILLA_URL, "1"); - + //XXX rewrite test - + assertNull(task.getCompletionDate()); Date now = new Date(); String nowTimeStamp = new SimpleDateFormat(BugzillaAttributeFactory.comment_creation_ts_format).format(now); TaskComment taskComment = new TaskComment(new BugzillaAttributeFactory(), 1); - RepositoryTaskAttribute attribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_WHEN - .getKeyString()); + RepositoryTaskAttribute attribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_WHEN.getKeyString()); attribute.setValue(nowTimeStamp); taskComment.addAttribute(BugzillaReportElement.BUG_WHEN.getKeyString(), attribute); taskData.addComment(taskComment); assertNull(task.getCompletionDate()); - RepositoryTaskAttribute resolvedAttribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_STATUS - .getKeyString()); + RepositoryTaskAttribute resolvedAttribute = attributeFactory.createAttribute(BugzillaReportElement.BUG_STATUS.getKeyString()); resolvedAttribute.setValue(IBugzillaConstants.VALUE_STATUS_RESOLVED); taskData.addAttribute(BugzillaReportElement.BUG_STATUS.getKeyString(), resolvedAttribute); - AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); - connector.updateTaskFromTaskData(new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "http://eclipse.org"), task, taskData); + AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( + BugzillaCorePlugin.REPOSITORY_KIND); + connector.updateTaskFromTaskData(new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, "http://eclipse.org"), + task, taskData); assertNotNull(task.getCompletionDate()); - assertEquals(taskData.getAttributeFactory() - .getDateForAttributeType(BugzillaReportElement.BUG_WHEN.getKeyString(), nowTimeStamp), task - .getCompletionDate()); + assertEquals(taskData.getAttributeFactory().getDateForAttributeType( + BugzillaReportElement.BUG_WHEN.getKeyString(), nowTimeStamp), task.getCompletionDate()); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java index d12a53ac3..6bc159bba 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTestPlugin.java @@ -62,8 +62,7 @@ public class BugzillaTestPlugin extends AbstractUIPlugin { } /** - * Returns the string from the plugin's resource bundle, or 'key' if not - * found. + * Returns the string from the plugin's resource bundle, or 'key' if not found. */ public static String getResourceString(String key) { ResourceBundle bundle = BugzillaTestPlugin.getDefault().getResourceBundle(); @@ -88,8 +87,7 @@ public class BugzillaTestPlugin extends AbstractUIPlugin { } /** - * Returns an image descriptor for the image file at the given plug-in - * relative path. + * Returns an image descriptor for the image file at the given plug-in relative path. * * @param path * the path diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java index c1d825c3c..d84b3b68b 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/DuplicateDetetionTest.java @@ -45,7 +45,9 @@ public class DuplicateDetetionTest extends TestCase { String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); @@ -62,7 +64,9 @@ public class DuplicateDetetionTest extends TestCase { public void testNoStackTrace() throws Exception { String fakeStackTrace = "this is not really a stacktrace"; - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(fakeStackTrace); model.setNew(true); IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); @@ -82,7 +86,9 @@ public class DuplicateDetetionTest extends TestCase { String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; String extraText = "\nExtra text that isnt' part of the stack trace java:"; - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(extraText + "\n" + stackTrace + "\n"); model.setNew(true); @@ -92,26 +98,27 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); editor.markDirty(false); editor.close(); } - + public void testStackTraceMisaligned() throws Exception { - String stackTrace = "java.lang.IllegalStateException: zip file closed\n" + - " at java.util.zip.ZipFile.ensureOpen (ZipFile.java:518)\n" + - "at java.util.zip.ZipFile.getEntry (ZipFile.java:251)\n" + - " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + - "at sun.net.www.protocol.jar.URLJarFile.getEntry\n" + - " (URLJarFile.java:90)\n" + - "at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + - "at sun.net.www.protocol.jar.JarURLConnection.getInputStream\n" + - "(JarURLConnection.java:124)\n" + - "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; + String stackTrace = "java.lang.IllegalStateException: zip file closed\n" + + " at java.util.zip.ZipFile.ensureOpen (ZipFile.java:518)\n" + + "at java.util.zip.ZipFile.getEntry (ZipFile.java:251)\n" + + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + + "at sun.net.www.protocol.jar.URLJarFile.getEntry\n" + " (URLJarFile.java:90)\n" + + "at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + + "at sun.net.www.protocol.jar.JarURLConnection.getInputStream\n" + "(JarURLConnection.java:124)\n" + + "at org.eclipse.jdt.internal.core.JavaElement\n.getURLContents(JavaElement.java:734)"; - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -121,25 +128,28 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); editor.markDirty(false); editor.close(); } - + public void testStackTraceSUN() throws Exception { // SUN, IBM (no space before brackets, one set of brackets) - String stackTrace = "java.lang.IllegalStateException: zip file closed\n" + - " at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518)\n" + - " at java.util.zip.ZipFile.getEntry(ZipFile.java:251)\n" + - " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + - " at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)\n" + - " at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + - " at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)\n" + - " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + String stackTrace = "java.lang.IllegalStateException: zip file closed\n" + + " at java.util.zip.ZipFile.ensureOpen(ZipFile.java:518)\n" + + " at java.util.zip.ZipFile.getEntry(ZipFile.java:251)\n" + + " at java.util.jar.JarFile.getEntry(JarFile.java:200)\n" + + " at sun.net.www.protocol.jar.URLJarFile.getEntry(URLJarFile.java:90)\n" + + " at sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:112)\n" + + " at sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:124)\n" + + " at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:734)"; + + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -149,21 +159,24 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); editor.markDirty(false); editor.close(); } - + public void testStackTraceGCJ() throws Exception { // gcj/gij (path and lib names in additional brackets) - String stackTrace = "java.lang.Error: Something bad happened\n" + - " at testcase.main(java.lang.String[]) (Unknown Source)\n" + - " at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)\n" + - " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + String stackTrace = "java.lang.Error: Something bad happened\n" + + " at testcase.main(java.lang.String[]) (Unknown Source)\n" + + " at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)\n" + + " at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)"; + + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -173,20 +186,22 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); - + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); + editor.markDirty(false); editor.close(); } - + public void testStackTraceNoLineNums() throws Exception { // ikvm (no line numbers) - String stackTrace = "java.lang.Error: Something bad happened\n" + - " at testcase.main (testcase.java)\n" + - " at java.lang.reflect.Method.Invoke (Method.java)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java)\n" + + " at java.lang.reflect.Method.Invoke (Method.java)"; + + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -196,22 +211,25 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); - + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); + editor.markDirty(false); editor.close(); } - + public void testStackTraceJRockit() throws Exception { // jrockit (slash delimiters) - String stackTrace = "java.lang.Error: Something bad happened\n" + - " at java/io/BufferedReader.readLine(BufferedReader.java:331)\n" + - " at java/io/BufferedReader.readLine(BufferedReader.java:362)\n" + - " at java/util/Properties.load(Properties.java:192)\n" + - " at java/util/logging/LogManager.readConfiguration(L:555)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + String stackTrace = "java.lang.Error: Something bad happened\n" + + " at java/io/BufferedReader.readLine(BufferedReader.java:331)\n" + + " at java/io/BufferedReader.readLine(BufferedReader.java:362)\n" + + " at java/util/Properties.load(Properties.java:192)\n" + + " at java/util/logging/LogManager.readConfiguration(L:555)"; + + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -221,21 +239,23 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); - + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); + editor.markDirty(false); editor.close(); } - + public void testStackTraceOther() throws Exception { // jamvm, sablevm, kaffe, cacao (space before brackets, one set of brackets) - String stackTrace = "java.lang.Error: Something bad happened\n" + - " at testcase.main (testcase.java:3)\n" + - " at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)\n" + - " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; - - RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + String stackTrace = "java.lang.Error: Something bad happened\n" + " at testcase.main (testcase.java:3)\n" + + " at java.lang.VirtualMachine.invokeMain (VirtualMachine.java)\n" + + " at java.lang.VirtualMachine.main (VirtualMachine.java:108)"; + + RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setDescription(stackTrace); model.setNew(true); @@ -245,8 +265,9 @@ public class DuplicateDetetionTest extends TestCase { TaskEditor taskEditor = (TaskEditor) page.getActiveEditor(); NewBugzillaTaskEditor editor = (NewBugzillaTaskEditor) taskEditor.getActivePageInstance(); - assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()).trim()); - + assertEquals(stackTrace, AbstractNewRepositoryTaskEditor.getStackTraceFromDescription(model.getDescription()) + .trim()); + editor.markDirty(false); editor.close(); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java index c1924f814..045a4b39c 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/EncodingTest.java @@ -24,7 +24,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; */ public class EncodingTest extends AbstractBugzillaTest { - public void testEncodingSetting() { + public void testEncodingSetting() { String charset = BugzillaClient.getCharsetFromString("text/html; charset=UTF-8"); assertEquals("UTF-8", charset); @@ -32,24 +32,22 @@ public class EncodingTest extends AbstractBugzillaTest { charset = BugzillaClient.getCharsetFromString("text/html"); assertEquals(null, charset); - charset = BugzillaClient - .getCharsetFromString("<<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">>"); + charset = BugzillaClient.getCharsetFromString("<<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-2\">>"); assertEquals("iso-8859-2", charset); - charset = BugzillaClient - .getCharsetFromString("<<meta http-equiv=\"Content-Type\" content=\"text/html\">>"); + charset = BugzillaClient.getCharsetFromString("<<meta http-equiv=\"Content-Type\" content=\"text/html\">>"); assertEquals(null, charset); } /** - * This test just shows that when the encoding is changed on the repository - * synchronization does in fact return in a different encoding (though it - * may not be legible) + * This test just shows that when the encoding is changed on the repository synchronization does in fact return in a + * different encoding (though it may not be legible) */ public void testDifferentReportEncoding() throws CoreException { init222(); repository.setCharacterEncoding("UTF-8"); - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", new NullProgressMonitor()); + BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", + new NullProgressMonitor()); assertNotNull(task); //TasksUiPlugin.getSynchronizationManager().synchronize(connector, task, true, null); assertTrue(task.getSummary().equals("\u00E6"));//"\u05D0")); @@ -62,12 +60,14 @@ public class EncodingTest extends AbstractBugzillaTest { // iso-8859-1 'incorrect' interpretation assertFalse(task.getSummary().equals("\u00E6"));//"\u05D0")); } - + public void testProperEncodingUponPost() throws CoreException { init222(); repository.setCharacterEncoding("UTF-8"); - BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", new NullProgressMonitor()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); + BugzillaTask task = (BugzillaTask) connector.createTaskFromExistingId(repository, "57", + new NullProgressMonitor()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertNotNull(task); assertTrue(task.getSummary().equals("\u00E6"));//"\u05D0")); String priority = null; diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java index 3cf339173..2ac2ae5f2 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/NewBugWizardTest.java @@ -30,8 +30,8 @@ public class NewBugWizardTest extends TestCase { public void testPlatformOptions() throws Exception { - - RepositoryTaskData newReport = new RepositoryTaskData(new BugzillaAttributeFactory(), BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1"); + RepositoryTaskData newReport = new RepositoryTaskData(new BugzillaAttributeFactory(), + BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL, "1"); TaskRepository repository = new TaskRepository(BugzillaCorePlugin.REPOSITORY_KIND, IBugzillaConstants.TEST_BUGZILLA_220_URL); @@ -57,7 +57,8 @@ public class NewBugWizardTest extends TestCase { String platform = Platform.getOSArch(); if (platform.equals("x86")) { if (os.equals("macosx")) - assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); + assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) + .getValue()); else assertEquals("PC", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); } else if (platform.equals("x86_64")) @@ -70,9 +71,11 @@ public class NewBugWizardTest extends TestCase { assertEquals("Sun", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); else if (platform.equals("ppc")) { if (os.equals("macosx")) - assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); + assertEquals("Macintosh", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) + .getValue()); else - assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()).getValue()); + assertEquals("Power", newReport.getAttribute(BugzillaReportElement.REP_PLATFORM.getKeyString()) + .getValue()); } } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java index c62262103..28916da5d 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryEditorWizardTest.java @@ -65,9 +65,9 @@ public class RepositoryEditorWizardTest extends TestCase { // page.getHttpAuthPassword(), page.getCharacterEncoding()); page.setPassword("bogus"); try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page - .getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil - .getPlatformProxy(), page.getCharacterEncoding()); + BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), + page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), + WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); client.validate(); } catch (CoreException e) { return; @@ -82,9 +82,9 @@ public class RepositoryEditorWizardTest extends TestCase { BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); page.setUserId("bogus"); try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page - .getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil - .getPlatformProxy(), page.getCharacterEncoding()); + BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), + page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), + WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); client.validate(); } catch (CoreException e) { return; @@ -99,9 +99,9 @@ public class RepositoryEditorWizardTest extends TestCase { BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); page.setUrl("http://invalid"); try { - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page - .getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil - .getPlatformProxy(), page.getCharacterEncoding()); + BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), + page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), + WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); client.validate(); } catch (CoreException e) { assertTrue(e.getStatus().getException() instanceof UnknownHostException); @@ -135,9 +135,9 @@ public class RepositoryEditorWizardTest extends TestCase { WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); dialog.create(); BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page - .getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil.getPlatformProxy(), - page.getCharacterEncoding()); + BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), + page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), + WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); client.validate(); page.setUrl(IBugzillaConstants.TEST_BUGZILLA_218_URL); wizard.performFinish(); @@ -155,9 +155,9 @@ public class RepositoryEditorWizardTest extends TestCase { WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); dialog.create(); BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); - BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page - .getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil.getPlatformProxy(), - page.getCharacterEncoding()); + BugzillaClient client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), + page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), + WebClientUtil.getPlatformProxy(), page.getCharacterEncoding()); client.validate(); page.setUserId("bogus"); wizard.performFinish(); @@ -171,8 +171,8 @@ public class RepositoryEditorWizardTest extends TestCase { page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); try { client = BugzillaClientFactory.createClient(page.getServerUrl(), page.getUserName(), page.getPassword(), - page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil.getPlatformProxy(), page - .getCharacterEncoding()); + page.getHttpAuthUserId(), page.getHttpAuthPassword(), WebClientUtil.getPlatformProxy(), + page.getCharacterEncoding()); client.validate(); } catch (CoreException e) { return; diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java index f08b2344e..bf78c462a 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/RepositoryTaskHandleTest.java @@ -57,12 +57,17 @@ public class RepositoryTaskHandleTest extends TestCase { BugzillaTask bugTask = new BugzillaTask(repository, id, "label 124"); assertEquals(repository, bugTask.getRepositoryUrl()); - manager.getTaskList().moveToContainer(bugTask, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + manager.getTaskList().moveToContainer(bugTask, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); manager.saveTaskList(); manager.resetTaskList(); manager.readExistingOrCreateNewList(); - BugzillaTask readReport = (BugzillaTask) manager.getTaskList().getDefaultCategory().getChildren().iterator().next(); + BugzillaTask readReport = (BugzillaTask) manager.getTaskList() + .getDefaultCategory() + .getChildren() + .iterator() + .next(); assertEquals(readReport.getSummary(), readReport.getSummary()); assertEquals(readReport.getRepositoryUrl(), readReport.getRepositoryUrl()); } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java index c4e05b69f..4d88eaa4e 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskEditorTest.java @@ -47,8 +47,7 @@ public class TaskEditorTest extends TestCase { } /** - * Automated task creation needs to access newly created task editors. This - * test tests that the access is available. + * Automated task creation needs to access newly created task editors. This test tests that the access is available. * * @throws Exception */ @@ -57,7 +56,8 @@ public class TaskEditorTest extends TestCase { IBugzillaConstants.TEST_BUGZILLA_222_URL); RepositoryTaskData model = new RepositoryTaskData(new BugzillaAttributeFactory(), - BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager().getNewRepositoryTaskId()); + BugzillaCorePlugin.REPOSITORY_KIND, repository.getUrl(), TasksUiPlugin.getTaskDataManager() + .getNewRepositoryTaskId()); model.setNew(true); BugzillaRepositoryConnector.setupNewBugAttributes(repository, model); NewTaskEditorInput editorInput = new NewTaskEditorInput(repository, model); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java index d423add5d..1eb26498a 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskListNotificationManagerTest.java @@ -78,14 +78,13 @@ public class TaskListNotificationManagerTest extends TestCase { TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); AbstractTask task = new BugzillaTask("https://bugs.eclipse.org/bugs", "142891", "label"); - assertEquals( RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); + assertEquals(RepositoryTaskSyncState.SYNCHRONIZED, task.getSynchronizationState()); assertFalse(task.isNotified()); TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); notificationManager.collectNotifications(); assertTrue(notificationManager.getNotifications().contains(new TaskListNotificationIncoming(task))); - task = TasksUiPlugin.getTaskListManager().getTaskList().getTask( - "https://bugs.eclipse.org/bugs-142891"); + task = TasksUiPlugin.getTaskListManager().getTaskList().getTask("https://bugs.eclipse.org/bugs-142891"); assertNotNull(task); assertTrue(task.isNotified()); } @@ -97,7 +96,7 @@ public class TaskListNotificationManagerTest extends TestCase { "summary"); TasksUiPlugin.getTaskListManager().getTaskList().addQuery(query); TasksUiPlugin.getTaskListManager().getTaskList().addTask(hit, query); - + TaskListNotificationManager notificationManager = TasksUiPlugin.getTaskListNotificationManager(); assertFalse(hit.isNotified()); notificationManager.collectNotifications(); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java index 8f6774227..dbe334102 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/TaskReportGeneratorTest.java @@ -49,7 +49,7 @@ public class TaskReportGeneratorTest extends TestCase { protected void tearDown() throws Exception { super.tearDown(); manager.resetTaskList(); - TasksUiPlugin.getTaskListManager().saveTaskList(); + TasksUiPlugin.getTaskListManager().saveTaskList(); // TasksUiPlugin.getDefault().getTaskListSaveManager().saveTaskList(true); assertEquals(0, manager.getTaskList().getAllTasks().size()); } @@ -69,14 +69,14 @@ public class TaskReportGeneratorTest extends TestCase { assertEquals(1, generator.getAllCollectedTasks().size()); assertEquals(task1, generator.getAllCollectedTasks().get(0)); } - + public void testCompletedTasksDateBoundsRetrieved() throws InvocationTargetException, InterruptedException { AbstractTask task1 = manager.createNewLocalTask("task 1"); manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); task1.setCompleted(true); Thread.sleep(1000); long now = new Date().getTime(); - + CompletedTaskCollector collector = new CompletedTaskCollector(new Date(now)); TaskReportGenerator generator = new TaskReportGenerator(manager.getTaskList()); generator.addCollector(collector); @@ -90,10 +90,9 @@ public class TaskReportGeneratorTest extends TestCase { assertEquals(1, generator.getAllCollectedTasks().size()); assertEquals(task1, generator.getAllCollectedTasks().get(0)); } - + public void testCompletedBugzillaTasksRetrieved() throws InvocationTargetException, InterruptedException { - BugzillaTask task1 = new BugzillaTask("repo", "1", - "bugzillatask 1"); + BugzillaTask task1 = new BugzillaTask("repo", "1", "bugzillatask 1"); manager.getTaskList().moveToContainer(task1, manager.getTaskList().getDefaultCategory()); CompletedTaskCollector collector = new CompletedTaskCollector(new Date(0)); @@ -133,7 +132,8 @@ public class TaskReportGeneratorTest extends TestCase { public void testCompletedBugzillaTasksInCategoryRetrieved() throws InvocationTargetException, InterruptedException { BugzillaTask task1 = new BugzillaTask("repo", "1", "task 1"); - manager.getTaskList().moveToContainer(task1, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + manager.getTaskList().moveToContainer(task1, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); task1.setCompleted(true); TaskCategory cat1 = new TaskCategory("TaskReportGeneratorTest Category"); manager.getTaskList().addCategory(cat1); @@ -156,7 +156,8 @@ public class TaskReportGeneratorTest extends TestCase { public void testCompletedBugzillaTasksInQueryRetrieved() throws InvocationTargetException, InterruptedException { BugzillaTask task1 = new BugzillaTask("repo", "1", "task 1"); - manager.getTaskList().moveToContainer(task1, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + manager.getTaskList().moveToContainer(task1, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); task1.setCompleted(false); BugzillaRepositoryQuery bugQuery = new BugzillaRepositoryQuery("repositoryUrl", "queryUrl", diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java index 280d96686..d5b64353a 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/headless/BugzillaQueryTest.java @@ -62,8 +62,7 @@ public class BugzillaQueryTest extends TestCase { } /** - * This is the first test so that the repository credentials are correctly - * set for the other tests + * This is the first test so that the repository credentials are correctly set for the other tests */ public void testAddCredentials() { if (!repository.hasCredentials()) { @@ -75,7 +74,7 @@ public class BugzillaQueryTest extends TestCase { } public void testGetBug() throws Exception { - RepositoryTaskData taskData = handler.getTaskData(repository, "1", new NullProgressMonitor()); + RepositoryTaskData taskData = handler.getTaskData(repository, "1", new NullProgressMonitor()); assertNotNull(taskData); assertEquals("user@mylar.eclipse.org", taskData.getAssignedTo()); assertEquals("foo", taskData.getDescription()); @@ -84,7 +83,7 @@ public class BugzillaQueryTest extends TestCase { // part of the bug assertEquals("P1", taskData.getAttributeValue(BugzillaReportElement.PRIORITY.getKeyString())); } - + // TODO: Uncomment when bug#176513 completed // public void testGetBugs() throws Exception { // HashSet<String> taskIds = new HashSet<String>(); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareInput.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareInput.java index 28196213f..a9531a4d8 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareInput.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareInput.java @@ -58,16 +58,14 @@ public class BugzillaCompareInput extends CompareEditorInput { } /** - * @return The original object that's to be compared (appears on the top of - * the compare view). + * @return The original object that's to be compared (appears on the top of the compare view). */ public IStructureComparator getAncestor() { return ancestor; } /** - * Sets the original object that's to be compared (appears on the top of the - * compare view). + * Sets the original object that's to be compared (appears on the top of the compare view). * * @param newAncestor * The new original object. @@ -79,16 +77,14 @@ public class BugzillaCompareInput extends CompareEditorInput { } /** - * @return The local object that's to be compared (appears on the left side - * of the compare view). + * @return The local object that's to be compared (appears on the left side of the compare view). */ public IStructureComparator getLeft() { return left; } /** - * Sets the local object that's to be compared (appears on the left side of - * the compare view). + * Sets the local object that's to be compared (appears on the left side of the compare view). * * @param newLeft * The new local object. @@ -99,16 +95,14 @@ public class BugzillaCompareInput extends CompareEditorInput { } /** - * @return The online object that's to be compared (appears on the right - * side of the compare view). + * @return The online object that's to be compared (appears on the right side of the compare view). */ public IStructureComparator getRight() { return right; } /** - * Sets the online object that's to be compared (appears on the right side - * of the compare view). + * Sets the online object that's to be compared (appears on the right side of the compare view). * * @param newRight * The new online object. diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java index 1b0da2b4d..61b082476 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareNode.java @@ -76,13 +76,13 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo } /** - * This function checks to make sure the given string is not - * <code>null</code>. If it is, the empty string is returned instead. + * This function checks to make sure the given string is not <code>null</code>. If it is, the empty string is + * returned instead. * * @param newValue * The string to be checked. - * @return If the text is <code>null</code>, then return the null string (<code>""</code>). - * Otherwise, return the text. + * @return If the text is <code>null</code>, then return the null string (<code>""</code>). Otherwise, return + * the text. */ private String checkText(String newValue) { return ((newValue == null) ? "" : newValue); @@ -148,8 +148,7 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo } /** - * Sets the image for this object. This image is used when displaying this - * object in the UI. + * Sets the image for this object. This image is used when displaying this object in the UI. * * @param newImage * The new image. @@ -181,9 +180,8 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo } /** - * Parses the given <code>BugReport</code> into a tree of - * <code>BugzillaCompareNode</code>'s suitable for use in a compare - * viewer. + * Parses the given <code>BugReport</code> into a tree of <code>BugzillaCompareNode</code>'s suitable for use + * in a compare viewer. * * @param bug * The <code>BugReport</code> that needs parsing. @@ -196,15 +194,18 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo Image attributeImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_ELEMENT); BugzillaCompareNode attributes = new BugzillaCompareNode("Attributes", null, attributeImage); for (RepositoryTaskAttribute attribute : bug.getAttributes()) { - BugzillaCompareNode child = new BugzillaCompareNode(attribute.toString(), attribute.getValue(), defaultImage); - attributes.addChild(child); + BugzillaCompareNode child = new BugzillaCompareNode(attribute.toString(), attribute.getValue(), + defaultImage); + attributes.addChild(child); } - + BugzillaCompareNode comments = new BugzillaCompareNode("Comments", null, defaultImage); - for (Iterator<TaskComment> iter = bug.getComments().iterator(); iter.hasNext();) { + for (Iterator<TaskComment> iter = bug.getComments().iterator(); iter.hasNext();) { TaskComment taskComment = iter.next(); - String bodyString = "Comment from " + taskComment.getAuthorName() + ":\n\n" + taskComment.getText(); - comments.addChild(new BugzillaCompareNode(taskComment.getAttributeValue(BugzillaReportElement.BUG_WHEN.getKeyString()), bodyString, defaultImage)); + String bodyString = "Comment from " + taskComment.getAuthorName() + ":\n\n" + taskComment.getText(); + comments.addChild(new BugzillaCompareNode( + taskComment.getAttributeValue(BugzillaReportElement.BUG_WHEN.getKeyString()), bodyString, + defaultImage)); } topNode.addChild(comments); @@ -222,7 +223,7 @@ public class BugzillaCompareNode implements IStreamContentAccessor, IStructureCo return titleNode; } - + // public static BugzillaCompareNode parseBugReport(BugzillaReport bug) { // Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEF_VIEW); // BugzillaCompareNode topNode = new BugzillaCompareNode("Bug #" + bug.getId(), null, defaultImage); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareStructureCreator.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareStructureCreator.java index 92a9df9f9..8bb063874 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareStructureCreator.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaCompareStructureCreator.java @@ -16,12 +16,10 @@ import org.eclipse.compare.structuremergeviewer.IStructureCreator; import org.eclipse.mylyn.tasks.core.RepositoryTaskData; /** - * This implementation of the <code>IStructureCreator</code> interface makes - * the contents of a <code>BugReport</code> object available as a hierarchical - * structure of <code>IStructureComparator</code>s. + * This implementation of the <code>IStructureCreator</code> interface makes the contents of a <code>BugReport</code> + * object available as a hierarchical structure of <code>IStructureComparator</code>s. * <p> - * It is used when comparing a modified bug report to the one on the - * corresponding server. + * It is used when comparing a modified bug report to the one on the corresponding server. */ public class BugzillaCompareStructureCreator implements IStructureCreator { @@ -60,15 +58,13 @@ public class BugzillaCompareStructureCreator implements IStructureCreator { } /** - * Called whenever a copy operation has been performed on a tree node. This - * implementation throws an <code>AssertionFailedException</code> since we - * cannot update a bug report object. + * Called whenever a copy operation has been performed on a tree node. This implementation throws an + * <code>AssertionFailedException</code> since we cannot update a bug report object. * * @param structure * the node for which to save the new content * @param input - * the object from which the structure tree was created in - * <code>getStructure</code> + * the object from which the structure tree was created in <code>getStructure</code> */ public void save(IStructureComparator node, Object input) { // ignore diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java index db2d02c58..e530a9d5a 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java @@ -32,13 +32,13 @@ public class BugzillaImages { public static final String T_TOOL = "etool16"; public static final String T_VIEW = "eview16"; - + public static final ImageDescriptor OVERLAY_BUGZILLA = create(T_VIEW, "overlay-bugzilla.gif"); - + public static final ImageDescriptor BUG = create(T_ELCL, "bug.gif"); public static final ImageDescriptor BUG_COMMENT = create(T_ELCL, "bug-comment.gif"); - + public static final ImageDescriptor REMOVE_ALL = create("", "remove-all.gif"); public static final ImageDescriptor REMOVE = create("", "remove.gif"); @@ -48,13 +48,13 @@ public class BugzillaImages { public static final ImageDescriptor OPEN = create("", "openresult.gif"); public static final ImageDescriptor OVERLAY_CRITICAL = create(T_VIEW, "overlay-critical.gif"); - + public static final ImageDescriptor OVERLAY_MAJOR = create(T_VIEW, "overlay-major.gif"); public static final ImageDescriptor OVERLAY_ENHANCEMENT = create(T_VIEW, "overlay-enhancement.gif"); public static final ImageDescriptor OVERLAY_MINOR = create(T_VIEW, "overlay-minor.gif"); - + private static ImageDescriptor create(String prefix, String name) { try { return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name)); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java index 8f5e23f5f..630881b16 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaUiPlugin.java @@ -93,8 +93,8 @@ public class BugzillaUiPlugin extends AbstractUIPlugin { BugzillaCorePlugin.setConfigurationCacheFile(repConfigCacheFile.toFile()); } - BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin - .getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); + BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() + .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); TasksUiPlugin.getRepositoryManager().addListener(bugzillaConnector.getClientManager()); } @@ -118,8 +118,8 @@ public class BugzillaUiPlugin extends AbstractUIPlugin { @Override public void stop(BundleContext context) throws Exception { - BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin - .getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); + BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() + .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); TasksUiPlugin.getRepositoryManager().removeListener(bugzillaConnector.getClientManager()); @@ -135,8 +135,7 @@ public class BugzillaUiPlugin extends AbstractUIPlugin { } /** - * Returns an image descriptor for the image file at the given plug-in - * relative path. + * Returns an image descriptor for the image file at the given plug-in relative path. * * @param path * the path @@ -148,8 +147,7 @@ public class BugzillaUiPlugin extends AbstractUIPlugin { public static String[] getQueryOptions(String prefId, String[] selectedProducts, String repositoryUrl) { IPreferenceStore prefs = BugzillaUiPlugin.getDefault().getPreferenceStore(); - if ((prefId.equals(IBugzillaConstants.VALUES_COMPONENT) || prefId.equals(IBugzillaConstants.VALUES_VERSION) || prefId - .equals(IBugzillaConstants.VALUES_TARGET)) + if ((prefId.equals(IBugzillaConstants.VALUES_COMPONENT) || prefId.equals(IBugzillaConstants.VALUES_VERSION) || prefId.equals(IBugzillaConstants.VALUES_TARGET)) && selectedProducts != null) { List<String> options = new ArrayList<String>(); for (String product : selectedProducts) { @@ -205,9 +203,8 @@ public class BugzillaUiPlugin extends AbstractUIPlugin { } /** - * Update all of the query options for the bugzilla search page TODO: unify - * update of search options with update of bug attributes - * (BugzillaServerFacade.updateBugAttributeOptions) + * Update all of the query options for the bugzilla search page TODO: unify update of search options with update of + * bug attributes (BugzillaServerFacade.updateBugAttributeOptions) */ public static void updateQueryOptions(TaskRepository repository, IProgressMonitor monitor) { diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java index ddb35fc44..4c2d00608 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java @@ -693,7 +693,7 @@ public class BugzillaTaskEditor extends AbstractRepositoryTaskEditor { return null; } } - + @Override /** * This method is duplicated in NewBugzillaTaskEditor for now. diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/DummySearchHitProvider.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/DummySearchHitProvider.java index 5dfbef976..9e612443c 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/DummySearchHitProvider.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/DummySearchHitProvider.java @@ -31,5 +31,4 @@ public class DummySearchHitProvider extends QueryHitCollector { // ignore } - } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java index babf56828..d8b9c5f0c 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java @@ -589,8 +589,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L } /** - * Creates the buttons for remembering a query and accessing previously - * saved queries. + * Creates the buttons for remembering a query and accessing previously saved queries. */ protected Control createSaveQuery(Composite control) { GridLayout layout; @@ -848,8 +847,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L } /** - * Returns <code>true</code> if at least some parameter is given to query - * on. + * Returns <code>true</code> if at least some parameter is given to query on. */ private boolean canQuery() { return product.getSelectionCount() > 0 || component.getSelectionCount() > 0 || version.getSelectionCount() > 0 @@ -861,8 +859,8 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L } /** - * Return search pattern data and update search history list. An existing - * entry will be updated or a new one created. + * Return search pattern data and update search history list. An existing entry will be updated or a new one + * created. */ private BugzillaSearchData getPatternData(Combo widget, Combo operation, ArrayList<BugzillaSearchData> previousSearchQueryData) { @@ -962,8 +960,8 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L /** * Goes through the query form and builds up the query parameters. * - * Example: short_desc_type=substring&short_desc=bla& ... TODO: The - * encoding here should match TaskRepository.getCharacterEncoding() + * Example: short_desc_type=substring&short_desc=bla& ... TODO: The encoding here should match + * TaskRepository.getCharacterEncoding() * * @throws UnsupportedEncodingException */ @@ -1259,9 +1257,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L hardware.setItems(BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_HARDWARE, selectedProducts, repositoryUrl)); - os - .setItems(BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_OS, selectedProducts, - repositoryUrl)); + os.setItems(BugzillaUiPlugin.getQueryOptions(IBugzillaConstants.VALUES_OS, selectedProducts, repositoryUrl)); } } @@ -1314,8 +1310,8 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage implements L String[] options = startingUrl.split("&"); for (String option : options) { String key = option.substring(0, option.indexOf("=")); - String value = URLDecoder.decode(option.substring(option.indexOf("=") + 1), repository - .getCharacterEncoding()); + String value = URLDecoder.decode(option.substring(option.indexOf("=") + 1), + repository.getCharacterEncoding()); if (key == null) continue; diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSeveritySearchSorter.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSeveritySearchSorter.java index 968a4ed17..2ae95272b 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSeveritySearchSorter.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSeveritySearchSorter.java @@ -22,13 +22,12 @@ import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; public class BugzillaSeveritySearchSorter extends ViewerSorter { /** - * Returns a negative, zero, or positive number depending on whether the - * first bug's severity goes before, is the same as, or goes after the - * second element's severity. + * Returns a negative, zero, or positive number depending on whether the first bug's severity goes before, is the + * same as, or goes after the second element's severity. * <p> * - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, - * java.lang.Object, java.lang.Object) + * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { @@ -54,9 +53,8 @@ public class BugzillaSeveritySearchSorter extends ViewerSorter { } /** - * Returns the category of the given element. The category is a number used - * to allocate elements to bins; the bins are arranged in ascending numeric - * order. The elements within a bin are arranged via a second level sort + * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins + * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort * criterion. * <p> * diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaStateSearchSorter.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaStateSearchSorter.java index 99dab3ce2..c1fbc02d8 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaStateSearchSorter.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaStateSearchSorter.java @@ -22,13 +22,12 @@ import org.eclipse.mylyn.internal.bugzilla.ui.BugzillaUiPlugin; public class BugzillaStateSearchSorter extends ViewerSorter { /** - * Returns a negative, zero, or positive number depending on whether the - * first bug's state goes before, is the same as, or goes after the second - * element's state. + * Returns a negative, zero, or positive number depending on whether the first bug's state goes before, is the same + * as, or goes after the second element's state. * <p> * - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, - * java.lang.Object, java.lang.Object) + * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { @@ -71,9 +70,8 @@ public class BugzillaStateSearchSorter extends ViewerSorter { } /** - * Returns the category of the given element. The category is a number used - * to allocate elements to bins; the bins are arranged in ascending numeric - * order. The elements within a bin are arranged via a second level sort + * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins + * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort * criterion. * <p> * 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 e2f3319ec..aa538f410 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 @@ -46,7 +46,7 @@ import org.eclipse.mylyn.tasks.ui.wizards.AbstractRepositorySettingsPage; * @author Eugene Kuleshov */ public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi { - + @Override public String getAccountCreationUrl(TaskRepository taskRepository) { return taskRepository.getUrl() + "/createaccount.cgi"; @@ -56,27 +56,27 @@ public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi { public String getAccountManagementUrl(TaskRepository taskRepository) { return taskRepository.getUrl() + "/userprefs.cgi"; } - + @Override public List<AbstractTaskContainer> getLegendItems() { List<AbstractTaskContainer> legendItems = new ArrayList<AbstractTaskContainer>(); - + BugzillaTask blocker = new BugzillaTask("", "critical", "Critical or Blocker"); - blocker.setSeverity("critical"); + blocker.setSeverity("critical"); legendItems.add(blocker); - + BugzillaTask major = new BugzillaTask("", "major", "Major"); - major.setSeverity("major"); + major.setSeverity("major"); legendItems.add(major); - + BugzillaTask enhancement = new BugzillaTask("", "enhancement", "Enhancement"); - enhancement.setSeverity("enhancement"); + enhancement.setSeverity("enhancement"); legendItems.add(enhancement); - + BugzillaTask trivial = new BugzillaTask("", "trivial", "Trivial or Minor"); - trivial.setSeverity("trivial"); + trivial.setSeverity("trivial"); legendItems.add(trivial); - + return legendItems; } @@ -85,9 +85,9 @@ public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi { @Override public ImageDescriptor getTaskKindOverlay(AbstractTask task) { if (task instanceof BugzillaTask) { - BugzillaTask bugzillaTask = (BugzillaTask)task; + BugzillaTask bugzillaTask = (BugzillaTask) task; String severity = bugzillaTask.getSeverity(); - + if (severity != null) { // XXX: refactor to use configuration if ("blocker".equals(severity) || "critical".equals(severity)) { @@ -157,17 +157,17 @@ public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi { return null; } } - + @Override public String getTaskKindLabel(AbstractTask repositoryTask) { return IBugzillaConstants.BUGZILLA_TASK_KIND; } - + @Override public String getTaskKindLabel(RepositoryTaskData taskData) { return IBugzillaConstants.BUGZILLA_TASK_KIND; } - + @Override public AbstractRepositorySettingsPage getSettingsPage() { return new BugzillaRepositorySettingsPage(this); @@ -205,14 +205,15 @@ public class BugzillaConnectorUi extends AbstractRepositoryConnectorUi { @SuppressWarnings("restriction") @Override public boolean supportsDueDates(AbstractTask task) { - if(task instanceof BugzillaTask){ + if (task instanceof BugzillaTask) { // XXX This is only used in the planning editor, and if its input was set correctly as a RepositoryTaskEditorInput // we wouldn't have to get the task data this way from here - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); - if(taskData != null && taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) != null) + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); + if (taskData != null && taskData.getAttribute(BugzillaReportElement.ESTIMATED_TIME.getKeyString()) != null) return true; } return super.supportsDueDates(task); } - + } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaCustomQueryWizardPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaCustomQueryWizardPage.java index c4868e410..dc6090454 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaCustomQueryWizardPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaCustomQueryWizardPage.java @@ -113,7 +113,7 @@ public class BugzillaCustomQueryWizardPage extends AbstractRepositoryQueryPage { // public boolean isPageComplete() { // return super.canFlipToNextPage(); // } - + // @Override // public IWizardPage getNextPage() { // return null; diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaQueryTypeWizardPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaQueryTypeWizardPage.java index b1a3502d8..c8226ea33 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaQueryTypeWizardPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaQueryTypeWizardPage.java @@ -40,9 +40,9 @@ public class BugzillaQueryTypeWizardPage extends WizardPage { private Button buttonForm; private Composite composite; - + private BugzillaCustomQueryWizardPage customPage; - + private BugzillaSearchPage searchPage; public BugzillaQueryTypeWizardPage(TaskRepository repository) { @@ -50,7 +50,7 @@ public class BugzillaQueryTypeWizardPage extends WizardPage { setTitle(TITLE); setDescription(DESCRIPTION); setImageDescriptor(TasksUiImages.BANNER_REPOSITORY); - customPage = new BugzillaCustomQueryWizardPage(repository); + customPage = new BugzillaCustomQueryWizardPage(repository); searchPage = new BugzillaSearchPage(repository); searchPage.setRestoreQueryOptions(false); } @@ -75,7 +75,7 @@ public class BugzillaQueryTypeWizardPage extends WizardPage { @Override public IWizardPage getNextPage() { - if(buttonForm.getSelection()) { + if (buttonForm.getSelection()) { searchPage.setWizard(this.getWizard()); return searchPage; } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java index 7f1f25a4e..7e0135e25 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositorySettingsPage.java @@ -128,8 +128,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa shortLoginLabel.setText(LABEL_SHORT_LOGINS); cleanQAContact = new Button(parent, SWT.CHECK | SWT.LEFT); if (repository != null) { - boolean shortLogin = Boolean.parseBoolean(repository - .getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN)); + boolean shortLogin = Boolean.parseBoolean(repository.getProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN)); cleanQAContact.setSelection(shortLogin); } @@ -144,8 +143,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa repositoryVersionCombo.select(i); setVersion(version); } else { - for (IBugzillaConstants.BugzillaServerVersion serverVersion : IBugzillaConstants.BugzillaServerVersion - .values()) { + for (IBugzillaConstants.BugzillaServerVersion serverVersion : IBugzillaConstants.BugzillaServerVersion.values()) { if (version.startsWith(serverVersion.toString())) { i = repositoryVersionCombo.indexOf(serverVersion.toString()); if (i != -1) { @@ -165,8 +163,8 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa @Override public void updateProperties(TaskRepository repository) { - repository.setProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, String.valueOf(cleanQAContact - .getSelection())); + repository.setProperty(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN, + String.valueOf(cleanQAContact.getSelection())); } @Override @@ -260,17 +258,17 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa // } // } - @Override protected Validator getValidator(TaskRepository repository) { - - if(repositoryVersionCombo.getSelectionIndex() != 0) { - return new BugzillaValidator(repository, repositoryVersionCombo.getItem(repositoryVersionCombo.getSelectionIndex())); + + if (repositoryVersionCombo.getSelectionIndex() != 0) { + return new BugzillaValidator(repository, + repositoryVersionCombo.getItem(repositoryVersionCombo.getSelectionIndex())); } else { return new BugzillaValidator(repository, null); } } - + // public String getBugzillaVersion() { // if (repositoryVersionCombo.getSelectionIndex() == 0) { // return null; @@ -284,7 +282,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa super.applyValidatorResult(validator); if (((BugzillaValidator) validator).getResult() != null && ((BugzillaValidator) validator).getResult() != null) { - setBugzillaVersion(((BugzillaValidator) validator).getResult()); + setBugzillaVersion(((BugzillaValidator) validator).getResult()); } } @@ -303,7 +301,7 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa final String httpAuthUser; final String httpAuthPass; - + final Proxy proxy; private String[] versions = new String[1];; @@ -342,21 +340,20 @@ public class BugzillaRepositorySettingsPage extends AbstractRepositorySettingsPa // MylarStatusHandler.displayStatus("Validation failed", status); } } - private void displayError(final String serverUrl, Throwable e) { IStatus status; if (e instanceof MalformedURLException) { - status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK, - "Server URL is invalid."); + status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, + RepositoryStatus.ERROR_NETWORK, "Server URL is invalid."); } else if (e instanceof CoreException) { status = ((CoreException) e).getStatus(); } else if (e instanceof IOException) { status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_IO, serverUrl, e.getMessage()); } else { - status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, RepositoryStatus.ERROR_NETWORK, - serverUrl, e.getMessage()); + status = new BugzillaStatus(Status.WARNING, BugzillaCorePlugin.PLUGIN_ID, + RepositoryStatus.ERROR_NETWORK, serverUrl, e.getMessage()); } StatusHandler.displayStatus("Validation failed", status); setStatus(status); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java index 50fb1c72a..79f417151 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java @@ -82,8 +82,8 @@ public class BugzillaTaskEditorInput extends RepositoryTaskEditorInput { private void updateOptions(RepositoryTaskData taskData) { try { if (taskData != null) { - BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin - .getRepositoryManager().getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); + BugzillaRepositoryConnector bugzillaConnector = (BugzillaRepositoryConnector) TasksUiPlugin.getRepositoryManager() + .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); bugzillaConnector.updateAttributeOptions(repository, taskData); } } catch (Exception e) { diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java index aefb5639c..458d0fd05 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskListFactory.java @@ -42,7 +42,7 @@ public class BugzillaTaskListFactory extends AbstractTaskListFactory { public String getTaskElementName() { return TAG_BUGZILLA_REPORT; } - + @Override public Set<String> getQueryElementNames() { Set<String> names = new HashSet<String>(); @@ -50,7 +50,7 @@ public class BugzillaTaskListFactory extends AbstractTaskListFactory { names.add(TAG_BUGZILLA_CUSTOM_QUERY); return names; } - + @Override public boolean canCreate(AbstractRepositoryQuery category) { return category instanceof BugzillaRepositoryQuery; @@ -60,7 +60,7 @@ public class BugzillaTaskListFactory extends AbstractTaskListFactory { public boolean canCreate(AbstractTask task) { return task instanceof BugzillaTask; } - + @Override public String getQueryElementName(AbstractRepositoryQuery query) { if (query instanceof BugzillaRepositoryQuery) { @@ -81,7 +81,7 @@ public class BugzillaTaskListFactory extends AbstractTaskListFactory { } return query; } - + @Override public void setAdditionalAttributes(AbstractTask task, Element element) { element.setAttribute(KEY_SEVERITY, ((BugzillaTask) task).getSeverity()); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java index ce88aa5f8..40e366b94 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/NewBugzillaQueryWizard.java @@ -65,25 +65,25 @@ public class NewBugzillaQueryWizard extends Wizard { TasksUiPlugin.getTaskListManager().getTaskList().addQuery(queryCategory); // boolean offline = MylarTaskListPlugin.getMylarCorePrefs().getBoolean(TaskListPreferenceConstants.WORK_OFFLINE); // if (!offline) { - WorkspaceModifyOperation op = new WorkspaceModifyOperation() { - @Override - protected void execute(IProgressMonitor monitor) throws CoreException { - monitor.beginTask("Executing query", 50); - try { - AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() - .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); - TasksUiPlugin.getSynchronizationManager().synchronize(connector, queryCategory, null, true); - } finally { - monitor.done(); - } + WorkspaceModifyOperation op = new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor monitor) throws CoreException { + monitor.beginTask("Executing query", 50); + try { + AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() + .getRepositoryConnector(BugzillaCorePlugin.REPOSITORY_KIND); + TasksUiPlugin.getSynchronizationManager().synchronize(connector, queryCategory, null, true); + } finally { + monitor.done(); } - }; - - try { - getContainer().run(true, false, op); - } catch (Exception e) { - StatusHandler.log(e, "There was a problem executing the query refresh"); } + }; + + try { + getContainer().run(true, false, op); + } catch (Exception e) { + StatusHandler.log(e, "There was a problem executing the query refresh"); + } // } return true; diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java index 2872d0c88..b1050e383 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/wizard/BugzillaProductPage.java @@ -88,8 +88,7 @@ public class BugzillaProductPage extends WizardPage { private List<String> products = null; /** - * Reference to the bug wizard which created this page so we can create the - * second page + * Reference to the bug wizard which created this page so we can create the second page */ private NewBugzillaTaskWizard bugWizard; @@ -227,9 +226,8 @@ public class BugzillaProductPage extends WizardPage { + "Please ensure proper configuration in " + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ". ", true); } else if (ce.getStatus().getException() instanceof IOException) { - StatusHandler.fail(ce, - "Connection Error, please ensure proper configuration in " - + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ".", true); + StatusHandler.fail(ce, "Connection Error, please ensure proper configuration in " + + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + ".", true); } else { StatusHandler.fail(ce, "Error updating repository attributes for " + repository.getUrl(), true); @@ -310,8 +308,8 @@ public class BugzillaProductPage extends WizardPage { String key = option.substring(0, option.indexOf("=")); if ("product".equals(key)) { try { - products.add(URLDecoder.decode(option.substring(option.indexOf("=") + 1), repository - .getCharacterEncoding())); + products.add(URLDecoder.decode(option.substring(option.indexOf("=") + 1), + repository.getCharacterEncoding())); // TODO: list box only accepts a single selection so // we break on first found break; diff --git a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/actions/ShowMylynLegendAction.java b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/actions/ShowMylynLegendAction.java index 39c992544..cac6f1c59 100644 --- a/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/actions/ShowMylynLegendAction.java +++ b/org.eclipse.mylyn.help.ui/src/org/eclipse/mylyn/internal/help/ui/actions/ShowMylynLegendAction.java @@ -26,7 +26,7 @@ import org.eclipse.ui.PlatformUI; */ public class ShowMylynLegendAction implements IWorkbenchWindowActionDelegate, IViewActionDelegate { - public void dispose() { + public void dispose() { // ignore } @@ -46,6 +46,6 @@ public class ShowMylynLegendAction implements IWorkbenchWindowActionDelegate, IV public void init(IViewPart view) { // ignore - + } } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java index a38d78630..a535243bc 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/CommentQuoter.java @@ -14,17 +14,15 @@ package org.eclipse.mylyn.internal.tasks.core; /** * Utility class to handle many text quoting scenarios * <p> - * Each line of text is quoted individually and wrapped, according to the - * {@link lineSize} attribute + * Each line of text is quoted individually and wrapped, according to the {@link lineSize} attribute * <p> * The wrapping policy is the following: * <p> * <ol> * <li>A substring of {@link lineSize} characters is extracted and examined - * <li>If the next character after the substring is a blank space, the - * substring is quoted - * <li>If don't, the substring is searched backwards for a blank space; if one - * is found, the substring until the blank space is quoted + * <li>If the next character after the substring is a blank space, the substring is quoted + * <li>If don't, the substring is searched backwards for a blank space; if one is found, the substring until the blank + * space is quoted * <li>If no blank space is found, the entire substring is quoted * <li>The remaining of substring + line are reevaluated on step 1 * </ol> diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskDataStorage.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskDataStorage.java index f31c65b55..ff84401b9 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskDataStorage.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ITaskDataStorage.java @@ -11,7 +11,6 @@ package org.eclipse.mylyn.internal.tasks.core; - /** * @author Rob Elves */ @@ -34,17 +33,17 @@ public interface ITaskDataStorage { * if last id remove folder (i.e. in case of refactoring urls) */ public void remove(String repositoryUrl, String id); - + /** * persist any unsaved data */ public void flush(); - + /** * DESTROY ALL OFFLINE DATA */ public void clear(); - + // Methods for NEW unsubmitted task data, currently not used // public void putNew(TaskDataState newTaskDataState); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalAttachment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalAttachment.java index d8ed3448e..0dd47b665 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalAttachment.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalAttachment.java @@ -35,13 +35,13 @@ public class LocalAttachment implements Serializable, ITaskAttachment { private RepositoryTaskData repositoryTaskData; private String filePath; - + private String comment = ""; - + private String description = ""; - + private String contentType = ""; - + private boolean isPatch = false; private String filename; @@ -49,7 +49,7 @@ public class LocalAttachment implements Serializable, ITaskAttachment { private byte[] content; private File file; - + public String getComment() { return comment; } @@ -97,11 +97,11 @@ public class LocalAttachment implements Serializable, ITaskAttachment { public void setFilePath(String filePath) { this.filePath = filePath; } - + public String getFilename() { return this.filename; } - + public void setFilename(String filename) { this.filename = filename; } @@ -115,13 +115,13 @@ public class LocalAttachment implements Serializable, ITaskAttachment { assert file != null || content != null; return (file != null) ? file.length() : content.length; } - + public void setFile(File file) { this.file = file; } - + public void setContent(byte[] content) { this.content = content; } - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java index f160f677a..4a5f889e8 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalRepositoryConnector.java @@ -11,7 +11,6 @@ package org.eclipse.mylyn.internal.tasks.core; - import java.util.Set; import org.eclipse.core.runtime.CoreException; @@ -32,7 +31,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; public class LocalRepositoryConnector extends AbstractRepositoryConnector { public static final String REPOSITORY_LABEL = "Local Tasks"; - + public static final String REPOSITORY_KIND = "local"; public static final String REPOSITORY_URL = "local"; @@ -40,7 +39,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector { public static final String REPOSITORY_VERSION = "1"; public static final String DEFAULT_SUMMARY = "New Task"; - + @Override public boolean canCreateNewTask(TaskRepository repository) { return true; @@ -63,8 +62,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector { } @Override - public boolean markStaleTasks(TaskRepository repository, - Set<AbstractTask> tasks, IProgressMonitor monitor) { + public boolean markStaleTasks(TaskRepository repository, Set<AbstractTask> tasks, IProgressMonitor monitor) { return false; } @@ -128,7 +126,7 @@ public class LocalRepositoryConnector extends AbstractRepositoryConnector { // ignore } - + @Override public boolean isUserManaged() { return false; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java index 9dd34d916..209119c9c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/LocalTask.java @@ -28,7 +28,7 @@ public class LocalTask extends AbstractTask { public boolean isLocal() { return true; } - + @Override public String getConnectorKind() { return LocalRepositoryConnector.REPOSITORY_KIND; @@ -38,17 +38,17 @@ public class LocalTask extends AbstractTask { public boolean isNotified() { return true; } - + @Override public String getLastReadTimeStamp() { return SYNC_DATE_NOW; } - + @Override public String getOwner() { return LocalRepositoryConnector.REPOSITORY_KIND; } - + @Override public String getTaskKey() { return null; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/OfflineDataStore.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/OfflineDataStore.java index 1cf8dee92..37ae102f0 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/OfflineDataStore.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/OfflineDataStore.java @@ -17,8 +17,7 @@ import org.eclipse.mylyn.tasks.core.RepositoryTaskAttribute; import org.eclipse.mylyn.tasks.core.RepositoryTaskData; /** - * This object holds RepositoryTaskData and is serialized to disk for offline - * storage. + * This object holds RepositoryTaskData and is serialized to disk for offline storage. * * @author Rob Elves */ diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java index 119e8deb2..3881a4676 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/RepositoryTaskHandleUtil.java @@ -24,7 +24,7 @@ public class RepositoryTaskHandleUtil { if (!isValidTaskId(taskId)) { throw new RuntimeException("invalid handle for task, can not contain: " + HANDLE_DELIM + ", was: " + taskId); } - + if (repositoryUrl == null) { return MISSING_REPOSITORY + HANDLE_DELIM + taskId; } else { @@ -50,7 +50,6 @@ public class RepositoryTaskHandleUtil { return null; } - public static boolean isValidTaskId(String taskId) { return !taskId.contains(HANDLE_DELIM); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java index 7b7394e7c..340dd8ab6 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesContentHandler.java @@ -34,10 +34,8 @@ public class SaxRepositoriesContentHandler extends DefaultHandler { public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { try { if (localName.equals(TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY) && attributes != null) { - String kind = XmlStringConverter.convertXmlToString(attributes - .getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); - String url = XmlStringConverter.convertXmlToString(attributes - .getValue(IRepositoryConstants.PROPERTY_URL)); + String kind = XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_CONNECTOR_KIND)); + String url = XmlStringConverter.convertXmlToString(attributes.getValue(IRepositoryConstants.PROPERTY_URL)); if (kind != null && kind.length() > 0 && url != null && url.length() > 0) { TaskRepository repository = new TaskRepository(kind, url); for (int index = 0; index < attributes.getLength(); index++) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java index 181a7c73b..ea2b28f91 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/SaxRepositoriesWriter.java @@ -152,22 +152,27 @@ public class SaxRepositoriesWriter { handler.startDocument(); AttributesImpl rootAttributes = new AttributesImpl(); - rootAttributes.addAttribute("", TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, "", "1"); + rootAttributes.addAttribute("", TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, + TaskRepositoriesExternalizer.ATTRIBUTE_VERSION, "", "1"); - handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, rootAttributes); + handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, + TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, rootAttributes); for (TaskRepository repository : new ArrayList<TaskRepository>(repositories)) { AttributesImpl ieAttributes = new AttributesImpl(); for (String key : repository.getProperties().keySet()) { - ieAttributes.addAttribute("", key, key, "", XmlStringConverter.convertToXmlString(repository - .getProperties().get(key))); + ieAttributes.addAttribute("", key, key, "", + XmlStringConverter.convertToXmlString(repository.getProperties().get(key))); } - handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, ieAttributes); - handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY); + handler.startElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, + TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, ieAttributes); + handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY, + TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORY); } - handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES); + handler.endElement("", TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES, + TaskRepositoriesExternalizer.ELEMENT_TASK_REPOSITORIES); handler.endDocument(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java index c408b349b..00c69ea41 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskContainer.java @@ -202,8 +202,7 @@ public class ScheduledTaskContainer extends AbstractTaskCategory { } /** - * The handle for most containers is their summary. Override to specify a - * different natural ordering. + * The handle for most containers is their summary. Override to specify a different natural ordering. */ @Override public int compareTo(AbstractTaskContainer taskListElement) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java index 1a7782cbc..1fc2f9c45 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/ScheduledTaskDelegate.java @@ -38,7 +38,8 @@ public class ScheduledTaskDelegate extends AbstractTask { this(parent, task, start, end, 0); } - public ScheduledTaskDelegate(ScheduledTaskContainer parent, AbstractTask task, Calendar start, Calendar end, long activity) { + public ScheduledTaskDelegate(ScheduledTaskContainer parent, AbstractTask task, Calendar start, Calendar end, + long activity) { super(task.getRepositoryUrl(), task.getTaskId(), task.getSummary()); this.task = task; if (start != null) { @@ -191,7 +192,7 @@ public class ScheduledTaskDelegate extends AbstractTask { public void addParentContainer(AbstractTaskContainer container) { task.addParentContainer(container); } - + @Override public void removeParentContainer(AbstractTaskContainer container) { task.removeParentContainer(container); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskArchive.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskArchive.java index 629e979a7..f5d028e3d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskArchive.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskArchive.java @@ -20,9 +20,9 @@ import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; public class TaskArchive extends AbstractTaskCategory { public static final String HANDLE = "archive"; - + public static final String LABEL_ARCHIVE = "Archive (all tasks)"; - + public TaskArchive() { super(HANDLE); } @@ -36,7 +36,7 @@ public class TaskArchive extends AbstractTaskCategory { public String getHandleIdentifier() { return HANDLE; } - + @Override public String getSummary() { return LABEL_ARCHIVE; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java index eeedb78ca..f95d06590 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskCategory.java @@ -15,7 +15,6 @@ package org.eclipse.mylyn.internal.tasks.core; import org.eclipse.mylyn.tasks.core.AbstractTaskCategory; - /** * @author Mik Kersten */ diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java index edeeb18ef..ab6de3dac 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/TaskRepositoryFilter.java @@ -17,7 +17,7 @@ import org.eclipse.mylyn.tasks.core.TaskRepository; /** * Task repository filter to build list of repositories with required capabilities. * - * @author Eugene Kleshov + * @author Eugene Kleshov * @since 2.0 */ public interface TaskRepositoryFilter { @@ -33,7 +33,7 @@ public interface TaskRepositoryFilter { return !(connector instanceof LocalRepositoryConnector); } }; - + public static TaskRepositoryFilter CAN_CREATE_NEW_TASK = new TaskRepositoryFilter() { public boolean accept(TaskRepository repository, AbstractRepositoryConnector connector) { return connector.canCreateNewTask(repository); @@ -45,8 +45,8 @@ public interface TaskRepositoryFilter { return connector.canCreateTaskFromKey(repository); } }; - - public static TaskRepositoryFilter IS_USER_MANAGED = new TaskRepositoryFilter(){ + + public static TaskRepositoryFilter IS_USER_MANAGED = new TaskRepositoryFilter() { public boolean accept(TaskRepository repository, AbstractRepositoryConnector connector) { return connector.isUserManaged(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnfiledCategory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnfiledCategory.java index e1392c1e5..97bbc9886 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnfiledCategory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/UnfiledCategory.java @@ -28,7 +28,7 @@ public class UnfiledCategory extends AbstractTaskCategory { public UnfiledCategory() { super(HANDLE); } - + @Override public String getPriority() { return PriorityLevel.P1.toString(); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java index 16f637415..4c6d4531b 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttachmentHandler.java @@ -32,12 +32,12 @@ import org.eclipse.mylyn.tasks.core.AbstractTask.RepositoryTaskSyncState; * Extend to provide facility for downloading files from the task repository. * * @author Steffen Pingel - * @since 2.0 + * @since 2.0 */ public abstract class AbstractAttachmentHandler { protected static final int BUFFER_SIZE = 1024; - + private TaskDataManager taskDataManager = null; public static final String MESSAGE_ATTACHMENTS_NOT_SUPPORTED = "Attachments not supported by connector: "; @@ -47,7 +47,7 @@ public abstract class AbstractAttachmentHandler { public final static String MYLAR_CONTEXT_FILENAME = "mylyn-context.zip"; public static final String MYLAR_CONTEXT_DESCRIPTION = "mylyn/context/zip"; - + public abstract void uploadAttachment(TaskRepository repository, AbstractTask task, ITaskAttachment attachment, String comment, IProgressMonitor monitor) throws CoreException; @@ -61,33 +61,35 @@ public abstract class AbstractAttachmentHandler { public abstract boolean canDeprecate(TaskRepository repository, RepositoryAttachment attachment); /** - * To deprecate, change the attribute on the RepositoryAttachment and pass - * to this method + * To deprecate, change the attribute on the RepositoryAttachment and pass to this method */ - public abstract void updateAttachment(TaskRepository repository, RepositoryAttachment attachment) throws CoreException; - + public abstract void updateAttachment(TaskRepository repository, RepositoryAttachment attachment) + throws CoreException; + public void downloadAttachment(TaskRepository repository, RepositoryAttachment attachment, OutputStream out, IProgressMonitor monitor) throws CoreException { monitor.beginTask("Downloading attachment", IProgressMonitor.UNKNOWN); try { - InputStream in = new BufferedInputStream(getAttachmentAsStream(repository, attachment, new SubProgressMonitor(monitor, 1))); + InputStream in = new BufferedInputStream(getAttachmentAsStream(repository, attachment, + new SubProgressMonitor(monitor, 1))); try { - byte[] buffer = new byte[BUFFER_SIZE]; + byte[] buffer = new byte[BUFFER_SIZE]; while (true) { int count = in.read(buffer); if (count == -1) { return; } - if (monitor.isCanceled()) { + if (monitor.isCanceled()) { throw new OperationCanceledException(); } out.write(buffer, 0, count); - if (monitor.isCanceled()) { + if (monitor.isCanceled()) { throw new OperationCanceledException(); } } } catch (IOException e) { - throw new CoreException(RepositoryStatus.createStatus(repository, IStatus.ERROR, "org.eclipse.mylyn.tasks.core", "IO error reading attachment: " + e.getMessage())); + throw new CoreException(RepositoryStatus.createStatus(repository, IStatus.ERROR, + "org.eclipse.mylyn.tasks.core", "IO error reading attachment: " + e.getMessage())); } finally { try { in.close(); @@ -108,7 +110,7 @@ public abstract class AbstractAttachmentHandler { return (remoteContextAttachments != null && remoteContextAttachments.size() > 0); } } - + /** * Implementors of this repositoryOperations must perform it locally without going to the server since it is used * for frequent repositoryOperations such as decoration. @@ -166,7 +168,7 @@ public abstract class AbstractAttachmentHandler { } return true; } - + /** * Retrieves a context stored in <code>attachment</code> from <code>task</code>. * @@ -202,9 +204,9 @@ public abstract class AbstractAttachmentHandler { } return true; } - + public void setTaskDataManager(TaskDataManager taskDataManager) { this.taskDataManager = taskDataManager; } - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java index eab845474..709c65def 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractAttributeFactory.java @@ -14,12 +14,11 @@ package org.eclipse.mylyn.tasks.core; import java.io.Serializable; import java.util.Date; - /** * Extend to provide mapping between repository task attribute IDs and native repository IDs. * * @author Rob Elves - * @since 2.0 + * @since 2.0 */ public abstract class AbstractAttributeFactory implements Serializable { @@ -29,15 +28,15 @@ public abstract class AbstractAttributeFactory implements Serializable { attribute.setReadOnly(isReadOnly(mapped)); return attribute; } - + public abstract String mapCommonAttributeKey(String key); - + public abstract String getName(String key); - + public abstract boolean isReadOnly(String key); public abstract boolean isHidden(String key); - + /** * @return null if date cannot be parsed */ diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java index d450077b1..5eb4dab7d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryConnector.java @@ -24,12 +24,12 @@ import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants; import org.eclipse.mylyn.internal.tasks.core.TaskDataManager; /** - * Encapsulates common operations that can be performed on a task repository. Extend to - * connect with a Java API or WS API for accessing the repository. + * Encapsulates common operations that can be performed on a task repository. Extend to connect with a Java API or WS + * API for accessing the repository. * * @author Mik Kersten * @author Rob Elves - * @since 2.0 + * @since 2.0 */ public abstract class AbstractRepositoryConnector { @@ -44,7 +44,7 @@ public abstract class AbstractRepositoryConnector { public void init(TaskList taskList) { this.taskList = taskList; } - + /** * Set upon construction */ @@ -210,8 +210,7 @@ public abstract class AbstractRepositoryConnector { * @return true, if properties of <code>existingTask</code> were changed * @since 2.0 */ - public boolean updateTaskFromQueryHit(TaskRepository repository, AbstractTask existingTask, - AbstractTask queryHit) { + public boolean updateTaskFromQueryHit(TaskRepository repository, AbstractTask existingTask, AbstractTask queryHit) { boolean changed = false; if (existingTask.isCompleted() != queryHit.isCompleted()) { existingTask.setCompleted(queryHit.isCompleted()); @@ -237,10 +236,10 @@ public abstract class AbstractRepositoryConnector { existingTask.setUrl(queryHit.getUrl()); changed = true; } - + return changed; } - + protected final boolean hasTaskPropertyChanged(Object existingProperty, Object newProperty) { // the query hit does not have this property if (newProperty == null) { @@ -248,7 +247,7 @@ public abstract class AbstractRepositoryConnector { } return (existingProperty == null) ? true : !existingProperty.equals(newProperty); } - + public String[] getPepositoryPropertyNames() { return new String[] { IRepositoryConstants.PROPERTY_VERSION, IRepositoryConstants.PROPERTY_TIMEZONE, IRepositoryConstants.PROPERTY_ENCODING }; @@ -300,6 +299,7 @@ public abstract class AbstractRepositoryConnector { /** * Used for referring to the task in the UI. + * * @return */ public String getTaskIdPrefix() { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java index 2a2661b88..7fac14394 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractRepositoryQuery.java @@ -19,7 +19,7 @@ import org.eclipse.mylyn.tasks.core.AbstractTask.PriorityLevel; * @author Mik Kersten * @author Eugene Kuleshov * @author Rob Elves - * @since 2.0 + * @since 2.0 */ public abstract class AbstractRepositoryQuery extends AbstractTaskContainer { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java index 6ed338bce..f699b0dc8 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTask.java @@ -176,7 +176,7 @@ public abstract class AbstractTask extends AbstractTaskContainer { public final String getHandleIdentifier() { return super.getHandleIdentifier(); } - + /** * True for tasks that can be modified without a round-trip to a server. For example, such a task can be marked * completed via the Task List. @@ -245,7 +245,7 @@ public abstract class AbstractTask extends AbstractTaskContainer { public final void setHandleIdentifier(String handleIdentifier) { throw new RuntimeException("Cannot set the handle identifier of a task, set repository URL instead."); } - + public final void setRepositoryUrl(String repositoryUrl) { this.repositoryUrl = repositoryUrl; super.setHandleIdentifier(RepositoryTaskHandleUtil.getHandle(repositoryUrl, taskId)); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskCategory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskCategory.java index 074c7a992..d7536d85d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskCategory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskCategory.java @@ -15,17 +15,17 @@ package org.eclipse.mylyn.tasks.core; * A container that stores tasks from any repository. * * @author Mik Kersten - * @since 2.0 - */ + * @since 2.0 + */ public abstract class AbstractTaskCategory extends AbstractTaskContainer { public AbstractTaskCategory(String handleAndDescription) { super(handleAndDescription); } - + /** - * Override to return true for categories that the user creates, deletes, and renames. - * Return false for categories that are managed + * Override to return true for categories that the user creates, deletes, and renames. Return false for categories + * that are managed */ public abstract boolean isUserDefined(); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java index e4df21618..8095d1e89 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AbstractTaskListFactory.java @@ -19,8 +19,8 @@ import org.w3c.dom.Element; /** * Responsible for storing and creating task list elements. * - * When overriding these methods be sure not to perform network access since the Task List is - * read and written frequently. + * When overriding these methods be sure not to perform network access since the Task List is read and written + * frequently. * * @author Mik Kersten * @author Ken Sueda @@ -35,15 +35,15 @@ public abstract class AbstractTaskListFactory { public static final String KEY_TASK = "Task"; public abstract boolean canCreate(AbstractTask task); - + public boolean canCreate(AbstractRepositoryQuery query) { return false; } - - public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element){ + + public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element) { return null; } - + public abstract AbstractTask createTask(String repositoryUrl, String taskId, String label, Element element); public String getQueryElementName(AbstractRepositoryQuery query) { @@ -53,7 +53,7 @@ public abstract class AbstractTaskListFactory { public Set<String> getQueryElementNames() { return Collections.emptySet(); } - + public abstract String getTaskElementName(); public void setAdditionalAttributes(AbstractRepositoryQuery query, Element node) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AttributeContainer.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AttributeContainer.java index 63e0ca743..119c53127 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AttributeContainer.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/AttributeContainer.java @@ -36,7 +36,7 @@ public class AttributeContainer implements Serializable { /** report attributes (status, resolution, etc.) */ private HashMap<String, RepositoryTaskAttribute> attributes; - + private transient AbstractAttributeFactory attributeFactory; public AttributeContainer(AbstractAttributeFactory attributeFactory) { @@ -55,10 +55,11 @@ public class AttributeContainer implements Serializable { return; } String mapped = attributeFactory.mapCommonAttributeKey(key); - if(mapped == null) { - StatusHandler.log("Mylar Error: mapped value for "+key+" returned null.", this); + if (mapped == null) { + StatusHandler.log("Mylar Error: mapped value for " + key + " returned null.", this); return; - } if (!attributes.containsKey(mapped)) { + } + if (!attributes.containsKey(mapped)) { attributeKeys.add(mapped); } attributes.put(mapped, attribute); @@ -79,8 +80,8 @@ public class AttributeContainer implements Serializable { } public List<RepositoryTaskAttribute> getAttributes() { - ArrayList<RepositoryTaskAttribute> attributeEntries = new ArrayList<RepositoryTaskAttribute>(attributeKeys - .size()); + ArrayList<RepositoryTaskAttribute> attributeEntries = new ArrayList<RepositoryTaskAttribute>( + attributeKeys.size()); for (Iterator<String> it = attributeKeys.iterator(); it.hasNext();) { String key = it.next(); RepositoryTaskAttribute attribute = attributes.get(key); @@ -110,8 +111,7 @@ public class AttributeContainer implements Serializable { } /** - * sets a value on an attribute, if attribute doesn't exist, appropriate - * attribute is created + * sets a value on an attribute, if attribute doesn't exist, appropriate attribute is created */ public void setAttributeValue(String key, String value) { if (attributeFactory == null) { @@ -151,8 +151,8 @@ public class AttributeContainer implements Serializable { } return returnValue; } - - public AbstractAttributeFactory getAttributeFactory(){ + + public AbstractAttributeFactory getAttributeFactory() { return attributeFactory; } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/FileAttachment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/FileAttachment.java index 8228720b1..836b67a9f 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/FileAttachment.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/FileAttachment.java @@ -25,13 +25,13 @@ import java.io.InputStream; public class FileAttachment implements ITaskAttachment { private static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; - + private String contentType = APPLICATION_OCTET_STREAM; - + private String filename; - + private String description; - + private boolean patch; private File file; @@ -40,11 +40,11 @@ public class FileAttachment implements ITaskAttachment { if (file == null) { throw new IllegalArgumentException(); } - + this.file = file; this.filename = file.getName(); } - + public String getContentType() { return contentType; } @@ -84,5 +84,5 @@ public class FileAttachment implements ITaskAttachment { public long getLength() { return file.length(); } - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ILinkedTaskInfo.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ILinkedTaskInfo.java index 635378796..35c7a326c 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ILinkedTaskInfo.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ILinkedTaskInfo.java @@ -24,9 +24,9 @@ public interface ILinkedTaskInfo { public abstract String getTaskUrl(); public abstract String getRepositoryUrl(); - + public abstract AbstractTask getTask(); - + public abstract String getComment(); - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityListener.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityListener.java index 7603e250b..0a2137c36 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityListener.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskActivityListener.java @@ -21,7 +21,7 @@ import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer; * @since 2.0 */ public interface ITaskActivityListener { - + public abstract void taskActivated(AbstractTask task); public abstract void taskDeactivated(AbstractTask task); @@ -29,7 +29,8 @@ public interface ITaskActivityListener { public abstract void taskListRead(); /** - * @param week can be null + * @param week + * can be null */ public abstract void activityChanged(ScheduledTaskContainer week); diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskAttachment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskAttachment.java index 2c23bb304..973021f7f 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskAttachment.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskAttachment.java @@ -21,17 +21,17 @@ import java.io.InputStream; * @since 2.0 */ public interface ITaskAttachment { - + public InputStream createInputStream() throws IOException; - + public String getContentType(); public String getDescription(); public String getFilename(); - + public long getLength(); public boolean isPatch(); - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskFactory.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskFactory.java index 694f06c9a..a9f332eaa 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskFactory.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskFactory.java @@ -11,7 +11,6 @@ package org.eclipse.mylyn.tasks.core; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; - /** * Used for creating tasks from repository task data. * diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskListChangeListener.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskListChangeListener.java index 9be1beb1d..6720e1a17 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskListChangeListener.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskListChangeListener.java @@ -13,7 +13,6 @@ package org.eclipse.mylyn.tasks.core; import java.util.Set; - /** * Listener for task list modifications and task content modifications. * @@ -23,5 +22,5 @@ import java.util.Set; public interface ITaskListChangeListener { public abstract void containersChanged(Set<TaskContainerDelta> containers); - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java index 9880e59b3..25484a0a9 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/ITaskRepositoryListener.java @@ -11,7 +11,6 @@ package org.eclipse.mylyn.tasks.core; - /** * Notified of change to task repositories. * @@ -21,11 +20,11 @@ package org.eclipse.mylyn.tasks.core; public interface ITaskRepositoryListener { public abstract void repositoriesRead(); - + public abstract void repositoryAdded(TaskRepository repository); - + public abstract void repositoryRemoved(TaskRepository repository); - + public abstract void repositorySettingsChanged(TaskRepository repository); - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryAttachment.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryAttachment.java index e25cf83e3..dba055b71 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryAttachment.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryAttachment.java @@ -25,7 +25,7 @@ public class RepositoryAttachment extends AttributeContainer implements Serializ private static final long serialVersionUID = 2663237137799050826L; private boolean isPatch = false; - + private boolean isObsolete = false; private String creator = ""; diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryOperation.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryOperation.java index f51f00da8..384b55e2e 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryOperation.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryOperation.java @@ -18,8 +18,7 @@ import java.util.List; import java.util.Map; /** - * A representation of an operation that can be done to the bug when it is - * submitted + * A representation of an operation that can be done to the bug when it is submitted * * NOTE: likely to change for 3.0 * diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java index a507eb9d2..93fdbb7d2 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryStatus.java @@ -52,7 +52,7 @@ public class RepositoryStatus extends Status { private String htmlMessage; protected String repositoryUrl; - + public RepositoryStatus(TaskRepository repository, int severity, String pluginId, int code, String message) { this(repository.getUrl(), severity, pluginId, code, message, null); } @@ -152,21 +152,18 @@ public class RepositoryStatus extends Status { } public static RepositoryStatus createStatus(String repositoryUrl, int severity, String pluginId, String message) { - return new RepositoryStatus(repositoryUrl, severity, pluginId, RepositoryStatus.ERROR_REPOSITORY, - message); + return new RepositoryStatus(repositoryUrl, severity, pluginId, RepositoryStatus.ERROR_REPOSITORY, message); } public static RepositoryStatus createLoginError(String repositoryUrl, String pluginId) { - return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, - RepositoryStatus.ERROR_REPOSITORY_LOGIN, NLS.bind( - "Unable to login to {0}. Please validate credentials via Task Repositories view.", + return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, RepositoryStatus.ERROR_REPOSITORY_LOGIN, + 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, - RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND, NLS.bind("Repository {0} could not be found.", - repositoryUrl)); + return new RepositoryStatus(repositoryUrl, Status.ERROR, pluginId, RepositoryStatus.ERROR_REPOSITORY_NOT_FOUND, + NLS.bind("Repository {0} could not be found.", repositoryUrl)); } public static RepositoryStatus createCollisionError(String repositoryUrl, String pluginId) { diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskAttribute.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskAttribute.java index e4163766f..8208e9050 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskAttribute.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskAttribute.java @@ -31,8 +31,8 @@ public class RepositoryTaskAttribute implements Serializable { /** * Key for the author of a comment. * - * TODO remove this key: Trac uses owner to denote the assignee of a ticket - * and AbstractRepository has a getOwner() method which is confusing + * TODO remove this key: Trac uses owner to denote the assignee of a ticket and AbstractRepository has a getOwner() + * method which is confusing */ public static final String USER_OWNER = "task.common.user.owner"; @@ -81,15 +81,14 @@ public class RepositoryTaskAttribute implements Serializable { public static final String KEYWORDS = "task.common.keywords"; /** - * Boolean attribute. If true, repository user needs to be added to the cc - * list. + * Boolean attribute. If true, repository user needs to be added to the cc list. */ public static final String ADD_SELF_CC = "task.common.addselfcc"; public static final String NEW_CC = "task.common.newcc"; public static final String REMOVE_CC = "task.common.removecc"; - + public static final String TASK_KEY = "task.common.key"; /** @@ -270,7 +269,7 @@ public class RepositoryTaskAttribute implements Serializable { public void clearMetaData() { metaData.clear(); } - + public void putMetaDataValue(String key, String value) { metaData.put(key, value); } @@ -282,7 +281,7 @@ public class RepositoryTaskAttribute implements Serializable { public void removeMetaDataValue(String key) { metaData.remove(key); } - + public Map<String, String> getMetaData() { return Collections.unmodifiableMap(metaData); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskData.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskData.java index 4fcda62d3..2119174a8 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskData.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTaskData.java @@ -281,7 +281,7 @@ public final class RepositoryTaskData extends AttributeContainer implements Seri } return getId(); } - + public void setTaskKey(String key) { setAttributeValue(RepositoryTaskAttribute.TASK_KEY, key); } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java index 4b618d4e8..7057fd056 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/RepositoryTemplate.java @@ -24,7 +24,7 @@ import java.util.Map; public final class RepositoryTemplate { public final Map<String, String> genericAttributes = new LinkedHashMap<String, String>(); - + public final String label; public final String repositoryUrl; @@ -42,11 +42,12 @@ public final class RepositoryTemplate { public final String version; public final boolean addAutomatically; - + public final String characterEncoding; - public RepositoryTemplate(String label, String repositoryUrl, String characterEncoding, String version, String newTaskUrl, String taskPrefix, - String taskQuery, String newAccountUrl, boolean anonymous, boolean addAutomatically) { + public RepositoryTemplate(String label, String repositoryUrl, String characterEncoding, String version, + String newTaskUrl, String taskPrefix, String taskQuery, String newAccountUrl, boolean anonymous, + boolean addAutomatically) { this.label = label; this.repositoryUrl = repositoryUrl; this.newTaskUrl = newTaskUrl; @@ -58,17 +59,16 @@ public final class RepositoryTemplate { this.characterEncoding = characterEncoding; this.addAutomatically = addAutomatically; } - + public void addAttribute(String name, String value) { genericAttributes.put(name, value); } - + public String getAttribute(String name) { return genericAttributes.get(name); } - + public Map<String, String> getAttributes() { return this.genericAttributes; } } - diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java index 20c3ae45b..cb6b04157 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskContainerDelta.java @@ -11,9 +11,8 @@ package org.eclipse.mylyn.tasks.core; - /** - * Immutable. Defines changes to Task List elements. + * Immutable. Defines changes to Task List elements. * * @author Mik Kersten * @since 2.0 @@ -24,25 +23,25 @@ public final class TaskContainerDelta { /** * One container added to another or to the root. */ - ADDED, - + ADDED, + /** * One container removed from another or from the root. */ - REMOVED, - + REMOVED, + /** - * Container has changed, e.g. has new children, a task's priority or planning info. - * For tasks changed state tends to be show in a view. + * Container has changed, e.g. has new children, a task's priority or planning info. For tasks changed state + * tends to be show in a view. */ - CHANGED, - + CHANGED, + /** - * The content of the container has changed, e.g. new data has been downloaded for a - * task from the repository. For tasks content tends to be show in an editor. + * The content of the container has changed, e.g. new data has been downloaded for a task from the repository. + * For tasks content tends to be show in an editor. */ - CONTENT, - + CONTENT, + /** * The root of the data structure has changed. */ @@ -50,9 +49,9 @@ public final class TaskContainerDelta { } private final AbstractTaskContainer container; - + private final Kind kind; - + public TaskContainerDelta(AbstractTaskContainer container, Kind kind) { this.container = container; this.kind = kind; @@ -65,5 +64,5 @@ public final class TaskContainerDelta { public Kind getKind() { return kind; } - + } diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java index b691fb869..0b893fcbc 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskRepository.java @@ -27,17 +27,15 @@ import org.eclipse.mylyn.monitor.core.StatusHandler; import org.eclipse.mylyn.web.core.WebClientUtil; /** - * Note that task repositories use Strings for storing time stamps because using - * Date objects led to the following problems: + * Note that task repositories use Strings for storing time stamps because using Date objects led to the following + * problems: * <ul> - * <li>Often we are unable to get the time zone of the repository so - * interpreting the date string correctly doesn't work.</li> - * <li>Even if we do know the time zone information the local clock may be - * wrong. This can cause lost incoming when asking the repository for all - * changes since date X.</li> - * <li>The solution we have come up with thus far is not to interpret the date - * as a DATE object but rather simply use the date string given to us by the - * repository itself.</li> + * <li>Often we are unable to get the time zone of the repository so interpreting the date string correctly doesn't + * work.</li> + * <li>Even if we do know the time zone information the local clock may be wrong. This can cause lost incoming when + * asking the repository for all changes since date X.</li> + * <li>The solution we have come up with thus far is not to interpret the date as a DATE object but rather simply use + * the date string given to us by the repository itself.</li> * </ul> * * @author Mik Kersten @@ -76,7 +74,7 @@ public class TaskRepository { public static final String PROXY_USERNAME = "org.eclipse.mylyn.tasklist.repositories.proxy.username"; public static final String PROXY_PASSWORD = "org.eclipse.mylyn.tasklist.repositories.proxy.password"; - + public static final String OFFLINE = "org.eclipse.mylyn.tasklist.repositories.offline"; // HACK: Lock used to work around race condition in @@ -115,8 +113,8 @@ public class TaskRepository { } /** - * for testing purposes sets repository time zone to local default time zone - * sets character encoding to DEFAULT_CHARACTER_ENCODING + * for testing purposes sets repository time zone to local default time zone sets character encoding to + * DEFAULT_CHARACTER_ENCODING */ public TaskRepository(String kind, String serverUrl, String version) { this(kind, serverUrl, version, DEFAULT_CHARACTER_ENCODING, TimeZone.getDefault().getID()); @@ -159,8 +157,7 @@ public class TaskRepository { } /** - * The username is cached since it needs to be retrieved frequently (e.g. - * for Task List decoration). + * The username is cached since it needs to be retrieved frequently (e.g. for Task List decoration). */ public String getUserName() { // NOTE: if anonymous, user name is "" string so we won't go to keyring @@ -305,7 +302,7 @@ public class TaskRepository { return false; } } else { - if(!getUrl().equals(repository.getUrl())) { + if (!getUrl().equals(repository.getUrl())) { return false; } } @@ -322,8 +319,8 @@ public class TaskRepository { @Override public int hashCode() { - int res = getUrl()==null ? 1 : getUrl().hashCode(); - return res * 31 + (getConnectorKind()==null ? 1 : getConnectorKind().hashCode()); + int res = getUrl() == null ? 1 : getUrl().hashCode(); + return res * 31 + (getConnectorKind() == null ? 1 : getConnectorKind().hashCode()); } @Override @@ -380,8 +377,8 @@ public class TaskRepository { } /** - * ONLY for use by IRepositoryConstants. To set the sync time call - * IRepositoryConstants.setSyncTime(repository, date); + * ONLY for use by IRepositoryConstants. To set the sync time call IRepositoryConstants.setSyncTime(repository, + * date); */ public void setSynchronizationTimeStamp(String syncTime) { this.properties.put(IRepositoryConstants.PROPERTY_SYNCTIMESTAMP, syncTime); @@ -465,7 +462,7 @@ public class TaskRepository { public void setBugRepository(boolean isBugRepository) { this.isBugRepository = isBugRepository; } - + public void setOffline(boolean offline) { properties.put(OFFLINE, String.valueOf(offline)); } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java index 034e63152..5e4e4e7c5 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java @@ -53,7 +53,7 @@ public class AllTasksTests { suite.addTestSuite(OfflineStorageTest.class); suite.addTestSuite(OfflineCachingStorageTest.class); // $JUnit-END$ - + // suite.addTestSuite(BackgroundSaveTest.class); // suite.addTestSuite(RetrieveTitleFromUrlTest.class); return suite; diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java index 7bb867ed2..060136b48 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AttachmentJobTest.java @@ -53,8 +53,7 @@ public class AttachmentJobTest extends TestCase { manager = TasksUiPlugin.getRepositoryManager(); - repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, - MockRepositoryConnector.REPOSITORY_URL); + repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, MockRepositoryConnector.REPOSITORY_URL); manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); attachmentHandler = new MockAttachmentHandler(); @@ -65,7 +64,7 @@ public class AttachmentJobTest extends TestCase { statusHandler = new MockStatusHandler(); StatusHandler.addStatusHandler(statusHandler); - + attachment = new RepositoryAttachment(null); attachment.setRepositoryKind(repository.getConnectorKind()); attachment.setRepositoryUrl(repository.getUrl()); @@ -103,7 +102,7 @@ public class AttachmentJobTest extends TestCase { assertEquals(Status.OK_STATUS, job.getResult()); statusHandler.assertNoStatus(); - + RandomAccessFile raf = new RandomAccessFile(file, "r"); byte[] data = new byte[expected.getBytes().length]; try { diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java index bf7c7dfc6..1762da131 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/BackgroundSaveTest.java @@ -21,8 +21,7 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TaskListSaveManager; import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; /** - * Tests the mechanism for saving the task data periodically. If this test fails - * unexpectedly, try adjusting the timing. + * Tests the mechanism for saving the task data periodically. If this test fails unexpectedly, try adjusting the timing. * * @author Wesley Coelho * @author Mik Kersten (rewrite) @@ -36,7 +35,7 @@ public class BackgroundSaveTest extends TestCase { @Override protected void setUp() throws Exception { super.setUp(); - TasksUiPlugin.getTaskListManager().saveTaskList(); + TasksUiPlugin.getTaskListManager().saveTaskList(); saveManager = new TaskListSaveManager(); // saveManager = TasksUiPlugin.getDefault().getTaskListSaveManager(); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java index 1508b1acd..e3a27fb16 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/CopyDetailsActionTest.java @@ -19,9 +19,9 @@ import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryTask; public class CopyDetailsActionTest extends TestCase { public void testIdLabelIncluded() { - MockRepositoryTask task = new MockRepositoryTask("123"); + MockRepositoryTask task = new MockRepositoryTask("123"); String text = CopyTaskDetailsAction.getTextForTask(task); assertTrue(text.startsWith(task.getTaskKey())); } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java index f05e89fab..b3c4f4b63 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ProjectRepositoryAssociationTest.java @@ -53,17 +53,16 @@ public class ProjectRepositoryAssociationTest extends TestCase { assertEquals(REPOSITORY_KIND, returnedRepository.getConnectorKind()); assertEquals(REPOSITORY_URL, returnedRepository.getUrl()); } - + public void testRepositoryForFolder() throws CoreException { - IFolder folder = projectWrapper.createFolder("testFolder"); + IFolder folder = projectWrapper.createFolder("testFolder"); assertTrue(folder.exists()); assertNull(TasksUiPlugin.getDefault().getRepositoryForResource(folder, true)); TaskRepository repository = new TaskRepository(REPOSITORY_KIND, REPOSITORY_URL); TasksUiPlugin.getRepositoryManager().addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); TasksUiPlugin.getDefault().setRepositoryForResource(folder, repository); - TaskRepository returnedRepository = TasksUiPlugin.getDefault().getRepositoryForResource( - folder, true); + TaskRepository returnedRepository = TasksUiPlugin.getDefault().getRepositoryForResource(folder, true); assertNotNull(returnedRepository); assertEquals(REPOSITORY_KIND, returnedRepository.getConnectorKind()); assertEquals(REPOSITORY_URL, returnedRepository.getUrl()); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java index bcb212f37..cb59400f7 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositorySettingsPageTest.java @@ -85,9 +85,9 @@ public class RepositorySettingsPageTest extends TestCase { public void testNeedsAnonyoumousLogin() { TaskRepository repository = new TaskRepository("kind", "http://localhost/"); - + TasksUiPlugin.getDefault().addRepositoryConnectorUi(new MockTaskConnectorUi()); - + MockRepositorySettingsPage page = new MockRepositorySettingsPage(new MockTaskConnectorUi()); page.setNeedsAnonymousLogin(true); page.setRepository(repository); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java index 5b2843b1c..b91f9262a 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/RepositoryTaskSynchronizationTest.java @@ -86,10 +86,9 @@ public class RepositoryTaskSynchronizationTest extends TestCase { */ // Test unforced - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, - RepositoryTaskSyncState.INCOMING); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( - task.getRepositoryUrl(), task.getTaskId()); + AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.INCOMING, RepositoryTaskSyncState.INCOMING); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); assertEquals(DATE_STAMP_2, newData.getLastModified()); @@ -100,8 +99,8 @@ public class RepositoryTaskSynchronizationTest extends TestCase { // assertEquals(DATE_STAMP_2, task.getLastSyncDateStamp()); // and again... - RepositoryTaskData taskData3 = new RepositoryTaskData(new MockAttributeFactory(), - connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, "1"); + RepositoryTaskData taskData3 = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), + MockRepositoryConnector.REPOSITORY_URL, "1"); taskData3.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_3); TasksUiPlugin.getSynchronizationManager().saveIncoming(task, taskData3, false); // last modified stamp not updated until user synchronizes (newdata == @@ -188,7 +187,8 @@ public class RepositoryTaskSynchronizationTest extends TestCase { assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, false); assertEquals(RepositoryTaskSyncState.INCOMING, task.getSynchronizationState()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertEquals(DATE_STAMP_2, taskData.getLastModified()); // assertEquals(DATE_STAMP_2, task.getLastModifiedDateStamp()); } @@ -211,7 +211,8 @@ public class RepositoryTaskSynchronizationTest extends TestCase { RepositoryTaskSyncState.SYNCHRONIZED); assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), + task.getTaskId()); taskData.setNewComment("new comment"); @@ -223,13 +224,12 @@ public class RepositoryTaskSynchronizationTest extends TestCase { } public void testConflictToConflict() { - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.CONFLICT, - RepositoryTaskSyncState.INCOMING); + AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.CONFLICT, RepositoryTaskSyncState.INCOMING); assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); assertEquals(RepositoryTaskSyncState.CONFLICT, task.getSynchronizationState()); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData( - task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertEquals(DATE_STAMP_2, taskData.getLastModified()); TasksUiPlugin.getSynchronizationManager().saveIncoming(task, newData, true); @@ -254,9 +254,9 @@ public class RepositoryTaskSynchronizationTest extends TestCase { // TODO: Test discard outgoing public void testOutgoingToConflict() { // Forced - AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING, - RepositoryTaskSyncState.INCOMING); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId()); + AbstractTask task = primeTaskAndRepository(RepositoryTaskSyncState.OUTGOING, RepositoryTaskSyncState.INCOMING); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), + task.getTaskId()); assertEquals(DATE_STAMP_1, task.getLastReadTimeStamp()); assertEquals(RepositoryTaskSyncState.OUTGOING, task.getSynchronizationState()); @@ -321,13 +321,15 @@ public class RepositoryTaskSynchronizationTest extends TestCase { edits.add(taskData1.getAttribute(RepositoryTaskAttribute.COMMENT_NEW)); TasksUiPlugin.getTaskDataManager().saveEdits(task.getRepositoryUrl(), task.getTaskId(), edits); - RepositoryTaskData editedData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData editedData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), + task.getTaskId()); assertEquals("Testing", editedData.getNewComment()); TasksUiPlugin.getSynchronizationManager().discardOutgoing(task); assertTrue(task.getSynchronizationState().equals(RepositoryTaskSyncState.SYNCHRONIZED)); - RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), task.getTaskId()); + RepositoryTaskData taskData = TasksUiPlugin.getTaskDataManager().getEditableCopy(task.getRepositoryUrl(), + task.getTaskId()); assertEquals("", taskData.getNewComment()); } @@ -340,18 +342,20 @@ public class RepositoryTaskSynchronizationTest extends TestCase { return null; } - public Set<AbstractTask> getChangedSinceLastSync(TaskRepository repository, - Set<AbstractTask> tasks) throws CoreException { + public Set<AbstractTask> getChangedSinceLastSync(TaskRepository repository, Set<AbstractTask> tasks) + throws CoreException { return null; } @Override - public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) throws CoreException { + public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) + throws CoreException { return null; } @Override - public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) throws CoreException { + public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) + throws CoreException { // ignore return null; } @@ -374,7 +378,6 @@ public class RepositoryTaskSynchronizationTest extends TestCase { return Collections.emptySet(); } - // private final String DATE_FORMAT_2 = "yyyy-MM-dd HH:mm:ss"; // // private final SimpleDateFormat format = new @@ -418,17 +421,18 @@ public class RepositoryTaskSynchronizationTest extends TestCase { } - private AbstractTask primeTaskAndRepository(RepositoryTaskSyncState localState, - RepositoryTaskSyncState remoteState) { + private AbstractTask primeTaskAndRepository(RepositoryTaskSyncState localState, RepositoryTaskSyncState remoteState) { RepositoryTaskData taskData = null; AbstractTask task = new MockRepositoryTask(MOCCK_ID); - taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); + taskData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), + MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); taskData.setAttributeValue(RepositoryTaskAttribute.DATE_MODIFIED, DATE_STAMP_1); task.setLastReadTimeStamp(DATE_STAMP_1); task.setSynchronizationState(localState); TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData); - newData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); + newData = new RepositoryTaskData(new MockAttributeFactory(), connector.getConnectorKind(), + MockRepositoryConnector.REPOSITORY_URL, MOCCK_ID); switch (remoteState) { case CONFLICT: diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java index 9e03b08e3..de23e49ed 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TableSorterTest.java @@ -25,11 +25,12 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; public class TableSorterTest extends TestCase { public void testRootTaskSorting() { - TaskListTableSorter sorter = new TaskListTableSorter(TaskListView.getFromActivePerspective(), TaskListTableSorter.SortByIndex.SUMMARY); - + TaskListTableSorter sorter = new TaskListTableSorter(TaskListView.getFromActivePerspective(), + TaskListTableSorter.SortByIndex.SUMMARY); + AbstractTask task = new LocalTask("1", ""); TaskCategory category = new TaskCategory("cat"); - + assertEquals(-1, sorter.compare(null, task, category)); assertEquals(1, sorter.compare(null, category, task)); } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java index 3938610ff..c1d14e35d 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskActivityTest.java @@ -64,7 +64,8 @@ public class TaskActivityTest extends TestCase { Calendar endDate = GregorianCalendar.getInstance(); endDate.setTimeInMillis(2000); - ScheduledTaskContainer testContainer = new ScheduledTaskContainer(startDate, endDate, "test date range container"); + ScheduledTaskContainer testContainer = new ScheduledTaskContainer(startDate, endDate, + "test date range container"); assertTrue(testContainer.includes(startDate)); assertTrue(testContainer.includes(endDate)); Calendar midTime = GregorianCalendar.getInstance(); @@ -78,19 +79,16 @@ public class TaskActivityTest extends TestCase { currentTaskStart.setTimeInMillis(currentStartMili); Calendar currentTaskEnd = GregorianCalendar.getInstance(); currentTaskEnd.setTimeInMillis(currentEndMili); - testContainer - .addTask(new ScheduledTaskDelegate(testContainer, task1, currentTaskStart, currentTaskEnd, 10)); + testContainer.addTask(new ScheduledTaskDelegate(testContainer, task1, currentTaskStart, currentTaskEnd, 10)); // assertEquals(currentEndMili - currentStartMili, // testContainer.getTotalElapsed()); assertEquals(10, testContainer.getTotalElapsed()); - testContainer - .addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); + testContainer.addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); assertEquals(20, testContainer.getTotalElapsed()); // assertEquals(2 * (currentEndMili - currentStartMili), // testContainer.getTotalElapsed()); assertEquals(2, testContainer.getDateRangeDelegates().size()); - testContainer - .addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); + testContainer.addTask(new ScheduledTaskDelegate(testContainer, task2, currentTaskStart, currentTaskEnd, 10)); assertEquals(30, testContainer.getTotalElapsed()); // assertEquals(3 * (currentEndMili - currentStartMili), @@ -135,11 +133,12 @@ public class TaskActivityTest extends TestCase { thisWeekCalendarStop.add(Calendar.MILLISECOND, 2); assertTrue(thisWeekActivity.includes(thisWeekCalendarStart)); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, thisWeekCalendarStart.getTime(), thisWeekCalendarStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekCalendarStart.getTime(), + thisWeekCalendarStart.getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, thisWeekCalendarStop.getTime(), thisWeekCalendarStop.getTime()); @@ -178,13 +177,14 @@ public class TaskActivityTest extends TestCase { assertNotNull(pastActivity); assertEquals(0, pastActivity.getChildren().size()); - InteractionEvent event3 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, pastActivity.getStart().getTime(), pastActivity.getStart().getTime()); - InteractionEvent event4 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, pastActivity.getEnd().getTime(), pastActivity - .getEnd().getTime()); + InteractionEvent event3 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, pastActivity.getStart().getTime(), + pastActivity.getStart().getTime()); + InteractionEvent event4 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, pastActivity.getEnd().getTime(), + pastActivity.getEnd().getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event3); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event4); @@ -195,13 +195,14 @@ public class TaskActivityTest extends TestCase { assertNotNull(futureActivity); assertEquals(0, futureActivity.getChildren().size()); - InteractionEvent event5 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, futureActivity.getStart().getTime(), futureActivity.getStart().getTime()); - InteractionEvent event6 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, futureActivity.getEnd().getTime(), futureActivity - .getEnd().getTime()); + InteractionEvent event5 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, futureActivity.getStart().getTime(), + futureActivity.getStart().getTime()); + InteractionEvent event6 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, futureActivity.getEnd().getTime(), + futureActivity.getEnd().getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event5); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event6); @@ -214,11 +215,12 @@ public class TaskActivityTest extends TestCase { assertNotNull(activityNextWeek); assertEquals(0, activityNextWeek.getChildren().size()); - InteractionEvent event7 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, activityNextWeek.getStart().getTime(), activityNextWeek.getStart().getTime()); - InteractionEvent event8 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", + InteractionEvent event7 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityNextWeek.getStart().getTime(), + activityNextWeek.getStart().getTime()); + InteractionEvent event8 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityNextWeek.getEnd().getTime(), activityNextWeek.getEnd().getTime()); @@ -233,11 +235,12 @@ public class TaskActivityTest extends TestCase { assertNotNull(activityPreviousWeek); assertEquals(0, activityPreviousWeek.getChildren().size()); - InteractionEvent event9 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, activityPreviousWeek.getStart().getTime(), activityPreviousWeek.getStart().getTime()); - InteractionEvent event10 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task2 - .getHandleIdentifier(), "originId", "navigatedRelation", + InteractionEvent event9 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityPreviousWeek.getStart().getTime(), + activityPreviousWeek.getStart().getTime()); + InteractionEvent event10 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task2.getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityPreviousWeek.getEnd().getTime(), activityPreviousWeek.getEnd().getTime()); @@ -310,8 +313,8 @@ public class TaskActivityTest extends TestCase { // time2.getTime() - time1.getTime(); assertEquals(expectedTotalTime, thisWeekActivity.getTotalElapsed()); assertEquals(expectedTotalTime, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, - task1, null, null))); + assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, task1, + null, null))); } /** @@ -391,8 +394,8 @@ public class TaskActivityTest extends TestCase { long expectedTotalTime = time6.getTime() - time5.getTime() + time4.getTime() - time3.getTime() + time2.getTime() - time1.getTime(); assertEquals(expectedTotalTime, thisWeekActivity.getTotalElapsed()); - assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, - task1, null, null))); + assertEquals(expectedTotalTime, thisWeekActivity.getElapsed(new ScheduledTaskDelegate(thisWeekActivity, task1, + null, null))); } public void testTaskListManagerInactivity() { @@ -404,11 +407,12 @@ public class TaskActivityTest extends TestCase { assertNotNull(activityThisWeek); assertEquals(0, activityThisWeek.getChildren().size()); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, activityThisWeek.getStart().getTime(), activityThisWeek.getStart().getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, activityThisWeek.getStart().getTime(), + activityThisWeek.getStart().getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, activityThisWeek.getEnd().getTime(), activityThisWeek.getEnd().getTime()); @@ -431,8 +435,8 @@ public class TaskActivityTest extends TestCase { InteractionEvent activityEvent = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 1f, - activityStart.getTime(), activityEnd.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + 1f, activityStart.getTime(), activityEnd.getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); TasksUiPlugin.getTaskListManager().parseInteractionEvent(activityEvent); @@ -452,8 +456,8 @@ public class TaskActivityTest extends TestCase { long expectedTotalTime = (activityEnd.getTime().getTime() - activityStart.getTime().getTime()); assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, - task1, null, null))); + assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, + null, null))); } @@ -481,21 +485,23 @@ public class TaskActivityTest extends TestCase { Calendar inactivityStop2 = GregorianCalendar.getInstance(); inactivityStop2.add(Calendar.MILLISECOND, 25); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, taskActivationStart.getTime(), taskActivationStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), taskActivationStop - .getTime()); + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, taskActivationStart.getTime(), + taskActivationStart.getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), + taskActivationStop.getTime()); InteractionEvent inactivityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, inactivityStart1.getTime(), inactivityStop1 - .getTime()); + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, inactivityStart1.getTime(), + inactivityStop1.getTime()); InteractionEvent inactivityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart2.getTime(), inactivityStop2.getTime()); + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart2.getTime(), + inactivityStop2.getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); @@ -507,8 +513,8 @@ public class TaskActivityTest extends TestCase { // taskActivationStart.getTimeInMillis(); long expectedTotalTime = 0; assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, - task1, null, null))); + assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, + null, null))); } public void testInterleavedActivation2() { @@ -530,17 +536,19 @@ public class TaskActivityTest extends TestCase { Calendar inactivityStop = GregorianCalendar.getInstance(); inactivityStop.add(Calendar.MILLISECOND, 20); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, taskActivationStart.getTime(), taskActivationStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), taskActivationStop - .getTime()); + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, taskActivationStart.getTime(), + taskActivationStart.getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, taskActivationStop.getTime(), + taskActivationStop.getTime()); InteractionEvent inactivityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart.getTime(), inactivityStop.getTime()); + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, inactivityStart.getTime(), + inactivityStop.getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); TasksUiPlugin.getTaskListManager().parseInteractionEvent(inactivityEvent1); @@ -552,8 +560,8 @@ public class TaskActivityTest extends TestCase { long expectedTotalTime = 2 * (inactivityStart.getTimeInMillis() - taskActivationStart.getTimeInMillis()); assertEquals(expectedTotalTime, activityThisWeek.getTotalElapsed()); - assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, - task1, null, null))); + assertEquals(expectedTotalTime, activityThisWeek.getElapsed(new ScheduledTaskDelegate(activityThisWeek, task1, + null, null))); } public void testResetAndRollOver() { @@ -599,18 +607,19 @@ public class TaskActivityTest extends TestCase { AbstractTask task1 = new LocalTask("task 1", "Task 1"); TasksUiPlugin.getTaskListManager().getTaskList().addTask(task1); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, thisWeekTaskStart.getTime(), thisWeekTaskStart.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, thisWeekTaskStop.getTime(), thisWeekTaskStop - .getTime()); + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekTaskStart.getTime(), + thisWeekTaskStart.getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, thisWeekTaskStop.getTime(), + thisWeekTaskStop.getTime()); InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, "structureKind", InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, "originId", "navigatedRelation", - InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekTaskStart.getTime(), thisWeekTaskStop - .getTime()); + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, thisWeekTaskStart.getTime(), + thisWeekTaskStop.getTime()); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event2); @@ -645,8 +654,8 @@ public class TaskActivityTest extends TestCase { assertTrue(newThisWeek.isFuture()); assertEquals(1, newPreviousWeek.getChildren().size()); - assertEquals(thisWeekTaskStop.getTime().getTime() - thisWeekTaskStart.getTime().getTime(), newPreviousWeek - .getTotalElapsed()); + assertEquals(thisWeekTaskStop.getTime().getTime() - thisWeekTaskStart.getTime().getTime(), + newPreviousWeek.getTotalElapsed()); } public void testAfterReloading() { @@ -657,17 +666,17 @@ public class TaskActivityTest extends TestCase { Calendar endTime = Calendar.getInstance(); endTime.add(Calendar.SECOND, 20); - InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, - 2f, startTime.getTime(), startTime.getTime()); - InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", task1 - .getHandleIdentifier(), "originId", "navigatedRelation", + InteractionEvent event1 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", + InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 2f, startTime.getTime(), startTime.getTime()); + InteractionEvent event2 = new InteractionEvent(InteractionEvent.Kind.SELECTION, "structureKind", + task1.getHandleIdentifier(), "originId", "navigatedRelation", InteractionContextManager.ACTIVITY_DELTA_DEACTIVATED, 2f, startTime.getTime(), startTime.getTime()); InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 1f, - startTime.getTime(), endTime.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + 1f, startTime.getTime(), endTime.getTime()); ContextCorePlugin.getContextManager().getActivityMetaContext().parseEvent(event1); TasksUiPlugin.getTaskListManager().parseInteractionEvent(event1); @@ -699,13 +708,13 @@ public class TaskActivityTest extends TestCase { DegreeOfInterest doi = new DegreeOfInterest(mockContext, InteractionContextManager.getScalingFactors()); InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 1f, - startTime1.getTime(), endTime1.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + 1f, startTime1.getTime(), endTime1.getTime()); InteractionEvent activityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, 1f, - startTime2.getTime(), endTime2.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + 1f, startTime2.getTime(), endTime2.getTime()); doi.addEvent(activityEvent1); doi.addEvent(activityEvent2); @@ -731,33 +740,33 @@ public class TaskActivityTest extends TestCase { InteractionContext metaContext = ContextCorePlugin.getContextManager().getActivityMetaContext(); metaContext.reset(); assertEquals(0, metaContext.getInteractionHistory().size()); - + TasksUiPlugin.getTaskListManager().activateTask(task1); InteractionEvent activityEvent1 = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, endTime1.getTime().getTime() - startTime1.getTime().getTime(), - startTime1.getTime(), endTime1.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + endTime1.getTime().getTime() - startTime1.getTime().getTime(), startTime1.getTime(), endTime1.getTime()); InteractionEvent activityEvent2 = new InteractionEvent(InteractionEvent.Kind.COMMAND, InteractionContextManager.ACTIVITY_STRUCTURE_KIND, InteractionContextManager.ACTIVITY_HANDLE_ATTENTION, - InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, endTime2.getTime().getTime() - startTime2.getTime().getTime(), - startTime2.getTime(), endTime2.getTime()); + InteractionContextManager.ACTIVITY_ORIGIN_ID, null, InteractionContextManager.ACTIVITY_DELTA_ACTIVATED, + endTime2.getTime().getTime() - startTime2.getTime().getTime(), startTime2.getTime(), endTime2.getTime()); metaContext.parseEvent(activityEvent1); - metaContext.parseEvent(activityEvent2); + metaContext.parseEvent(activityEvent2); TasksUiPlugin.getTaskListManager().deactivateAllTasks(); assertEquals(4, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); - TasksUiPlugin.getTaskListManager().saveTaskList(); + TasksUiPlugin.getTaskListManager().saveTaskList(); ContextCorePlugin.getContextManager().saveActivityContext(); ContextCorePlugin.getContextManager().getActivityMetaContext().reset(); assertEquals(0, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); ContextCorePlugin.getContextManager().loadActivityMetaContext(); - + // Only three remain as the two attention events have compressed into one assertEquals(3, ContextCorePlugin.getContextManager().getActivityMetaContext().getInteractionHistory().size()); assertEquals(0, TasksUiPlugin.getTaskListManager().getElapsedTime(task1)); - + TasksUiPlugin.getTaskListManager().resetAndRollOver(); assertEquals((endTime1.getTimeInMillis() - startTime1.getTimeInMillis()) + (endTime2.getTimeInMillis() - startTime2.getTimeInMillis()), TasksUiPlugin.getTaskListManager() diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java index 6553e9301..4e4a4d634 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskDataExportTest.java @@ -53,7 +53,7 @@ public class TaskDataExportTest extends AbstractContextTest { removeFiles(new File(TasksUiPlugin.getDefault().getDataDirectory())); ContextCorePlugin.getDefault().getContextStore().init(); - + // Create the export wizard wizard = new TaskDataExportWizard(); wizard.addPages(); @@ -87,7 +87,7 @@ public class TaskDataExportTest extends AbstractContextTest { } @Override - protected void tearDown() throws Exception { + protected void tearDown() throws Exception { removeFiles(destinationDir); destinationDir.delete(); assertFalse(destinationDir.exists()); @@ -96,8 +96,7 @@ public class TaskDataExportTest extends AbstractContextTest { } /** - * Tests the wizard when it has been asked to export all task data to a zip - * file + * Tests the wizard when it has been asked to export all task data to a zip file */ public void testExportAllToZip() throws Exception { diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java index da708c6ae..aa7bc958f 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskHistoryTest.java @@ -140,8 +140,7 @@ public class TaskHistoryTest extends TestCase { } /** - * Tests navigation to previous/next tasks that are chosen from a list - * rather than being sequentially navigated + * Tests navigation to previous/next tasks that are chosen from a list rather than being sequentially navigated */ public void testArbitraryHistoryNavigation() { @@ -188,7 +187,7 @@ public class TaskHistoryTest extends TestCase { assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task2); assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task4); assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - + // Pick a task from drop down history navigateAction = prevAction.new TaskNavigateAction(task4); navigateAction.run(); @@ -197,7 +196,7 @@ public class TaskHistoryTest extends TestCase { assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task3); assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task2); assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - + // Hit previous task button taskView.getPreviousTaskAction().run(); assertTrue(task3.isActive()); @@ -205,9 +204,9 @@ public class TaskHistoryTest extends TestCase { assertTrue(prevHistoryList.get(prevHistoryList.size() - 2) == task3); assertTrue(prevHistoryList.get(prevHistoryList.size() - 3) == task2); assertTrue(prevHistoryList.get(prevHistoryList.size() - 4) == task1); - + (new TaskDeactivateAction()).run(task3); - + // List<ITask> nextHistoryList = taskHistory.getNextTasks(); // assertTrue(nextHistoryList.get(0) == task3); // assertTrue(nextHistoryList.get(1) == task4); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java index e69448f2a..4f62d4f7a 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskList06DataMigrationTest.java @@ -146,7 +146,8 @@ class TaskListDataMigration implements IRunnableWithProgress { public void doMigration(IProgressMonitor monitor) { try { - if(dataDirectory == null || !dataDirectory.exists()) return; + if (dataDirectory == null || !dataDirectory.exists()) + return; monitor.beginTask("Mylar Data Migration", 4); migrateTaskList(new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); monitor.worked(1); @@ -209,11 +210,8 @@ class TaskListDataMigration implements IRunnableWithProgress { monitor.beginTask("Migrate Repository Data", 1); ZipFileUtil.createZipFile(newRepositoriesFile, filesToZip, new SubProgressMonitor(monitor, 1)); if (!oldRepositoriesFile.delete()) { - StatusHandler - .fail( - null, - "Could not remove old repositories file. Check read/write permission on data directory.", - false); + StatusHandler.fail(null, + "Could not remove old repositories file. Check read/write permission on data directory.", false); return false; } monitor.worked(1); @@ -229,7 +227,8 @@ class TaskListDataMigration implements IRunnableWithProgress { public boolean migrateTaskContextData(IProgressMonitor monitor) { ArrayList<File> contextFiles = new ArrayList<File>(); for (File file : dataDirectory.listFiles()) { - if (file.getName().startsWith("http") || file.getName().startsWith("local") || file.getName().startsWith("task")) { + if (file.getName().startsWith("http") || file.getName().startsWith("local") + || file.getName().startsWith("task")) { if (!file.getName().endsWith(".zip")) { contextFiles.add(file); } @@ -250,7 +249,7 @@ class TaskListDataMigration implements IRunnableWithProgress { for (File file : contextFiles) { ArrayList<File> filesToZip = new ArrayList<File>(); filesToZip.add(file); - File newContextFile = new File(contextsFolder, file.getName()+".zip"); + File newContextFile = new File(contextsFolder, file.getName() + ".zip"); if (newContextFile.exists()) { if (!newContextFile.delete()) { StatusHandler.fail(null, @@ -275,12 +274,13 @@ class TaskListDataMigration implements IRunnableWithProgress { } return true; } - + public boolean migrateActivityData(IProgressMonitor monitor) { - File oldActivityFile = new File(dataDirectory, InteractionContextManager.OLD_CONTEXT_HISTORY_FILE_NAME+InteractionContextManager.CONTEXT_FILE_EXTENSION_OLD); + File oldActivityFile = new File(dataDirectory, InteractionContextManager.OLD_CONTEXT_HISTORY_FILE_NAME + + InteractionContextManager.CONTEXT_FILE_EXTENSION_OLD); if (!oldActivityFile.exists()) return false; - + File contextsFolder = new File(dataDirectory, WorkspaceAwareContextStore.CONTEXTS_DIRECTORY); if (!contextsFolder.exists()) { if (!contextsFolder.mkdir()) { @@ -289,9 +289,10 @@ class TaskListDataMigration implements IRunnableWithProgress { return false; } } - - File newActivityFile = new File(contextsFolder, InteractionContextManager.CONTEXT_HISTORY_FILE_NAME+InteractionContextManager.CONTEXT_FILE_EXTENSION); - + + File newActivityFile = new File(contextsFolder, InteractionContextManager.CONTEXT_HISTORY_FILE_NAME + + InteractionContextManager.CONTEXT_FILE_EXTENSION); + if (newActivityFile.exists()) { if (!newActivityFile.delete()) { StatusHandler.fail(null, @@ -305,11 +306,8 @@ class TaskListDataMigration implements IRunnableWithProgress { monitor.beginTask("Migrate Activity Data", 1); ZipFileUtil.createZipFile(newActivityFile, filesToZip, new SubProgressMonitor(monitor, 1)); if (!oldActivityFile.delete()) { - StatusHandler - .fail( - null, - "Could not remove old activity file. Check read/write permission on data directory.", - false); + StatusHandler.fail(null, + "Could not remove old activity file. Check read/write permission on data directory.", false); return false; } monitor.worked(1); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java index de006a593..4f5e40d09 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListBackupManagerTest.java @@ -53,12 +53,10 @@ public class TaskListBackupManagerTest extends TestCase { // false); TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_SCHEDULE, 1); TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.BACKUP_LAST, 0f); - assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore() - .getLong(TasksUiPreferenceConstants.BACKUP_LAST)); + assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore().getLong(TasksUiPreferenceConstants.BACKUP_LAST)); backupManager.start(5); Thread.sleep(3000); - assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore() - .getLong(TasksUiPreferenceConstants.BACKUP_LAST)); + assertEquals(0, TasksUiPlugin.getDefault().getPreferenceStore().getLong(TasksUiPreferenceConstants.BACKUP_LAST)); } public void testAutoBackupEnabled() throws InterruptedException, InvocationTargetException, IOException { diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java index 6908c3323..95d0e44ac 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListManagerTest.java @@ -114,15 +114,14 @@ public class TaskListManagerTest extends TestCase { assertEquals(0, manager.getTaskList().getAllTasks().size()); manager.getTaskList().moveToContainer(task, manager.getTaskList().getDefaultCategory()); assertEquals(1, manager.getTaskList().getAllTasks().size()); - - + manager.saveTaskList(); manager.resetTaskList(); manager.readExistingOrCreateNewList(); assertEquals(1, manager.getTaskList().getAllTasks().size()); - manager.getTaskList().deleteTask(task); + manager.getTaskList().deleteTask(task); assertEquals(0, manager.getTaskList().getAllTasks().size()); manager.saveTaskList(); assertEquals(0, manager.getTaskList().getAllTasks().size()); @@ -190,15 +189,13 @@ public class TaskListManagerTest extends TestCase { RepositoryTaskData taskData = new RepositoryTaskData(new MockAttributeFactory(), task.getConnectorKind(), task.getRepositoryUrl(), task.getTaskId(), task.getTaskKind()); TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), - task.getTaskId())); + assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task.getRepositoryUrl(), task.getTaskId())); RepositoryTaskData taskData2 = new RepositoryTaskData(new MockAttributeFactory(), task2.getConnectorKind(), task2.getRepositoryUrl(), task2.getTaskId(), task2.getTaskKind()); taskData2.setNewComment("TEST"); TasksUiPlugin.getTaskDataManager().setNewTaskData(taskData2); - assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), - task2.getTaskId())); + assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), task2.getTaskId())); assertEquals("TEST", TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), task2.getTaskId()).getNewComment()); @@ -206,8 +203,8 @@ public class TaskListManagerTest extends TestCase { assertNull(manager.getTaskList().getTask("http://a-123")); assertNotNull(manager.getTaskList().getTask("http://b-123")); assertNotNull(TasksUiPlugin.getTaskDataManager().getNewTaskData("http://b", "123")); - RepositoryTaskData otherData = TasksUiPlugin.getTaskDataManager().getNewTaskData( - task2.getRepositoryUrl(), task2.getTaskId()); + RepositoryTaskData otherData = TasksUiPlugin.getTaskDataManager().getNewTaskData(task2.getRepositoryUrl(), + task2.getTaskId()); assertNotNull(otherData); assertEquals("TEST", otherData.getNewComment()); } @@ -474,8 +471,8 @@ public class TaskListManagerTest extends TestCase { manager.resetTaskList(); manager.readExistingOrCreateNewList(); assertEquals(1, manager.getTaskList().getAllTasks().size()); - } - + } + public void testCreateAndMove() { MockRepositoryTask repositoryTask = new MockRepositoryTask("1"); repositoryTask.setTaskKind("kind"); @@ -516,7 +513,7 @@ public class TaskListManagerTest extends TestCase { assertNotNull(manager.getTaskList()); manager.resetTaskList(); manager.readExistingOrCreateNewList(); - + // read once Set<AbstractTaskCategory> readCats = manager.getTaskList().getTaskContainers(); assertTrue(manager.getTaskList().getCategories().contains(cat1)); @@ -524,7 +521,7 @@ public class TaskListManagerTest extends TestCase { AbstractTaskContainer readCat1 = iterator.next(); assertEquals(cat1, readCat1); assertEquals(1, readCat1.getChildren().size()); - + manager.saveTaskList(); assertNotNull(manager.getTaskList()); manager.resetTaskList(); @@ -537,7 +534,7 @@ public class TaskListManagerTest extends TestCase { iterator = readCats.iterator(); AbstractTaskContainer reReadCat1 = iterator.next(); assertEquals(cat1, reReadCat1); - + assertEquals(1, reReadCat1.getChildren().size()); } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java index 0b5ffec98..c483b3726 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListTest.java @@ -13,7 +13,6 @@ import junit.framework.TestCase; import org.eclipse.mylyn.internal.tasks.core.TaskCategory; import org.eclipse.mylyn.tasks.core.TaskList; - /** * @author Mik Kersten */ @@ -24,5 +23,5 @@ public class TaskListTest extends TestCase { taskList.addCategory(new TaskCategory("a")); assertEquals(2, taskList.getUserCategories().size()); } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java index 62a225344..45d8dc7a5 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskListUiTest.java @@ -92,7 +92,7 @@ public class TaskListUiTest extends TestCase { cat1task1 = manager.createNewLocalTask("task 1"); cat1task1.setPriority(PriorityLevel.P1.toString()); - cat1task1.setCompleted(true); + cat1task1.setCompleted(true); manager.getTaskList().moveToContainer(cat1task1, cat1); cat1task1sub1 = manager.createNewLocalTask("sub task 1"); @@ -255,7 +255,7 @@ public class TaskListUiTest extends TestCase { List<AbstractTaskContainer> selectedElements = new Vector<AbstractTaskContainer>(); selectedElements.add(cat1task1); int numCategoriesMinusArchiveContainer = manager.getTaskList().getCategories().size() - 1; - int numSeparators = 1; + int numSeparators = 1; // adding a separator and the New Category... action int expectedNrOfSubMenuEntries = numCategoriesMinusArchiveContainer + numSeparators + 1; NewCategoryAction newCatActon = new NewCategoryAction(); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java index d33904083..a37eaed6c 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskPlanningEditorTest.java @@ -42,12 +42,11 @@ public class TaskPlanningEditorTest extends TestCase { protected void tearDown() throws Exception { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false); TasksUiPlugin.getRepositoryManager().clearRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - TasksUiPlugin.getTaskListManager().resetTaskList(); + TasksUiPlugin.getTaskListManager().resetTaskList(); TasksUiPlugin.getTaskListManager().saveTaskList(); super.tearDown(); } - public void testDirtyOnEdit() { LocalTask task = new LocalTask("1", MOCK_LABEL); task.setSummary(DESCRIPTION); @@ -89,12 +88,11 @@ public class TaskPlanningEditorTest extends TestCase { assertEquals(NEW_DESCRIPTION, editor.getDescription()); assertFalse(editor.isDirty()); } - - /** - * Test that if editor is dirty and external rename happens - * editor remains dirty + + /** + * Test that if editor is dirty and external rename happens editor remains dirty */ - public void testRenameInDirtyState() { + public void testRenameInDirtyState() { LocalTask task = new LocalTask("1", MOCK_LABEL); task.setSummary(DESCRIPTION); TasksUiPlugin.getTaskListManager().getTaskList().addTask(task); @@ -107,12 +105,12 @@ public class TaskPlanningEditorTest extends TestCase { assertFalse(editor.isDirty()); editor.setDescription(NEW_DESCRIPTION); assertTrue(editor.isDirty()); - TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, NEW_DESCRIPTION+"2"); - assertEquals(NEW_DESCRIPTION+"2", task.getSummary()); + TasksUiPlugin.getTaskListManager().getTaskList().renameTask(task, NEW_DESCRIPTION + "2"); + assertEquals(NEW_DESCRIPTION + "2", task.getSummary()); editor.updateTaskData(task); //assertEquals(NEW_DESCRIPTION+"2", editor.getFormTitle()); - assertEquals(NEW_DESCRIPTION+"2", editor.getDescription()); + assertEquals(NEW_DESCRIPTION + "2", editor.getDescription()); assertTrue(editor.isDirty()); } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java index d7acb24d6..7cbb63a8a 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoriesExternalizerTest.java @@ -20,7 +20,7 @@ import junit.framework.TestCase; import org.eclipse.mylyn.internal.tasks.core.TaskRepositoriesExternalizer; import org.eclipse.mylyn.tasks.core.TaskRepository; -/** +/** * @author Rob Elves * @author Erik Ramfelt (bug 168782) */ @@ -29,35 +29,40 @@ public class TaskRepositoriesExternalizerTest extends TestCase { private Set<TaskRepository> taskRepositories = new HashSet<TaskRepository>(); private static final String REP_TYPE = "bugzilla"; - + private static final String REPURL1 = "http://somewhere1"; + private static final String REPURL2 = "http://somewhere2"; private static final String TIMEZONE = "test time zone"; + private static final String VERSION = "test version"; + private static final String ENCODING = "test encoding"; + private static final String TIMESTAMP = "test time stamp"; private static final String SUFFIX = "2"; - + private TaskRepository repository1; + private TaskRepository repository2; - + @Override protected void setUp() throws Exception { repository1 = new TaskRepository(REP_TYPE, REPURL1); repository2 = new TaskRepository("bugzilla", REPURL2); - + repository1.setTimeZoneId(TIMEZONE); repository1.setVersion(VERSION); repository1.setCharacterEncoding(ENCODING); - repository1.setSynchronizationTimeStamp(TIMESTAMP); + repository1.setSynchronizationTimeStamp(TIMESTAMP); taskRepositories.add(repository1); - + repository2.setTimeZoneId(TIMEZONE + SUFFIX); - repository2.setVersion(VERSION+ SUFFIX); - repository2.setCharacterEncoding(ENCODING+ SUFFIX); - repository2.setSynchronizationTimeStamp(TIMESTAMP+ SUFFIX); + repository2.setVersion(VERSION + SUFFIX); + repository2.setCharacterEncoding(ENCODING + SUFFIX); + repository2.setSynchronizationTimeStamp(TIMESTAMP + SUFFIX); taskRepositories.add(repository2); } @@ -73,20 +78,20 @@ public class TaskRepositoriesExternalizerTest extends TestCase { assertEquals(2, taskRepositories.size()); taskRepositories.contains(repository1); taskRepositories.contains(repository2); - for (TaskRepository repository: taskRepositories) { - if(repository.getUrl().equals(REPURL1)) { + for (TaskRepository repository : taskRepositories) { + if (repository.getUrl().equals(REPURL1)) { assertEquals(TIMEZONE, repository.getTimeZoneId()); assertEquals(VERSION, repository.getVersion()); assertEquals(ENCODING, repository.getCharacterEncoding()); assertEquals(TIMESTAMP, repository.getSynchronizationTimeStamp()); - } else if(repository.getUrl().equals(REPURL2)) { - assertEquals(TIMEZONE+ SUFFIX, repository.getTimeZoneId()); - assertEquals(VERSION+ SUFFIX, repository.getVersion()); - assertEquals(ENCODING+ SUFFIX, repository.getCharacterEncoding()); - assertEquals(TIMESTAMP+ SUFFIX, repository.getSynchronizationTimeStamp()); + } else if (repository.getUrl().equals(REPURL2)) { + assertEquals(TIMEZONE + SUFFIX, repository.getTimeZoneId()); + assertEquals(VERSION + SUFFIX, repository.getVersion()); + assertEquals(ENCODING + SUFFIX, repository.getCharacterEncoding()); + assertEquals(TIMESTAMP + SUFFIX, repository.getSynchronizationTimeStamp()); } } - + } public void testExternalizationEmptyRepository() { @@ -96,11 +101,11 @@ public class TaskRepositoriesExternalizerTest extends TestCase { file.deleteOnExit(); externalizer.writeRepositoriesToXML(taskRepositories, file); taskRepositories = externalizer.readRepositoriesFromXML(file); - assertEquals(2, taskRepositories.size()); + assertEquals(2, taskRepositories.size()); taskRepositories.clear(); externalizer.writeRepositoriesToXML(taskRepositories, file); taskRepositories = externalizer.readRepositoriesFromXML(file); - assertEquals(0, taskRepositories.size()); + assertEquals(0, taskRepositories.size()); } } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java index c9b9e4b44..a3cbab5ee 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryManagerTest.java @@ -73,7 +73,8 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testGet() throws MalformedURLException { - assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString(TaskRepositoryManager.PREF_REPOSITORIES)); + assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString( + TaskRepositoryManager.PREF_REPOSITORIES)); TaskRepository repository = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); @@ -103,7 +104,7 @@ public class TaskRepositoryManagerTest extends TestCase { repositoryList.add(repository2); repositoryList.add(repository1); manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - + // NOTE: different conditions for running with and without the JIRA // Connector if (manager.getRepositoryConnectors().size() > 1) { @@ -117,7 +118,8 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testRepositoryAttributePersistance() throws MalformedURLException { - assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString(TaskRepositoryManager.PREF_REPOSITORIES)); + assertEquals("", TasksUiPlugin.getDefault().getPreferenceStore().getString( + TaskRepositoryManager.PREF_REPOSITORIES)); String version = "123"; String encoding = "UTF-16"; @@ -137,7 +139,7 @@ public class TaskRepositoryManagerTest extends TestCase { TaskRepository temp = manager.getRepository(repository1.getConnectorKind(), repository1.getUrl()); assertNotNull(temp); assertEquals(version, temp.getVersion()); - assertTrue(temp.isAnonymous()); + assertTrue(temp.isAnonymous()); assertEquals(encoding, temp.getCharacterEncoding()); assertEquals(fakeTimeZone, temp.getTimeZoneId()); assertEquals(dateString, temp.getSynchronizationTimeStamp()); @@ -149,7 +151,7 @@ public class TaskRepositoryManagerTest extends TestCase { TaskRepository repository = new TaskRepository(DEFAULT_KIND, DEFAULT_URL); manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); assertNotNull(manager.getRepository(repository.getConnectorKind(), repository.getUrl())); - + TaskRepository repository2 = new TaskRepository(DEFAULT_KIND, ANOTHER_URL); manager.addRepository(repository2, TasksUiPlugin.getDefault().getRepositoriesFilePath()); assertNotNull(manager.getRepository(repository2.getConnectorKind(), repository2.getUrl())); @@ -170,13 +172,14 @@ public class TaskRepositoryManagerTest extends TestCase { } public void testRepositoryWithCustomAttributes() throws Exception { - + // Note: if a connector doesn't exist the associated repositories are not loaded (orphaned) // causing this test to fail. AbstractRepositoryConnector connector = new MockRepositoryConnector(); manager.addRepositoryConnector(connector); - - TaskRepository repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, "http://jroller.com/page/eu"); + + TaskRepository repository = new TaskRepository(MockRepositoryConnector.REPOSITORY_KIND, + "http://jroller.com/page/eu"); repository.setProperty("owner", "euxx"); manager.addRepository(repository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); @@ -198,7 +201,7 @@ public class TaskRepositoryManagerTest extends TestCase { repositoryList.add(repository2); repositoryList.add(repository1); manager.readRepositories(TasksUiPlugin.getDefault().getRepositoriesFilePath()); - + assertEquals("got: " + manager.getAllRepositories(), 2, manager.getAllRepositories().size()); } } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java index 8b44ad69b..12857c5cb 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositorySorterTest.java @@ -46,7 +46,7 @@ public class TaskRepositorySorterTest extends TestCase { assertTrue(sorter.compare(null, t1, t2) < 0); assertTrue(sorter.compare(null, t3, t1) > 0); } - + public void testLabelSorting() { TaskRepositoriesSorter sorter = new TaskRepositoriesSorter(); TaskRepository t1 = new TaskRepository("kind", "http://a"); @@ -55,7 +55,7 @@ public class TaskRepositorySorterTest extends TestCase { t2.setProperty(IRepositoryConstants.PROPERTY_LABEL, "b"); TaskRepository t3 = new TaskRepository("kind", "http://a"); t3.setProperty(IRepositoryConstants.PROPERTY_LABEL, "c"); - + assertTrue(sorter.compare(null, t1, t2) < 0); assertTrue(sorter.compare(null, t3, t1) > 0); } @@ -65,7 +65,7 @@ public class TaskRepositorySorterTest extends TestCase { TaskRepository t1 = new TaskRepository("kind", "http://a"); t1.setProperty(IRepositoryConstants.PROPERTY_LABEL, "a"); TaskRepository t2 = new TaskRepository("kind", "http://a"); - + assertTrue(sorter.compare(null, t1, t2) < 0); } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java index 9172f9566..a2becad24 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskRepositoryTest.java @@ -21,9 +21,9 @@ public class TaskRepositoryTest extends TestCase { public void testLabel() { TaskRepository repository = new TaskRepository("kind", "http://foo.bar"); assertTrue(repository.getRepositoryLabel().equals(repository.getUrl())); - + repository.setProperty(IRepositoryConstants.PROPERTY_LABEL, "label"); assertTrue(repository.getRepositoryLabel().equals("label")); } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java index 87ff08114..fb7805cc7 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/TaskTest.java @@ -49,14 +49,14 @@ public class TaskTest extends TestCase { task.setUrl(null); assertFalse(task.hasValidUrl()); } - + public void testPriorityNeverNull() { AbstractTask task = new LocalTask("handle", "label"); assertNotNull(task.getPriority()); - - PriorityLevel def = PriorityLevel.getDefault(); - assertNotNull(def); + + PriorityLevel def = PriorityLevel.getDefault(); + assertNotNull(def); assertEquals(def, AbstractTask.PriorityLevel.fromDescription("garbage")); - assertEquals(def, AbstractTask.PriorityLevel.fromString("garbage")); + assertEquals(def, AbstractTask.PriorityLevel.fromString("garbage")); } } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java index d3677ba70..513a15f9f 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/UrlConnectionUtilTest.java @@ -25,49 +25,50 @@ public class UrlConnectionUtilTest extends TestCase { assertEquals(444, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); assertEquals("/folder/file.txt", WebClientUtil.getRequestPath(url)); - + url = "http://example.com/"; assertEquals(80, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); assertEquals("/", WebClientUtil.getRequestPath(url)); - + url = "https://example.com:321"; assertEquals(321, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); assertEquals("", WebClientUtil.getRequestPath(url)); - + url = "example.com:321"; assertEquals(321, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); assertEquals("", WebClientUtil.getRequestPath(url)); - + url = "https://example.com:444/folder/file.txt?search=https://example.com:812/folder/file.txt"; assertEquals(444, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", WebClientUtil.getRequestPath(url)); - + assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", + WebClientUtil.getRequestPath(url)); + url = "https://example.com/folder/file.txt?search=https://example.com:812/folder/file.txt"; assertEquals(443, WebClientUtil.getPort(url)); assertEquals("example.com", WebClientUtil.getDomain(url)); - assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", WebClientUtil.getRequestPath(url)); - + assertEquals("/folder/file.txt?search=https://example.com:812/folder/file.txt", + WebClientUtil.getRequestPath(url)); + } - + public void testCredentials() { AuthenticatedProxy proxy = new AuthenticatedProxy(Type.HTTP, new InetSocketAddress(4567), "user", "password"); - UsernamePasswordCredentials credentials = (UsernamePasswordCredentials) WebClientUtil.getCredentials(proxy, new InetSocketAddress(1234)); + UsernamePasswordCredentials credentials = (UsernamePasswordCredentials) WebClientUtil.getCredentials(proxy, + new InetSocketAddress(1234)); assertEquals("user", credentials.getUserName()); assertEquals("password", credentials.getPassword()); - + proxy = new AuthenticatedProxy(Type.HTTP, new InetSocketAddress(4567), "domain\\user", "password"); - NTCredentials ntCredentials = (NTCredentials) WebClientUtil.getCredentials(proxy, new InetSocketAddress("mylar.eclipse.org", 1234)); + NTCredentials ntCredentials = (NTCredentials) WebClientUtil.getCredentials(proxy, new InetSocketAddress( + "mylar.eclipse.org", 1234)); assertEquals("user", ntCredentials.getUserName()); assertEquals("password", ntCredentials.getPassword()); assertEquals("domain", ntCredentials.getDomain()); assertEquals("mylar.eclipse.org", ntCredentials.getHost()); } - - - } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java index 764180a65..ee0ee1176 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttachmentHandler.java @@ -77,5 +77,5 @@ public class MockAttachmentHandler extends AbstractAttachmentHandler { public void setAttachmentData(byte[] data) { this.data = data; } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java index f01075277..2063e7103 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockAttributeFactory.java @@ -12,8 +12,6 @@ import java.util.Date; import org.eclipse.mylyn.tasks.core.AbstractAttributeFactory; - - /** * @author Rob Elves */ @@ -43,7 +41,7 @@ public class MockAttributeFactory extends AbstractAttributeFactory { public String mapCommonAttributeKey(String key) { return key; } - + @Override public Date getDateForAttributeType(String attributeKey, String dateString) { // ignore diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java index 198576db2..f1a707dc2 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryConnector.java @@ -74,13 +74,15 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector { } @Override - public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) throws CoreException { + public RepositoryTaskData getTaskData(TaskRepository repository, String taskId, IProgressMonitor monitor) + throws CoreException { // ignore return null; } @Override - public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) throws CoreException { + public String postTaskData(TaskRepository repository, RepositoryTaskData taskData, IProgressMonitor monitor) + throws CoreException { // ignore return null; } @@ -134,13 +136,13 @@ public class MockRepositoryConnector extends AbstractRepositoryConnector { } @Override - public void updateTaskFromRepository(TaskRepository repository, AbstractTask repositoryTask, IProgressMonitor monitor) { + public void updateTaskFromRepository(TaskRepository repository, AbstractTask repositoryTask, + IProgressMonitor monitor) { // ignore } @Override - public boolean markStaleTasks(TaskRepository repository, - Set<AbstractTask> tasks, IProgressMonitor monitor) { + public boolean markStaleTasks(TaskRepository repository, Set<AbstractTask> tasks, IProgressMonitor monitor) { // ignore return false; } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java index 6eb87bbaa..4f1b470e2 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryQuery.java @@ -24,7 +24,7 @@ public class MockRepositoryQuery extends AbstractRepositoryQuery { super(description); super.setUrl(MOCK_URL); } - + public MockRepositoryQuery(String description, String url) { super(description); super.setUrl(url); diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java index 01d96ac67..fa3ba45ca 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockRepositoryTask.java @@ -17,9 +17,9 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; * @author Mik Kersten */ public class MockRepositoryTask extends AbstractTask { - + private String ownerId; - + public MockRepositoryTask(String taskId) { super(MockRepositoryConnector.REPOSITORY_URL, taskId, taskId); } @@ -27,11 +27,11 @@ public class MockRepositoryTask extends AbstractTask { public MockRepositoryTask(String repositoryUrl, String taskId) { super(repositoryUrl, taskId, taskId); } - + public MockRepositoryTask(String repositoryUrl, String taskId, String summary) { super(repositoryUrl, taskId, summary); } - + @Override public String getConnectorKind() { return "mock"; @@ -41,10 +41,10 @@ public class MockRepositoryTask extends AbstractTask { public void setOwner(String ownerId) { this.ownerId = ownerId; } - + @Override public String getOwner() { - if(ownerId == null) { + if (ownerId == null) { return super.getOwner(); } else { return ownerId; diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java index be79bdc12..d284d3107 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockStatusHandler.java @@ -28,5 +28,5 @@ public class MockStatusHandler implements IStatusHandler { public void assertNoStatus() { TestCase.assertNull("Unexpected error reported through MylarStatusHandler", status); } - + } diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java index f4569b764..d638d44d7 100644 --- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java +++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/connector/MockTaskListFactory.java @@ -30,13 +30,12 @@ public class MockTaskListFactory extends AbstractTaskListFactory { MockRepositoryTask task = new MockRepositoryTask(repositoryUrl, taskId, summary); return task; } - - + @Override public String getTaskElementName() { return "Mock" + AbstractTaskListFactory.KEY_TASK; } - + // private static final String KEY_MOCK = "Mock"; // // @Override @@ -53,7 +52,7 @@ public class MockTaskListFactory extends AbstractTaskListFactory { // public boolean canCreateElementFor(AbstractQueryHit queryHit) { // return queryHit instanceof AbstractQueryHit; // } - + // @Override // public boolean canReadCategory(Node node) { // return false; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java index f7a6149e1..0f228b856 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AbstractTaskListFilter.java @@ -13,8 +13,7 @@ package org.eclipse.mylyn.internal.tasks.ui; import org.eclipse.mylyn.tasks.core.AbstractTask; /** - * Custom filters are used so that the "Find:" filter can 'see through' - * any filters that may have been applied. + * Custom filters are used so that the "Find:" filter can 'see through' any filters that may have been applied. * * @author Mik Kersten */ @@ -24,5 +23,5 @@ public abstract class AbstractTaskListFilter { public boolean shouldAlwaysShow(Object parent, AbstractTask task, boolean exposeSubTasks) { return task.isActive(); - } + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java index 796cd3a88..d3a164b2e 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/AddExistingTaskJob.java @@ -41,9 +41,8 @@ public class AddExistingTaskJob extends Job { private String taskId; /** - * Optional; informs the task container the task initialy belongs to; if - * null, it will be added to the current selected task's category in task - * list + * Optional; informs the task container the task initialy belongs to; if null, it will be added to the current + * selected task's category in task list */ private AbstractTaskCategory taskContainer; @@ -68,7 +67,7 @@ public class AddExistingTaskJob extends Job { Calendar newSchedule = Calendar.getInstance(); TasksUiPlugin.getTaskListManager().setScheduledEndOfDay(newSchedule); TasksUiPlugin.getTaskListManager().setScheduledFor(newTask, newSchedule.getTime()); - + TasksUiUtil.refreshAndOpenTaskListElement(newTask); PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @@ -76,8 +75,7 @@ public class AddExistingTaskJob extends Job { AbstractTaskCategory category = taskContainer; TaskListView taskListView = TaskListView.getFromActivePerspective(); if (category == null) { - Object selectedObject = ((IStructuredSelection) taskListView.getViewer().getSelection()) - .getFirstElement(); + Object selectedObject = ((IStructuredSelection) taskListView.getViewer().getSelection()).getFirstElement(); if (selectedObject instanceof TaskCategory) { category = (TaskCategory) selectedObject; } else { @@ -94,8 +92,8 @@ public class AddExistingTaskJob extends Job { public void run() { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window != null) { - MessageDialog.openWarning(window.getShell(), "Add Existing Task Failed", MessageFormat - .format("Unable to retrieve task \"{0}\" from repository.", taskId)); + MessageDialog.openWarning(window.getShell(), "Add Existing Task Failed", + MessageFormat.format("Unable to retrieve task \"{0}\" from repository.", taskId)); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ComboSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ComboSelectionDialog.java index 794b28b90..708ce7253 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ComboSelectionDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ComboSelectionDialog.java @@ -25,8 +25,7 @@ import org.eclipse.swt.widgets.Shell; /** * General purpose dialog for selecting an item from a combo box. * - * @author This was (essentially) copied from Eclipse's internal implementation - * by Wesley Coelho + * @author This was (essentially) copied from Eclipse's internal implementation by Wesley Coelho */ public class ComboSelectionDialog extends Dialog { @@ -94,8 +93,7 @@ public class ComboSelectionDialog extends Dialog { } /** - * Returns the array index of the selected string or -1 if no string was - * selected. + * Returns the array index of the selected string or -1 if no string was selected. */ public int getSelectedIndex() { return fSelectedIndex; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeContainerImageDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeContainerImageDescriptor.java index 7c7382dd3..a0cf4becd 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeContainerImageDescriptor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeContainerImageDescriptor.java @@ -22,11 +22,11 @@ import org.eclipse.swt.graphics.Point; public class CompositeContainerImageDescriptor extends CompositeImageDescriptor { private ImageData base; - + private ImageData overlay; - + protected Point size; - + public CompositeContainerImageDescriptor(ImageDescriptor icon, ImageDescriptor overlay, boolean wide) { this.base = getImageData(icon); if (overlay != null) { @@ -38,17 +38,17 @@ public class CompositeContainerImageDescriptor extends CompositeImageDescriptor } this.size = new Point(width, base.height); } - + @Override protected void drawCompositeImage(int width, int height) { drawImage(base, 0, 0); if (overlay != null) { - drawImage(overlay, base.width+2, 0); + drawImage(overlay, base.width + 2, 0); } } private ImageData getImageData(ImageDescriptor descriptor) { - ImageData data = descriptor.getImageData(); + ImageData data = descriptor.getImageData(); // see bug 51965: getImageData can return null if (data == null) { data = DEFAULT_IMAGE_DATA; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeSynchImageDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeSynchImageDescriptor.java index f9b136f5d..cd25e7db1 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeSynchImageDescriptor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeSynchImageDescriptor.java @@ -24,20 +24,20 @@ public class CompositeSynchImageDescriptor extends CompositeImageDescriptor { private ImageData base; private ImageData background; - + private boolean fillBackground; protected Point size; - + static int WIDTH; - + public CompositeSynchImageDescriptor(ImageDescriptor icon, boolean fillBackground) { this.base = getImageData(icon); this.background = getImageData(TasksUiImages.OVERLAY_SOLID_WHITE); this.size = new Point(background.width, background.height); this.fillBackground = fillBackground; } - + @Override protected void drawCompositeImage(int width, int height) { if (fillBackground) { @@ -47,7 +47,7 @@ public class CompositeSynchImageDescriptor extends CompositeImageDescriptor { } private ImageData getImageData(ImageDescriptor descriptor) { - ImageData data = descriptor.getImageData(); + ImageData data = descriptor.getImageData(); // see bug 51965: getImageData can return null if (data == null) { data = DEFAULT_IMAGE_DATA; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeTaskImageDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeTaskImageDescriptor.java index af592201e..862139446 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeTaskImageDescriptor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/CompositeTaskImageDescriptor.java @@ -24,15 +24,15 @@ public class CompositeTaskImageDescriptor extends CompositeImageDescriptor { private ImageData base; private ImageData kind; - + protected Point size; public static final int OFFSET_DECORATION = 6; - + static final int WIDTH_ICON = 16; - + private int offset = 0; - + public CompositeTaskImageDescriptor(ImageDescriptor icon, ImageDescriptor overlayKind, boolean wide) { this.base = getImageData(icon); if (overlayKind != null) { @@ -45,17 +45,17 @@ public class CompositeTaskImageDescriptor extends CompositeImageDescriptor { } this.size = new Point(width, base.height); } - + @Override protected void drawCompositeImage(int width, int height) { drawImage(base, offset, 1); if (kind != null) { - drawImage(kind, offset+5, 6); + drawImage(kind, offset + 5, 6); } } private ImageData getImageData(ImageDescriptor descriptor) { - ImageData data = descriptor.getImageData(); + ImageData data = descriptor.getImageData(); // see bug 51965: getImageData can return null if (data == null) { data = DEFAULT_IMAGE_DATA; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ContextUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ContextUiUtil.java index be2f73f61..64fa4190e 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ContextUiUtil.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ContextUiUtil.java @@ -85,8 +85,8 @@ public class ContextUiUtil { return true; } - public static boolean uploadContext(final TaskRepository repository, final AbstractTask task, - final String comment, final IRunnableContext context) { + public static boolean uploadContext(final TaskRepository repository, final AbstractTask task, final String comment, + final IRunnableContext context) { final AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( repository.getConnectorKind()); try { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java index e9ebf8a27..0c2677b29 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotification.java @@ -29,7 +29,7 @@ public interface ITaskListNotification extends Comparable<ITaskListNotification> public Image getNotificationIcon(); public Image getOverlayIcon(); - + public Date getDate(); public void setDate(Date date); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotificationProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotificationProvider.java index 8cbcf782d..5564f6072 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotificationProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITaskListNotificationProvider.java @@ -19,5 +19,5 @@ import java.util.Set; public interface ITaskListNotificationProvider { public Set<ITaskListNotification> getNotifications(); - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/LocalTaskConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/LocalTaskConnectorUi.java index 8a1ab1f95..12b7b2ab8 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/LocalTaskConnectorUi.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/LocalTaskConnectorUi.java @@ -26,7 +26,6 @@ public class LocalTaskConnectorUi extends AbstractRepositoryConnectorUi { return new NewLocalTaskWizard(); } - @Override public IWizard getQueryWizard(TaskRepository repository, AbstractRepositoryQuery queryToEdit) { return null; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java index ece5af944..d2370aa88 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/MoveToCategoryMenuContributor.java @@ -33,12 +33,12 @@ public class MoveToCategoryMenuContributor implements IDynamicSubMenuContributor final MenuManager subMenuManager = new MenuManager(LABEL); //subMenuManager.setVisible(selectedElements.size() > 0 && !(selectedElements.get(0) instanceof AbstractTaskContainer || selectedElements.get(0) instanceof AbstractRepositoryQuery)); - - subMenuManager - .setVisible(selectedElements.size() > 0 - && selectedElements.get(0) instanceof AbstractTask); - - List<AbstractTaskCategory> categories = new ArrayList<AbstractTaskCategory>(TasksUiPlugin.getTaskListManager().getTaskList().getCategories()); + + subMenuManager.setVisible(selectedElements.size() > 0 && selectedElements.get(0) instanceof AbstractTask); + + List<AbstractTaskCategory> categories = new ArrayList<AbstractTaskCategory>(TasksUiPlugin.getTaskListManager() + .getTaskList() + .getCategories()); Collections.sort(categories); for (final AbstractTaskCategory category : categories) { if (!category.equals(TasksUiPlugin.getTaskListManager().getTaskList().getArchiveContainer())) { @@ -69,15 +69,13 @@ public class MoveToCategoryMenuContributor implements IDynamicSubMenuContributor subMenuManager.add(action); return subMenuManager; } - + /** * public for testing * - * Deals with text where user has entered a '@' or tab character but which are not meant to be accelerators. - * from: Action#setText: - * Note that if you want to insert a '@' character into the text (but no accelerator, - * you can simply insert a '@' or a tab at the end of the text. - * see Action#setText + * Deals with text where user has entered a '@' or tab character but which are not meant to be accelerators. from: + * Action#setText: Note that if you want to insert a '@' character into the text (but no accelerator, you can simply + * insert a '@' or a tab at the end of the text. see Action#setText */ public String handleAcceleratorKeys(String text) { if (text == null) { @@ -94,17 +92,16 @@ public class MoveToCategoryMenuContributor implements IDynamicSubMenuContributor return text; } - /** + /** * @param selectedElements - * @param category + * @param category */ private void moveToCategory(final List<AbstractTaskContainer> selectedElements, AbstractTaskCategory category) { for (AbstractTaskContainer element : selectedElements) { if (element instanceof AbstractTask) { - TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer((AbstractTask) element, - category); + TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer((AbstractTask) element, category); } } } - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob.java index 08b2ab6f4..b5327ec8c 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/OpenRepositoryTaskJob.java @@ -64,10 +64,9 @@ public class OpenRepositoryTaskJob extends Job { if (repository == null) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { - MessageDialog - .openError(null, "Repository Not Found", "Could not find repository configuration for " - + serverUrl + ". \nPlease set up repository via " - + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + "."); + MessageDialog.openError(null, "Repository Not Found", + "Could not find repository configuration for " + serverUrl + + ". \nPlease set up repository via " + TasksUiPlugin.LABEL_VIEW_REPOSITORIES + "."); TasksUiUtil.openUrl(taskUrl, false); } @@ -78,7 +77,7 @@ public class OpenRepositoryTaskJob extends Job { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( repositoryKind); try { - + AbstractTaskDataHandler offlineHandler = connector.getTaskDataHandler(); if (offlineHandler != null) { // the following code was copied from SynchronizeTaskJob @@ -113,7 +112,8 @@ public class OpenRepositoryTaskJob extends Job { if (taskData == null) { TasksUiUtil.openUrl(taskUrl, false); } else { - AbstractRepositoryTaskEditorInput editorInput = new RepositoryTaskEditorInput(repository, taskData.getId(), taskUrl); + AbstractRepositoryTaskEditorInput editorInput = new RepositoryTaskEditorInput(repository, + taskData.getId(), taskUrl); TasksUiUtil.openEditor(editorInput, TaskEditor.ID_EDITOR, page); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java index 2ae880d63..0e293eec7 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonContentProposal.java @@ -15,7 +15,7 @@ import org.eclipse.swt.graphics.Image; * @author Mik Kersten */ public class PersonContentProposal implements IContentProposal { - + private final String address; private boolean isCurrentUser = false; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalLabelProvider.java index dd45647d3..1fa7e0aff 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalLabelProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PersonProposalLabelProvider.java @@ -19,15 +19,15 @@ public class PersonProposalLabelProvider extends LabelProvider { @Override public Image getImage(Object element) { if (element instanceof PersonContentProposal) { - return ((PersonContentProposal)element).getImage(); + return ((PersonContentProposal) element).getImage(); } return null; } - + @Override public String getText(Object element) { if (element instanceof PersonContentProposal) { - return ((PersonContentProposal)element).getLabel(); + return ((PersonContentProposal) element).getLabel(); } return super.getText(element); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PlanningPerspectiveFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PlanningPerspectiveFactory.java index 700fe0c69..9b9cd41d8 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PlanningPerspectiveFactory.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/PlanningPerspectiveFactory.java @@ -25,7 +25,7 @@ import org.eclipse.ui.internal.PageLayout; public class PlanningPerspectiveFactory implements IPerspectiveFactory { public static final String ID_PERSPECTIVE = "org.eclipse.mylyn.tasklist.ui.perspectives.planning"; - + public void createInitialLayout(IPageLayout layout) { defineActions(layout); defineLayout(layout); @@ -63,7 +63,7 @@ public class PlanningPerspectiveFactory implements IPerspectiveFactory { @SuppressWarnings("unchecked") public static void removeUninterestingActionSets(IPageLayout layout) { - ArrayList actionSets = ((PageLayout)layout).getActionSets(); + ArrayList actionSets = ((PageLayout) layout).getActionSets(); actionSets.remove("org.eclipse.ui.edit.text.actionSet.annotationNavigation"); actionSets.remove("org.eclipse.ui.edit.text.actionSet.convertLineDelimitersTo"); actionSets.remove("org.eclipse.ui.externaltools.ExternalToolsSet"); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryReport.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryReport.java index 4b1e6c2e2..86bc227ab 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryReport.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryReport.java @@ -1 +1,2 @@ package org.eclipse.mylyn.internal.tasks.ui; + diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RetrieveTitleFromUrlJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RetrieveTitleFromUrlJob.java index 4e7c84969..a185e09ff 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RetrieveTitleFromUrlJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RetrieveTitleFromUrlJob.java @@ -83,9 +83,9 @@ public abstract class RetrieveTitleFromUrlJob extends Job implements TitleListen pageTitle = url; titleRetrieved = false; } else { - titleRetrieved = true; + titleRetrieved = true; } - setTitle(pageTitle); + setTitle(pageTitle); } }); return Status.OK_STATUS; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java index 41ba01c53..ea982d8e2 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ScheduleTaskMenuContributor.java @@ -55,9 +55,7 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor { final MenuManager subMenuManager = new MenuManager(LABEL_REMINDER); - subMenuManager - .setVisible(selectedElements.size() > 0 - && selectedElements.get(0) instanceof AbstractTask);// !(selectedElements.get(0) instanceof AbstractTaskContainer || selectedElements.get(0) instanceof AbstractRepositoryQuery)); + subMenuManager.setVisible(selectedElements.size() > 0 && selectedElements.get(0) instanceof AbstractTask);// !(selectedElements.get(0) instanceof AbstractTaskContainer || selectedElements.get(0) instanceof AbstractRepositoryQuery)); AbstractTaskContainer singleSelection = null; if (selectedElements.size() == 1) { @@ -189,7 +187,8 @@ public class ScheduleTaskMenuContributor implements IDynamicSubMenuContributor { theCalendar.setTime(singleTaskSelection.getScheduledForDate()); } DateSelectionDialog reminderDialog = new DateSelectionDialog(PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell(), theCalendar, DatePicker.TITLE_DIALOG); + .getActiveWorkbenchWindow() + .getShell(), theCalendar, DatePicker.TITLE_DIALOG); int result = reminderDialog.open(); if (result == Window.OK) { for (AbstractTaskContainer element : taskListElementsToSchedule) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java index 74518b0c8..3841d4afe 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskArchiveFilter.java @@ -21,7 +21,7 @@ public class TaskArchiveFilter extends AbstractTaskListFilter { public boolean select(Object parent, Object element) { if (element instanceof TaskArchive) { return false; - } + } return true; } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java index fd5f8640e..b9f6c1a69 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java @@ -65,7 +65,8 @@ public class TaskLabelDecorator implements ILightweightLabelDecorator { decoration.addOverlay(TasksUiImages.OVERLAY_OVER_DUE, IDecoration.TOP_RIGHT); } } else if (element instanceof TaskRepository) { - ImageDescriptor overlay = TasksUiPlugin.getDefault().getOverlayIcon(((TaskRepository) element).getConnectorKind()); + ImageDescriptor overlay = TasksUiPlugin.getDefault().getOverlayIcon( + ((TaskRepository) element).getConnectorKind()); if (overlay != null) { decoration.addOverlay(overlay, IDecoration.BOTTOM_RIGHT); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListBackupManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListBackupManager.java index e58d1e34e..8cae09d97 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListBackupManager.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListBackupManager.java @@ -40,7 +40,7 @@ import org.eclipse.ui.progress.IProgressService; public class TaskListBackupManager implements IPropertyChangeListener { private static final String TITLE_TASKLIST_BACKUP = "Tasklist Backup"; - + private static final String BACKUP_JOB_NAME = "Scheduled task data backup"; public static final String BACKUP_FAILURE_MESSAGE = "Could not backup task data. Check backup preferences.\n"; @@ -48,7 +48,7 @@ public class TaskListBackupManager implements IPropertyChangeListener { private static final long SECOND = 1000; private static final long MINUTE = 60 * SECOND; - + private static final long HOUR = 60 * MINUTE; private static final long DAY = 24 * HOUR; @@ -88,7 +88,7 @@ public class TaskListBackupManager implements IPropertyChangeListener { // String destination = MylarTaskListPlugin.getMylarCorePrefs().getString( // TaskListPreferenceConstants.BACKUP_FOLDER); String destination = TasksUiPlugin.getDefault().getBackupFolderPath(); - + File backupFolder = new File(destination); if (!backupFolder.exists()) { backupFolder.mkdir(); @@ -124,7 +124,8 @@ public class TaskListBackupManager implements IPropertyChangeListener { /** public for testing purposes */ public void removeOldBackups(File folder) { - int maxBackups = TasksUiPlugin.getDefault().getPreferenceStore().getInt(TasksUiPreferenceConstants.BACKUP_MAXFILES); + int maxBackups = TasksUiPlugin.getDefault().getPreferenceStore().getInt( + TasksUiPreferenceConstants.BACKUP_MAXFILES); File[] files = folder.listFiles(); ArrayList<File> backupFiles = new ArrayList<File>(); @@ -147,14 +148,14 @@ public class TaskListBackupManager implements IPropertyChangeListener { int toomany = backupFileArray.length - maxBackups; if (toomany > 0) { for (int x = 0; x < toomany; x++) { - if(backupFileArray[x] != null) { + if (backupFileArray[x] != null) { backupFileArray[x].delete(); } } } } } - + // public File getMostRecentBackup() { // String destination = TasksUiPlugin.getDefault().getBackupFolderPath(); // @@ -187,7 +188,7 @@ public class TaskListBackupManager implements IPropertyChangeListener { // } class CheckBackupRequired extends TimerTask { - + @Override public void run() { if (!Platform.isRunning() || TasksUiPlugin.getDefault() == null) { @@ -195,7 +196,8 @@ public class TaskListBackupManager implements IPropertyChangeListener { } else { long lastBackup = TasksUiPlugin.getDefault().getPreferenceStore().getLong( TasksUiPreferenceConstants.BACKUP_LAST); - int days = TasksUiPlugin.getDefault().getPreferenceStore().getInt(TasksUiPreferenceConstants.BACKUP_SCHEDULE); + int days = TasksUiPlugin.getDefault().getPreferenceStore().getInt( + TasksUiPreferenceConstants.BACKUP_SCHEDULE); long waitPeriod = days * DAY; final long now = new Date().getTime(); @@ -228,9 +230,8 @@ public class TaskListBackupManager implements IPropertyChangeListener { new Date().getTime()); } } catch (InvocationTargetException e) { - MessageDialog - .openError(null, BACKUP_JOB_NAME, - "Error occured during scheduled tasklist backup.\nCheck settings on Tasklist preferences page."); + MessageDialog.openError(null, BACKUP_JOB_NAME, + "Error occured during scheduled tasklist backup.\nCheck settings on Tasklist preferences page."); } catch (InterruptedException e) { return Status.CANCEL_STATUS; } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListColorsAndFonts.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListColorsAndFonts.java index 6151ebc91..4dd9b549b 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListColorsAndFonts.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListColorsAndFonts.java @@ -41,7 +41,7 @@ public class TaskListColorsAndFonts { public static final String THEME_COLOR_CATEGORY_GRADIENT_END = "org.eclipse.mylyn.tasks.ui.colors.category.gradient.end"; public static final String THEME_COLOR_TASKLIST_CATEGORY = THEME_COLOR_CATEGORY_GRADIENT_END; - + public static final Color BACKGROUND_ARCHIVE = new Color(Display.getDefault(), 225, 226, 246); public static final Color COLOR_TASK_ACTIVE = new Color(Display.getDefault(), 36, 22, 50); @@ -50,8 +50,8 @@ public class TaskListColorsAndFonts { public static final Color COLOR_HYPERLINK_WIDGET = new Color(Display.getDefault(), 40, 99, 172); - public static final Color COLOR_HYPERLINK_TEXT = new Color(Display.getDefault(), 0, 0, 255); - + public static final Color COLOR_HYPERLINK_TEXT = new Color(Display.getDefault(), 0, 0, 255); + public static final Color COLOR_SPELLING_ERROR = new Color(Display.getDefault(), 255, 0, 0); public static final Font BOLD = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT); @@ -64,8 +64,8 @@ public class TaskListColorsAndFonts { Font defaultFont = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT); FontData[] defaultData = defaultFont.getFontData(); if (defaultData != null && defaultData.length == 1) { - FontData data = new FontData(defaultData[0].getName(), defaultData[0].getHeight(), defaultData[0] - .getStyle()); + FontData data = new FontData(defaultData[0].getName(), defaultData[0].getHeight(), + defaultData[0].getStyle()); // NOTE: Windows XP only, for: data.data.lfStrikeOut = 1; try { @@ -115,5 +115,5 @@ public class TaskListColorsAndFonts { } public static final String TASK_EDITOR_FONT = "org.eclipse.mylyn.tasks.ui.fonts.task.editor.comment"; - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java index 816fb698e..6886afa58 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java @@ -29,7 +29,7 @@ public class TaskListHyperlink extends Hyperlink { if (t == null) { return null; } - + String returnText = t; if (gc.textExtent(t).x > width) { for (int i = t.length(); i > 0; i--) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java index 60a20db9d..a6089a09c 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java @@ -31,8 +31,7 @@ public class TaskListImageDescriptor extends CompositeImageDescriptor { protected Point size; - public TaskListImageDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc, boolean top, - boolean left) { + public TaskListImageDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc, boolean top, boolean left) { this.base = getImageData(baseDesc); this.top = top; this.left = left; @@ -47,7 +46,7 @@ public class TaskListImageDescriptor extends CompositeImageDescriptor { this.base = getImageData(baseDesc); setImageSize(size); } - + @Override protected void drawCompositeImage(int width, int height) { drawImage(base, 0, 0); @@ -63,7 +62,7 @@ public class TaskListImageDescriptor extends CompositeImageDescriptor { } private ImageData getImageData(ImageDescriptor descriptor) { - ImageData data = descriptor.getImageData(); + ImageData data = descriptor.getImageData(); // see bug 51965: getImageData can return null if (data == null) { data = DEFAULT_IMAGE_DATA; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java index 2604b781c..6eb3c7683 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java @@ -29,7 +29,7 @@ public class TaskListImageHyperlink extends ImageHyperlink { if (t == null) { return null; } - + String returnText = t; if (gc.textExtent(t).x > width) { for (int i = t.length(); i > 0; i--) { @@ -43,5 +43,5 @@ public class TaskListImageHyperlink extends ImageHyperlink { } return returnText; } - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java index 439520715..81bdd08d0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationIncoming.java @@ -26,7 +26,7 @@ import org.eclipse.ui.PlatformUI; public class TaskListNotificationIncoming implements ITaskListNotification { private final AbstractTask task; - + private String description = null; private DecoratingLabelProvider labelProvider = new DecoratingLabelProvider(new TaskElementLabelProvider(true), @@ -45,7 +45,7 @@ public class TaskListNotificationIncoming implements ITaskListNotification { public String getLabel() { return labelProvider.getText(task); } - + public void setDescription(String description) { this.description = description; } @@ -63,6 +63,7 @@ public class TaskListNotificationIncoming implements ITaskListNotification { public Image getNotificationIcon() { return labelProvider.getImage(task); } + // // public synchronized void setNotified(boolean notified) { // task.setNotified(true); @@ -97,21 +98,21 @@ public class TaskListNotificationIncoming implements ITaskListNotification { public Date getDate() { return date; } - - public void setDate(Date date) { + + public void setDate(Date date) { this.date = date; } - + public int compareTo(ITaskListNotification anotherNotification) throws ClassCastException { - if (!(anotherNotification != null)) - throw new ClassCastException("A ITaskListNotification object expected."); - Date anotherDate = (anotherNotification).getDate(); - if(date != null && anotherDate != null) { - return date.compareTo(anotherDate); - } else if(date == null) { - return -1; - } else { - return 1; - } - } + if (!(anotherNotification != null)) + throw new ClassCastException("A ITaskListNotification object expected."); + Date anotherDate = (anotherNotification).getDate(); + if (date != null && anotherDate != null) { + return date.compareTo(anotherDate); + } else if (date == null) { + return -1; + } else { + return 1; + } + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationManager.java index 6a881f3b7..4382d535b 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationManager.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationManager.java @@ -69,7 +69,8 @@ public class TaskListNotificationManager implements IPropertyChangeListener { if (currentlyNotifying.size() > 0) { popup = new TaskListNotificationPopup(new Shell(PlatformUI.getWorkbench() .getDisplay())); - List<ITaskListNotification> toDisplay = new ArrayList<ITaskListNotification>(currentlyNotifying); + List<ITaskListNotification> toDisplay = new ArrayList<ITaskListNotification>( + currentlyNotifying); Collections.sort(toDisplay); popup.setContents(toDisplay); cleanNotified(); @@ -158,9 +159,11 @@ public class TaskListNotificationManager implements IPropertyChangeListener { } public void startNotification(long initialStartupTime) { - if (TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(TasksUiPreferenceConstants.NOTIFICATIONS_ENABLED)) { + if (TasksUiPlugin.getDefault() + .getPreferenceStore() + .getBoolean(TasksUiPreferenceConstants.NOTIFICATIONS_ENABLED)) { if (!openJob.cancel()) { - try { + try { openJob.join(); } catch (InterruptedException e) { // ignore @@ -198,11 +201,11 @@ public class TaskListNotificationManager implements IPropertyChangeListener { public void propertyChange(PropertyChangeEvent event) { if (event.getProperty().equals(TasksUiPreferenceConstants.NOTIFICATIONS_ENABLED)) { - Object newValue = event.getNewValue(); + Object newValue = event.getNewValue(); if (!(newValue instanceof Boolean)) { // default if no preference value startNotification(OPEN_POPUP_DELAY); - } else if ((Boolean)newValue == true) { + } else if ((Boolean) newValue == true) { startNotification(OPEN_POPUP_DELAY); } else { stopNotification(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java index ef4b8aed3..043a182ec 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationQueryIncoming.java @@ -83,21 +83,21 @@ public class TaskListNotificationQueryIncoming implements ITaskListNotification public Date getDate() { return date; } - - public void setDate(Date date) { + + public void setDate(Date date) { this.date = date; } - + public int compareTo(ITaskListNotification anotherNotification) throws ClassCastException { - if (!(anotherNotification != null)) - throw new ClassCastException("A ITaskListNotification object expected."); - Date anotherDate = (anotherNotification).getDate(); - if(date != null && anotherDate != null) { - return date.compareTo(anotherDate); - } else if(date == null) { - return -1; - } else { - return 1; - } - } + if (!(anotherNotification != null)) + throw new ClassCastException("A ITaskListNotification object expected."); + Date anotherDate = (anotherNotification).getDate(); + if (date != null && anotherDate != null) { + return date.compareTo(anotherDate); + } else if (date == null) { + return -1; + } else { + return 1; + } + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java index 593dd7947..16c17d4bb 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationReminder.java @@ -87,21 +87,21 @@ public class TaskListNotificationReminder implements ITaskListNotification { public Date getDate() { return date; } - - public void setDate(Date date) { + + public void setDate(Date date) { this.date = date; } - + public int compareTo(ITaskListNotification anotherNotification) throws ClassCastException { - if (!(anotherNotification != null)) - throw new ClassCastException("A ITaskListNotification object expected."); - Date anotherDate = (anotherNotification).getDate(); - if(date != null && anotherDate != null) { - return date.compareTo(anotherDate); - } else if(date == null) { - return -1; - } else { - return 1; - } - } + if (!(anotherNotification != null)) + throw new ClassCastException("A ITaskListNotification object expected."); + Date anotherDate = (anotherNotification).getDate(); + if (date != null && anotherDate != null) { + return date.compareTo(anotherDate); + } else if (date == null) { + return -1; + } else { + return 1; + } + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListSynchronizationScheduler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListSynchronizationScheduler.java index 0200d6a47..ae0759a47 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListSynchronizationScheduler.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListSynchronizationScheduler.java @@ -39,13 +39,13 @@ public class TaskListSynchronizationScheduler implements IPropertyChangeListener private List<ScheduledTaskListSynchJob> jobsQueue = Collections.synchronizedList(jobs); private final MutexRule rule = new MutexRule(); - - public TaskListSynchronizationScheduler(boolean refreshOnStartup) { + + public TaskListSynchronizationScheduler(boolean refreshOnStartup) { boolean enabled = TasksUiPlugin.getDefault().getPreferenceStore().getBoolean( TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED); if (refreshOnStartup && enabled) { - addJobToQueue(new ScheduledTaskListSynchJob(DELAY_QUERY_REFRESH_ON_STARTUP, TasksUiPlugin - .getTaskListManager())); + addJobToQueue(new ScheduledTaskListSynchJob(DELAY_QUERY_REFRESH_ON_STARTUP, + TasksUiPlugin.getTaskListManager())); } } @@ -80,18 +80,20 @@ public class TaskListSynchronizationScheduler implements IPropertyChangeListener @Override public void done(IJobChangeEvent event) { synchronized (refreshJob) { - if(refreshJob == jobToAdd && event.getResult() != Status.CANCEL_STATUS) { - startSynchJob(); - } - } + if (refreshJob == jobToAdd && event.getResult() != Status.CANCEL_STATUS) { + startSynchJob(); + } + } } }); jobsQueue.add(jobToAdd); } - + /** - * @param delay sync delay (ms) - * @param repositories used to scope sync to queries associated with given repositories, can be null (sync all repositories) + * @param delay + * sync delay (ms) + * @param repositories + * used to scope sync to queries associated with given repositories, can be null (sync all repositories) */ public void synchNow(long delay, List<TaskRepository> repositories) { cancelAll(); @@ -126,13 +128,14 @@ public class TaskListSynchronizationScheduler implements IPropertyChangeListener } } } - + static class MutexRule implements ISchedulingRule { - public boolean isConflicting(ISchedulingRule rule) { - return rule == this; - } - public boolean contains(ISchedulingRule rule) { - return rule == this; - } - } + public boolean isConflicting(ISchedulingRule rule) { + return rule == this; + } + + public boolean contains(ISchedulingRule rule) { + return rule == this; + } + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java index a4510e4a9..ad40e1e4b 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskSearchPage.java @@ -48,7 +48,7 @@ import org.eclipse.ui.forms.widgets.Hyperlink; * @author Mik Kersten */ public class TaskSearchPage extends DialogPage implements ISearchPage { - + public static final String ID = "org.eclipse.mylyn.tasks.ui.search.page"; private static final String PAGE_KEY = "page"; @@ -209,7 +209,7 @@ public class TaskSearchPage extends DialogPage implements ISearchPage { public void setVisible(boolean visible) { if (firstView) { getControl().setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true)); - + List<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories(); List<TaskRepository> searchableRepositories = new ArrayList<TaskRepository>(); for (TaskRepository repository : repositories) { @@ -305,8 +305,7 @@ public class TaskSearchPage extends DialogPage implements ISearchPage { @Override public void createControl(Composite parent) { Hyperlink hyperlink = new Hyperlink(parent, SWT.NONE); - hyperlink - .setText("ERROR: Unable to present query page, ensure repository configuration is valid and retry"); + hyperlink.setText("ERROR: Unable to present query page, ensure repository configuration is valid and retry"); hyperlink.setUnderlined(true); hyperlink.addHyperlinkListener(new HyperlinkAdapter() { @Override diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskStatusMenuContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskStatusMenuContributor.java index 303b043f8..718968a64 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskStatusMenuContributor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskStatusMenuContributor.java @@ -33,10 +33,10 @@ public class TaskStatusMenuContributor implements IDynamicSubMenuContributor { AbstractTask singleTask = null; if (selectedElements.size() == 1) { if (selectedElements.get(0) instanceof AbstractTask) { - singleTask = (AbstractTask)selectedElements.get(0); + singleTask = (AbstractTask) selectedElements.get(0); } } - + Action action = new MarkTaskCompleteAction(selectedElements); if (singleTask != null && singleTask.isCompleted()) { action.setEnabled(false); @@ -46,8 +46,8 @@ public class TaskStatusMenuContributor implements IDynamicSubMenuContributor { subMenuManager.add(action); if (singleTask != null && !singleTask.isCompleted()) { action.setEnabled(false); - } - + } + subMenuManager.add(new Separator()); action = new MarkTaskReadAction(selectedElements); subMenuManager.add(action); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTransfer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTransfer.java index a6adbf7dc..16cf9d3e7 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTransfer.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTransfer.java @@ -24,87 +24,86 @@ import org.eclipse.swt.dnd.TransferData; */ public class TaskTransfer extends ByteArrayTransfer { - private static final TaskTransfer INSTANCE = new TaskTransfer(); + private static final TaskTransfer INSTANCE = new TaskTransfer(); - private static final String TYPE_NAME = "task-transfer-format:" + System.currentTimeMillis() + ":" + INSTANCE.hashCode(); + private static final String TYPE_NAME = "task-transfer-format:" + System.currentTimeMillis() + ":" + + INSTANCE.hashCode(); - private static final int TYPEID = registerType(TYPE_NAME); + private static final int TYPEID = registerType(TYPE_NAME); - private TaskTransfer() { - } + private TaskTransfer() { + } - public static TaskTransfer getInstance() { - return INSTANCE; - } + public static TaskTransfer getInstance() { + return INSTANCE; + } - @Override + @Override protected int[] getTypeIds() { - return new int[] { TYPEID }; - } + return new int[] { TYPEID }; + } - @Override + @Override protected String[] getTypeNames() { - return new String[] { TYPE_NAME }; - } + return new String[] { TYPE_NAME }; + } - @Override + @Override protected void javaToNative(Object data, TransferData transferData) { - if (!(data instanceof AbstractTask[])) { - return; - } - - AbstractTask[] tasks = (AbstractTask[]) data; - int resourceCount = tasks.length; - - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - DataOutputStream dataOut = new DataOutputStream(out); - - //write the number of resources - dataOut.writeInt(resourceCount); - - //write each resource - for (int i = 0; i < tasks.length; i++) { - writeResource(dataOut, tasks[i]); - } - - //cleanup - dataOut.close(); - out.close(); - byte[] bytes = out.toByteArray(); - super.javaToNative(bytes, transferData); - } catch (IOException e) { - //it's best to send nothing if there were problems - } - } - - @Override + if (!(data instanceof AbstractTask[])) { + return; + } + + AbstractTask[] tasks = (AbstractTask[]) data; + int resourceCount = tasks.length; + + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + DataOutputStream dataOut = new DataOutputStream(out); + + //write the number of resources + dataOut.writeInt(resourceCount); + + //write each resource + for (int i = 0; i < tasks.length; i++) { + writeResource(dataOut, tasks[i]); + } + + //cleanup + dataOut.close(); + out.close(); + byte[] bytes = out.toByteArray(); + super.javaToNative(bytes, transferData); + } catch (IOException e) { + //it's best to send nothing if there were problems + } + } + + @Override protected Object nativeToJava(TransferData transferData) { - byte[] bytes = (byte[]) super.nativeToJava(transferData); - if (bytes == null) { + byte[] bytes = (byte[]) super.nativeToJava(transferData); + if (bytes == null) { + return null; + } + DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); + try { + int count = in.readInt(); + AbstractTask[] results = new AbstractTask[count]; + for (int i = 0; i < count; i++) { + results[i] = readTask(in); + } + return results; + } catch (IOException e) { return null; } - DataInputStream in = new DataInputStream( - new ByteArrayInputStream(bytes)); - try { - int count = in.readInt(); - AbstractTask[] results = new AbstractTask[count]; - for (int i = 0; i < count; i++) { - results[i] = readTask(in); - } - return results; - } catch (IOException e) { - return null; - } - } - - private AbstractTask readTask(DataInputStream dataIn) throws IOException { - String handle = dataIn.readUTF(); - return TasksUiPlugin.getTaskListManager().getTaskList().getTask(handle); - } - - private void writeResource(DataOutputStream dataOut, AbstractTask task) - throws IOException { - dataOut.writeUTF(task.getHandleIdentifier()); - } + } + + private AbstractTask readTask(DataInputStream dataIn) throws IOException { + String handle = dataIn.readUTF(); + return TasksUiPlugin.getTaskListManager().getTaskList().getTask(handle); + } + + private void writeResource(DataOutputStream dataOut, AbstractTask task) throws IOException { + dataOut.writeUTF(task.getHandleIdentifier()); + } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java index 98c19898d..94c018948 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java @@ -140,7 +140,8 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution { GridData gridData = new GridData(SWT.NONE, SWT.CENTER, false, false); composite.setLayoutData(gridData); - navigateAction = new ActivateTaskHistoryDropDownAction(TasksUiPlugin.getTaskListManager().getTaskActivationHistory(), false); + navigateAction = new ActivateTaskHistoryDropDownAction(TasksUiPlugin.getTaskListManager() + .getTaskActivationHistory(), false); ToolBarManager manager = new ToolBarManager(SWT.FLAT); manager.add(navigateAction); @@ -196,8 +197,7 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution { if (TaskListView.getFromActivePerspective().getDrilledIntoCategory() != null) { TaskListView.getFromActivePerspective().goUpToRoot(); } - TasksUiUtil.refreshAndOpenTaskListElement((TasksUiPlugin.getTaskListManager().getTaskList() - .getActiveTask())); + TasksUiUtil.refreshAndOpenTaskListElement((TasksUiPlugin.getTaskListManager().getTaskList().getActiveTask())); } }); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java index 33c90ee9c..f90e8db72 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskWorkingSetFilter.java @@ -20,17 +20,16 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; import org.eclipse.ui.IWorkingSet; /** - * AbstractTaskListFilter for task working sets + * AbstractTaskListFilter for task working sets * * @author Eugene Kuleshov */ public class TaskWorkingSetFilter extends AbstractTaskListFilter { - + private final TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); private IWorkingSet currentWorkingSet; - @Override public boolean select(Object parent, Object element) { if (parent instanceof AbstractTaskContainer && !(parent instanceof ScheduledTaskContainer)) { @@ -65,5 +64,5 @@ public class TaskWorkingSetFilter extends AbstractTaskListFilter { public void setCurrentWorkingSet(IWorkingSet currentWorkingSet) { this.currentWorkingSet = currentWorkingSet; } - + }
\ No newline at end of file diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java index cadf93bb1..d6ee29442 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java @@ -65,22 +65,20 @@ public class TasksUiImages { public static final ImageDescriptor TASK_NEW = create(T_TOOL, "task-new.gif"); - public static final ImageDescriptor TASK_REPOSITORY_HISTORY = create(T_TOOL, - "task-repository-history.gif"); + public static final ImageDescriptor TASK_REPOSITORY_HISTORY = create(T_TOOL, "task-repository-history.gif"); public static final ImageDescriptor TASK_REPOSITORY_NOTES = create(T_TOOL, "task-repository-notes.gif"); - public static final ImageDescriptor TASK_REPOSITORY_COMPLETED = create(T_TOOL, - "task-repository-completed.gif"); + public static final ImageDescriptor TASK_REPOSITORY_COMPLETED = create(T_TOOL, "task-repository-completed.gif"); public static final ImageDescriptor TASK_REMOTE = create(T_TOOL, "task-remote.gif"); - + public static final ImageDescriptor TASK_WORKING_SET = create(T_TOOL, "open-task.gif"); public static final ImageDescriptor TASKLIST = create("eview16", "task-list.gif"); public static final ImageDescriptor REPOSITORY = create("eview16", "repository.gif"); - + public static final ImageDescriptor REPOSITORY_SUBMIT = create(T_TOOL, "repository-submit.gif"); public static final ImageDescriptor REPOSITORY_SMALL = create(T_OBJ, "repository-small.gif"); @@ -92,7 +90,7 @@ public class TasksUiImages { public static final ImageDescriptor REMOVE = create(T_ELCL, "remove.gif"); public static final ImageDescriptor DELETE = create(T_ELCL, "delete.gif"); - + public static final ImageDescriptor FILTER_COMPLETE = create(T_ELCL, "filter-complete.gif"); public static final ImageDescriptor FILTER_ARCHIVE = create(T_ELCL, "filter-archive.gif"); @@ -104,9 +102,9 @@ public class TasksUiImages { public static final ImageDescriptor FILTER = create(T_TOOL, "view-filter.gif"); public static final ImageDescriptor FIND_CLEAR = create(T_TOOL, "find-clear.gif"); - + public static final ImageDescriptor FIND_CLEAR_DISABLED = create(T_TOOL, "find-clear-disabled.gif"); - + public static final ImageDescriptor WARNING = create(T_ELCL, "warning.gif"); public static final ImageDescriptor OVERLAY_WEB = create(T_TOOL, "overlay-web.gif"); @@ -116,7 +114,7 @@ public class TasksUiImages { public static final ImageDescriptor BROWSER_SMALL = create(T_OBJ, "browser-small.gif"); public static final ImageDescriptor BROWSER_OPEN_TASK = create(T_TOOL, "open-browser.gif"); - + public static final ImageDescriptor OVERLAY_SYNCHRONIZING = create(T_EVIEW, "overlay-synchronizing.gif"); public static final ImageDescriptor OVERLAY_HAS_DUE = create(T_EVIEW, "overlay-has-due.gif"); @@ -138,33 +136,33 @@ public class TasksUiImages { public static final ImageDescriptor TASK_REPOSITORY_NEW = create(T_TOOL, "task-repository-new.gif"); public static final ImageDescriptor TOOLBAR_ARROW_RIGHT = create(T_TOOL, "toolbar-arrow-right.gif"); - + public static final ImageDescriptor TOOLBAR_ARROW_DOWN = create(T_TOOL, "toolbar-arrow-down.gif"); - + public static final ImageDescriptor COMMENT = create(T_TOOL, "comment.gif"); public static final ImageDescriptor LINK_EDITOR = create(T_TOOL, "link-editor.gif"); - + public static final ImageDescriptor PERSON = create(T_TOOL, "person.gif"); public static final ImageDescriptor PERSON_NARROW = create(T_TOOL, "person-narrow.gif"); - + public static final ImageDescriptor PERSON_ME = create(T_TOOL, "person-me.gif"); - + public static final ImageDescriptor PERSON_ME_NARROW = create(T_TOOL, "person-me-narrow.gif"); - + public static final ImageDescriptor CONTEXT_ATTACH = create(T_TOOL, "context-attach.gif"); public static final ImageDescriptor CONTEXT_RETRIEVE = create(T_TOOL, "context-retrieve.gif"); public static final ImageDescriptor CONTEXT_TRANSFER = create(T_TOOL, "context-transfer.gif"); - public static final ImageDescriptor CONTEXT_CLEAR = create(T_TOOL, "context-clear.gif"); - + public static final ImageDescriptor CONTEXT_CLEAR = create(T_TOOL, "context-clear.gif"); + public static final ImageDescriptor ATTACHMENT_PATCH = create(T_OBJ, "attachment-patch.gif"); public static final ImageDescriptor TASK_RETRIEVE = create(T_TOOL, "task-retrieve.gif"); - + public static final ImageDescriptor OVERLAY_INCOMMING = create(T_EVIEW, "overlay-incoming.gif"); public static final ImageDescriptor OVERLAY_INCOMMING_NEW = create(T_EVIEW, "overlay-incoming-new.gif"); @@ -176,7 +174,7 @@ public class TasksUiImages { public static final ImageDescriptor OVERLAY_SYNCH_INCOMMING_NEW = create(T_EVIEW, "overlay-synch-incoming-new.gif"); public static final ImageDescriptor OVERLAY_SYNCH_OUTGOING = create(T_EVIEW, "overlay-synch-outgoing.gif"); - + public static final ImageDescriptor OVERLAY_CONFLICT = create(T_EVIEW, "overlay-conflicting.gif"); public static final ImageDescriptor OVERLAY_REPOSITORY = create(T_EVIEW, "overlay-repository.gif"); @@ -186,7 +184,7 @@ public class TasksUiImages { public static final ImageDescriptor OVERLAY_WARNING = create(T_OVR, "overlay-warning.gif"); public static final ImageDescriptor OVERLAY_BLANK = create(T_OVR, "overlay-blank.gif"); - + public static final ImageDescriptor STATUS_NORMAL = create(T_EVIEW, "status-normal.gif"); public static final ImageDescriptor STATUS_CONTEXT = create(T_EVIEW, "status-server-context.gif"); @@ -238,7 +236,7 @@ public class TasksUiImages { public static final ImageDescriptor BANNER_REPOSITORY = create(T_WIZBAN, "banner-repository.gif"); public static final ImageDescriptor BANNER_WORKING_SET = create(T_WIZBAN, "workset_wiz.png"); - + public static final ImageDescriptor BANNER_REPOSITORY_SETTINGS = create(T_WIZBAN, "banner-repository-settings.gif"); public static final ImageDescriptor BANNER_REPOSITORY_CONTEXT = create(T_WIZBAN, "banner-repository-context.gif"); @@ -246,7 +244,7 @@ public class TasksUiImages { public static final ImageDescriptor BANNER_IMPORT = create(T_WIZBAN, "banner-import.gif"); public static final ImageDescriptor BLANK_TINY = create(T_ELCL, "clearDot.gif"); - + public static final ImageDescriptor BLANK = create(T_ELCL, "blank.gif"); private static ImageDescriptor create(String prefix, String name) { @@ -260,22 +258,21 @@ public class TasksUiImages { // private static ImageDescriptor createSize(ImageDescriptor base, Point size) { // return new TaskListImageDescriptor(base, size); // } - + /** * Lazily initializes image map. */ public static Image getImage(ImageDescriptor imageDescriptor) { ImageRegistry imageRegistry = getImageRegistry(); - Image image = imageRegistry.get(""+imageDescriptor.hashCode()); + Image image = imageRegistry.get("" + imageDescriptor.hashCode()); if (image == null) { image = imageDescriptor.createImage(true); - imageRegistry.put(""+imageDescriptor.hashCode(), image); + imageRegistry.put("" + imageDescriptor.hashCode(), image); } return image; } - - public static Image getImageWithOverlay(ImageDescriptor icon, ImageDescriptor overlay, boolean top, - boolean left) { + + public static Image getImageWithOverlay(ImageDescriptor icon, ImageDescriptor overlay, boolean top, boolean left) { if (icon == null) { return null; } @@ -285,7 +282,7 @@ public class TasksUiImages { } key += new Boolean(top).hashCode(); key += new Boolean(left).hashCode(); - + Image image = getImageRegistry().get(key); if (image == null) { @@ -295,13 +292,14 @@ public class TasksUiImages { } return image; } - + /** - * Lazily initializes image map. + * Lazily initializes image map. * - * @param icon cannot be null + * @param icon + * cannot be null */ - public static Image getCompositeTaskImage(ImageDescriptor icon, ImageDescriptor overlayKind, boolean wide) { + public static Image getCompositeTaskImage(ImageDescriptor icon, ImageDescriptor overlayKind, boolean wide) { if (icon == null) { return null; } @@ -332,19 +330,20 @@ public class TasksUiImages { } Image image = getImageRegistry().get(key); if (image == null) { - CompositeContainerImageDescriptor imageDescriptor = new CompositeContainerImageDescriptor(icon, OVERLAY_BLANK, wide); + CompositeContainerImageDescriptor imageDescriptor = new CompositeContainerImageDescriptor(icon, + OVERLAY_BLANK, wide); image = imageDescriptor.createImage(true); getImageRegistry().put(key, image); } return image; } - + public static Image getCompositeSynchImage(ImageDescriptor icon, boolean background) { String key = "" + icon.hashCode(); if (background) { key += ".background"; } - + Image image = getImageRegistry().get(key); if (image == null) { CompositeSynchImageDescriptor imageDescriptor = new CompositeSynchImageDescriptor(icon, background); @@ -353,7 +352,7 @@ public class TasksUiImages { } return image; } - + private static ImageRegistry getImageRegistry() { if (imageRegistry == null) { imageRegistry = new ImageRegistry(); @@ -389,7 +388,7 @@ public class TasksUiImages { return progressImages; } - + public static Image getImageForPriority(PriorityLevel priorityLevel) { if (priorityLevel == null) { return null; @@ -421,5 +420,5 @@ public class TasksUiImages { return null; } } - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPreferenceConstants.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPreferenceConstants.java index 314290f46..9e9b507dd 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPreferenceConstants.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPreferenceConstants.java @@ -15,7 +15,7 @@ package org.eclipse.mylyn.internal.tasks.ui; * @author Mik Kersten */ public final class TasksUiPreferenceConstants { - + public static final String ACTIVATE_MULTIPLE = "org.eclipse.mylyn.tasks.ui.activation.multipe"; public static final String ACTIVATE_WHEN_OPENED = "org.eclipse.mylyn.tasks.ui.activate.when.opened"; @@ -43,15 +43,15 @@ public final class TasksUiPreferenceConstants { public static final String PLANNING_STARTHOUR = "org.eclipse.mylyn.tasks.ui.planning.start.hour"; public static final String EDITOR_TASKS_RICH = "org.eclipse.mylyn.tasks.ui.reporting.open.editor"; - + // public static final String REPORTING_OPEN_EXTERNAL = "org.eclipse.mylyn.tasks.ui.reporting.open.external"; // // public static final String REPORTING_OPEN_INTERNAL = "org.eclipse.mylyn.tasks.ui.reporting.open.internal"; // public static final String REPORTING_DISABLE_INTERNAL = "org.eclipse.mylyn.tasks.ui.reporting.disable.internal"; - + public static final String REPOSITORY_SYNCH_SCHEDULE_ENABLED = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule"; - + public static final String REPOSITORY_SYNCH_SCHEDULE_MILISECONDS = "org.eclipse.mylyn.tasks.ui.repositories.synch.schedule.miliseconds"; } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java index c91172d28..2a5ed193a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AbstractChangeCompletionAction.java @@ -25,14 +25,14 @@ public class AbstractChangeCompletionAction extends Action { if (!(abstractTaskContainer instanceof AbstractTask)) { allLocalTasks = false; break; - } else if (!((AbstractTask)abstractTaskContainer).isLocal()) { + } else if (!((AbstractTask) abstractTaskContainer).isLocal()) { allLocalTasks = false; break; } } return allLocalTasks; } - + protected String generateMessage(List<AbstractTask> toComplete, String status) { String message = "Mark selected local tasks " + status + "?\n\n"; int i = 0; @@ -41,7 +41,7 @@ public class AbstractChangeCompletionAction extends Action { if (i < 20) { message += " "; if (task.getTaskKey() != null) { - message += task.getTaskKey() + ": "; + message += task.getTaskKey() + ": "; } message += task.getSummary() + "\n"; } else { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ActivateTaskHistoryDropDownAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ActivateTaskHistoryDropDownAction.java index e3b42eb49..12e6b73cf 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ActivateTaskHistoryDropDownAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ActivateTaskHistoryDropDownAction.java @@ -39,18 +39,19 @@ import org.eclipse.ui.PlatformUI; * @author Mik Kersten * @author Leo Dos Santos */ -public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownAction implements IWorkbenchWindowPulldownDelegate, ITaskActivityListener { +public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownAction implements + IWorkbenchWindowPulldownDelegate, ITaskActivityListener { public static final String ID = "org.eclipse.mylyn.tasklist.actions.navigate.previous"; private boolean scopeToWorkingSet = false; private static final String LABEL = "Activate Previous Task"; - + public ActivateTaskHistoryDropDownAction() { this(TasksUiPlugin.getTaskListManager().getTaskActivationHistory(), false); } - + public ActivateTaskHistoryDropDownAction(TaskActivationHistory history, boolean scopeToWorkingSet) { super(history); setText(LABEL); @@ -67,7 +68,7 @@ public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownActio super.dispose(); TasksUiPlugin.getTaskListManager().addActivityListener(this); } - + @Override protected void addActionsToMenu() { List<AbstractTask> tasks = new ArrayList<AbstractTask>(taskHistory.getPreviousTasks()); @@ -119,7 +120,7 @@ public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownActio item.fill(dropDownMenu, -1); } } - + @Override public void run() { if (taskHistory.hasPrevious()) { @@ -181,7 +182,7 @@ public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownActio public void taskDeactivated(AbstractTask task) { // TODO: update label } - + public void init(IWorkbenchWindow window) { } @@ -197,7 +198,7 @@ public class ActivateTaskHistoryDropDownAction extends TaskNavigateDropDownActio public void calendarChanged() { } - + public void taskListRead() { } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryTaskAction.java index a4b235de7..448eecc03 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryTaskAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AddRepositoryTaskAction.java @@ -30,7 +30,7 @@ import org.eclipse.ui.PlatformUI; public class AddRepositoryTaskAction extends Action implements IViewActionDelegate { private static final String WIZARD_LABEL = "Add an existing repository task/issue"; - + public void run(IAction action) { try { AddExistingTaskWizard wizard = new AddExistingTaskWizard(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java index 8bc42bbf5..79577a232 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/AttachFileAction.java @@ -43,7 +43,8 @@ public class AttachFileAction extends BaseSelectionListenerAction { NewAttachmentWizard attachmentWizard = new NewAttachmentWizard(repository, repositoryTask); NewAttachmentWizardDialog dialog = new NewAttachmentWizardDialog(PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell(), attachmentWizard); + .getActiveWorkbenchWindow() + .getShell(), attachmentWizard); attachmentWizard.setDialog(dialog); dialog.create(); int result = dialog.open(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java index 69b219e76..dcac6c6df 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ClearOutgoingAction.java @@ -52,8 +52,8 @@ public class ClearOutgoingAction extends Action { ArrayList<AbstractTask> toClear = new ArrayList<AbstractTask>(); for (Object selectedObject : selectedElements) { if (selectedObject instanceof AbstractTask - && ((AbstractTask) selectedObject).getSynchronizationState() - .equals(RepositoryTaskSyncState.OUTGOING)) { + && ((AbstractTask) selectedObject).getSynchronizationState().equals( + RepositoryTaskSyncState.OUTGOING)) { toClear.add(((AbstractTask) selectedObject)); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java index 71213a179..ae28858e9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CopyAttachmentToClipboardJob.java @@ -40,7 +40,7 @@ public class CopyAttachmentToClipboardJob extends Job { if (attachment == null) { throw new IllegalArgumentException("attachment may not be null"); } - + this.attachment = attachment; } @@ -63,11 +63,11 @@ public class CopyAttachmentToClipboardJob extends Job { StatusHandler.displayStatus("Copy Attachment to Clipboard", e.getStatus()); return Status.OK_STATUS; } - + String contents = new String(out.toByteArray()); contents = contents.replaceAll("\r\n|\n", System.getProperty("line.separator")); copyToClipboard(contents); - + return Status.OK_STATUS; } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java index fe8b2b87f..adf74041a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteAction.java @@ -64,7 +64,8 @@ public class DeleteAction extends Action { break; } } - boolean deleteConfirmed = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow() + boolean deleteConfirmed = MessageDialog.openQuestion(PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() .getShell(), "Confirm Delete", message); if (!deleteConfirmed) { return; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction.java index 4a279b8e9..a4b70087c 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DeleteTaskRepositoryAction.java @@ -43,17 +43,17 @@ public class DeleteTaskRepositoryAction extends AbstractTaskRepositoryAction { public void init(IViewPart view) { // ignore } - + @Override public void run() { try { - boolean deleteConfirmed = MessageDialog.openQuestion(PlatformUI.getWorkbench().getActiveWorkbenchWindow() + boolean deleteConfirmed = MessageDialog.openQuestion(PlatformUI.getWorkbench() + .getActiveWorkbenchWindow() .getShell(), "Confirm Delete", "Delete the selected task repositories?"); if (deleteConfirmed) { IStructuredSelection selection = getStructuredSelection(); - Set<AbstractRepositoryQuery> queries = TasksUiPlugin.getTaskListManager().getTaskList() - .getQueries(); + Set<AbstractRepositoryQuery> queries = TasksUiPlugin.getTaskListManager().getTaskList().getQueries(); List<TaskRepository> repositoriesInUse = new ArrayList<TaskRepository>(); List<TaskRepository> repositoriesToDelete = new ArrayList<TaskRepository>(); for (Object selectedObject : selection.toList()) { @@ -74,14 +74,14 @@ public class DeleteTaskRepositoryAction extends AbstractTaskRepositoryAction { } for (TaskRepository taskRepository : repositoriesToDelete) { - TasksUiPlugin.getRepositoryManager().removeRepository(taskRepository, TasksUiPlugin.getDefault().getRepositoriesFilePath()); + TasksUiPlugin.getRepositoryManager().removeRepository(taskRepository, + TasksUiPlugin.getDefault().getRepositoriesFilePath()); } if (repositoriesInUse.size() > 0) { - MessageDialog - .openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - "Repository In Use", - "One or more of the selected repositories is being used by a query and can not be deleted."); + MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), + "Repository In Use", + "One or more of the selected repositories is being used by a query and can not be deleted."); } } } catch (Exception e) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java index 1ca78f312..1e35ecde6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/DownloadAttachmentJob.java @@ -56,8 +56,8 @@ public class DownloadAttachmentJob extends Job { this.attachment.getRepositoryKind()); AbstractAttachmentHandler handler = connector.getAttachmentHandler(); if (handler == null) { - return new RepositoryStatus(repository, IStatus.INFO, TasksUiPlugin.ID_PLUGIN, RepositoryStatus.ERROR_INTERNAL, - "The repository does not support attachments."); + return new RepositoryStatus(repository, IStatus.INFO, TasksUiPlugin.ID_PLUGIN, + RepositoryStatus.ERROR_INTERNAL, "The repository does not support attachments."); } FileOutputStream out = null; @@ -68,8 +68,8 @@ public class DownloadAttachmentJob extends Job { StatusHandler.displayStatus("Download Attachment", e.getStatus()); return Status.OK_STATUS; } catch (IOException e) { - return new RepositoryStatus(repository, IStatus.WARNING, TasksUiPlugin.ID_PLUGIN, RepositoryStatus.ERROR_IO, - "Error while writing to attachment file.", e); + return new RepositoryStatus(repository, IStatus.WARNING, TasksUiPlugin.ID_PLUGIN, + RepositoryStatus.ERROR_IO, "Error while writing to attachment file.", e); } finally { if (out != null) { try { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/EditRepositoryPropertiesAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/EditRepositoryPropertiesAction.java index e0cc7aa0c..32687aed7 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/EditRepositoryPropertiesAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/EditRepositoryPropertiesAction.java @@ -32,12 +32,13 @@ public class EditRepositoryPropertiesAction extends AbstractTaskRepositoryAction @Override protected boolean updateSelection(IStructuredSelection selection) { - if(selection != null && !selection.isEmpty()){ + if (selection != null && !selection.isEmpty()) { Object selectedObject = selection.getFirstElement(); - if(selectedObject instanceof TaskRepository){ + if (selectedObject instanceof TaskRepository) { TaskRepository taskRepository = (TaskRepository) selectedObject; - AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(taskRepository.getConnectorKind()); - if(connector.isUserManaged()){ + AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector( + taskRepository.getConnectorKind()); + if (connector.isUserManaged()) { return true; } return false; @@ -45,7 +46,7 @@ public class EditRepositoryPropertiesAction extends AbstractTaskRepositoryAction } return false; } - + @Override public void run() { IStructuredSelection selection = getStructuredSelection(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterArchiveContainerAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterArchiveContainerAction.java index 422e6f708..d3eaf2852 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterArchiveContainerAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterArchiveContainerAction.java @@ -18,28 +18,30 @@ import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView; import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; /** - * @author Mik Kersten + * @author Mik Kersten */ public class FilterArchiveContainerAction extends Action { public static final String ID = "org.eclipse.mylyn.tasklist.actions.filter.archive"; private static final String LABEL = "Filter Archive Category"; - + private final TaskListView view; public FilterArchiveContainerAction(TaskListView view) { this.view = view; setText(LABEL); setToolTipText(LABEL); - setId(ID); + setId(ID); setImageDescriptor(TasksUiImages.FILTER_ARCHIVE); - setChecked(TasksUiPlugin.getDefault().getPreferenceStore().contains(TasksUiPreferenceConstants.FILTER_ARCHIVE_MODE)); + setChecked(TasksUiPlugin.getDefault().getPreferenceStore().contains( + TasksUiPreferenceConstants.FILTER_ARCHIVE_MODE)); } @Override public void run() { - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.FILTER_ARCHIVE_MODE, isChecked()); + TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.FILTER_ARCHIVE_MODE, + isChecked()); if (isChecked()) { view.addFilter(view.getArchiveFilter()); } else { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterCompletedTasksAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterCompletedTasksAction.java index 9a971a981..9a6162c83 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterCompletedTasksAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterCompletedTasksAction.java @@ -23,7 +23,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; public class FilterCompletedTasksAction extends Action { public static final String ID = "org.eclipse.mylyn.tasklist.actions.filter.completed"; - + private static final String LABEL = "Filter Completed Tasks"; private final TaskListView view; @@ -34,12 +34,14 @@ public class FilterCompletedTasksAction extends Action { setToolTipText(LABEL); setId(ID); setImageDescriptor(TasksUiImages.FILTER_COMPLETE); - setChecked(TasksUiPlugin.getDefault().getPreferenceStore().contains(TasksUiPreferenceConstants.FILTER_COMPLETE_MODE)); + setChecked(TasksUiPlugin.getDefault().getPreferenceStore().contains( + TasksUiPreferenceConstants.FILTER_COMPLETE_MODE)); } @Override public void run() { - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.FILTER_COMPLETE_MODE, isChecked()); + TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.FILTER_COMPLETE_MODE, + isChecked()); if (isChecked()) { view.addFilter(view.getCompleteFilter()); } else { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterSubTasksAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterSubTasksAction.java index 3433e12cb..20618ff97 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterSubTasksAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/FilterSubTasksAction.java @@ -47,7 +47,7 @@ public class FilterSubTasksAction extends Action { view.getViewer().collapseAll(); if (view.isFocusedMode()) { view.getViewer().expandAll(); - } + } view.getViewer().refresh(); } finally { view.getViewer().getControl().setRedraw(true); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/GoIntoAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/GoIntoAction.java index 5210edf3d..9b801bae6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/GoIntoAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/GoIntoAction.java @@ -25,6 +25,7 @@ import org.eclipse.ui.IViewPart; public class GoIntoAction extends Action implements IViewActionDelegate { private static final String LABEL = "Go Into"; + public static final String ID = "org.eclipse.mylyn.tasklist.actions.view.go.into"; // diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ManageEditorsAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ManageEditorsAction.java index aad00e419..fed07e3cd 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ManageEditorsAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ManageEditorsAction.java @@ -11,14 +11,12 @@ package org.eclipse.mylyn.internal.tasks.ui.actions; - /** * @author Mik Kersten */ //public class ManageEditorsAction extends Action { // // public static final String ID = "org.eclipse.mylyn.ui.editors.auto.manage"; - // public ManageEditorsAction() { // super("Manage Editors with Context", IAction.AS_CHECK_BOX); // setId(ID); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewCategoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewCategoryAction.java index dd277c98f..2f1df3e18 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewCategoryAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewCategoryAction.java @@ -40,14 +40,14 @@ public class NewCategoryAction extends Action implements IViewActionDelegate { setId(ID); setImageDescriptor(TasksUiImages.CATEGORY_NEW); } - + public void init(IViewPart view) { } - + public void run(IAction action) { run(); } - + @Override public void run() { InputDialog dialog = new InputDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java index 5c744284c..75790f2c6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/NewTaskAction.java @@ -38,7 +38,7 @@ public class NewTaskAction extends Action implements IViewActionDelegate { @Override public void run() { - + IWizard wizard; List<TaskRepository> repositories = TasksUiPlugin.getRepositoryManager().getAllRepositories(); if (repositories.size() == 1) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenRepositoryTask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenRepositoryTask.java index 63b67d5ac..06ff161c4 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenRepositoryTask.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenRepositoryTask.java @@ -34,7 +34,8 @@ public class OpenRepositoryTask extends Action implements IWorkbenchWindowAction public void run(IAction action) { RemoteTaskSelectionDialog dlg = new RemoteTaskSelectionDialog(PlatformUI.getWorkbench() - .getActiveWorkbenchWindow().getShell()); + .getActiveWorkbenchWindow() + .getShell()); dlg.setTitle("Open Repository Task"); IDialogSettings settings = TasksUiPlugin.getDefault().getDialogSettings(); @@ -72,8 +73,8 @@ public class OpenRepositoryTask extends Action implements IWorkbenchWindowAction if (dlg.shouldAddToTaskList()) { for (String id : selectedIds) { final IProgressService svc = PlatformUI.getWorkbench().getProgressService(); - final AddExistingTaskJob job = new AddExistingTaskJob(dlg.getSelectedTaskRepository(), id, dlg - .getSelectedCategory()); + final AddExistingTaskJob job = new AddExistingTaskJob(dlg.getSelectedTaskRepository(), id, + dlg.getSelectedCategory()); job.schedule(); PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @@ -92,9 +93,8 @@ public class OpenRepositoryTask extends Action implements IWorkbenchWindowAction } } if (!openSuccessful) { - MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), - ITasksUiConstants.TITLE_DIALOG, - "Could not find matching repository task."); + MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), + ITasksUiConstants.TITLE_DIALOG, "Could not find matching repository task."); } } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTasksUiPreferencesAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTasksUiPreferencesAction.java index be4adf2b9..a3962864a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTasksUiPreferencesAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenTasksUiPreferencesAction.java @@ -18,7 +18,7 @@ import org.eclipse.mylyn.tasks.ui.TasksUiUtil; public class OpenTasksUiPreferencesAction extends Action { public static final String ID = "org.eclipse.mylyn.tasks.ui.actions.preferences.open"; - + private static final String LABEL = "Preferences..."; public OpenTasksUiPreferencesAction() { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java index 70ca1d18b..a0f541403 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/OpenWithBrowserAction.java @@ -47,7 +47,7 @@ public class OpenWithBrowserAction extends BaseSelectionListenerAction { private void runWithSelection(Object selectedObject) { String urlString = null; if (selectedObject instanceof AbstractTask) { - AbstractTask task = (AbstractTask)selectedObject; + AbstractTask task = (AbstractTask) selectedObject; if (task.hasValidUrl()) { urlString = task.getUrl(); } @@ -55,7 +55,7 @@ public class OpenWithBrowserAction extends BaseSelectionListenerAction { AbstractTaskContainer query = (AbstractTaskContainer) selectedObject; urlString = query.getUrl(); } - + if (urlString != null) { TasksUiUtil.openUrl(urlString, false); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RemoveFromCategoryAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RemoveFromCategoryAction.java index 0e9e85d6a..c91bcb653 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RemoveFromCategoryAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RemoveFromCategoryAction.java @@ -58,8 +58,9 @@ public class RemoveFromCategoryAction extends Action { if (item.getParentItem() != null && item.getParentItem().getData() instanceof TaskCategory) { TaskCategory category = (TaskCategory) item.getParentItem().getData(); TasksUiPlugin.getTaskListManager().getTaskList().removeFromCategory(category, task); - } - TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); + } + TasksUiPlugin.getTaskListManager().getTaskList().moveToContainer(task, + TasksUiPlugin.getTaskListManager().getTaskList().getDefaultCategory()); // just in case, should already be there // MylarTaskListPlugin.getTaskListManager().getTaskList().addTaskToArchive(task); // ITaskContainer cat = task.getCategory(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java index 5d11321d3..7260c606a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ReportBugAction.java @@ -15,7 +15,7 @@ import org.eclipse.ui.IWorkbenchWindowActionDelegate; * @author Mik Kersten */ public class ReportBugAction extends NewTaskAction implements IWorkbenchWindowActionDelegate { - + public void dispose() { } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowInTaskListAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowInTaskListAction.java index a7a24e075..7c58c1bfa 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowInTaskListAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ShowInTaskListAction.java @@ -14,7 +14,7 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; import org.eclipse.ui.actions.BaseSelectionListenerAction; /** - * @author Willian Mitsuda + * @author Willian Mitsuda */ public class ShowInTaskListAction extends BaseSelectionListenerAction { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeAutomaticallyAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeAutomaticallyAction.java index 511ea155a..4e18ba5a3 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeAutomaticallyAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeAutomaticallyAction.java @@ -18,19 +18,20 @@ import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; public class SynchronizeAutomaticallyAction extends Action { public static final String ID = "org.eclipse.mylyn.tasks.ui.actions.synchronize.background"; - + private static final String LABEL = "Synchronize Automatically"; public SynchronizeAutomaticallyAction() { setText(LABEL); setToolTipText(LABEL); setId(ID); - setChecked(TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED)); + setChecked(TasksUiPlugin.getDefault().getPreferenceStore().getBoolean( + TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED)); } @Override public void run() { - TasksUiPlugin.getDefault().getPreferenceStore().setValue(TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, - isChecked()); + TasksUiPlugin.getDefault().getPreferenceStore().setValue( + TasksUiPreferenceConstants.REPOSITORY_SYNCH_SCHEDULE_ENABLED, isChecked()); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java index ed1ebbafb..40dd811ca 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/SynchronizeSelectedAction.java @@ -83,26 +83,27 @@ public class SynchronizeSelectedAction extends ActionDelegate implements IViewAc RepositorySynchronizationManager syncManager = TasksUiPlugin.getSynchronizationManager(); if (!queriesToSyncMap.isEmpty()) { - + // determine which repositories to synch changed tasks for HashMap<TaskRepository, Set<AbstractRepositoryQuery>> repositoriesToSync = new HashMap<TaskRepository, Set<AbstractRepositoryQuery>>(); for (AbstractRepositoryConnector connector : queriesToSyncMap.keySet()) { List<AbstractRepositoryQuery> queriesToSync = queriesToSyncMap.get(connector); - if(queriesToSync==null || queriesToSync.isEmpty()) { + if (queriesToSync == null || queriesToSync.isEmpty()) { continue; } - + for (AbstractRepositoryQuery query : queriesToSync) { - TaskRepository repos = TasksUiPlugin.getRepositoryManager().getRepository(query.getRepositoryKind(), query.getRepositoryUrl()); + TaskRepository repos = TasksUiPlugin.getRepositoryManager().getRepository( + query.getRepositoryKind(), query.getRepositoryUrl()); Set<AbstractRepositoryQuery> queries = repositoriesToSync.get(repos); - if(queries == null) { + if (queries == null) { queries = new HashSet<AbstractRepositoryQuery>(); repositoriesToSync.put(repos, queries); } queries.add(query); } } - + for (Map.Entry<TaskRepository, Set<AbstractRepositoryQuery>> entry : repositoriesToSync.entrySet()) { TaskRepository repository = entry.getKey(); AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() @@ -124,9 +125,9 @@ public class SynchronizeSelectedAction extends ActionDelegate implements IViewAc queriesToSyncMap.clear(); tasksToSyncMap.clear(); - + // TasksUiPlugin.getTaskListManager().getTaskList().notifyContainerUpdated(null); - + // if (TaskListView.getFromActivePerspective() != null) { // TaskListView.getFromActivePerspective().getViewer().refresh(); // } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListElementPropertiesAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListElementPropertiesAction.java index 3e196da3f..eccb52df3 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListElementPropertiesAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskListElementPropertiesAction.java @@ -42,7 +42,7 @@ public class TaskListElementPropertiesAction extends Action { ISelection selection = viewer.getSelection(); Object element = ((IStructuredSelection) selection).getFirstElement(); if (element instanceof TaskCategory || element instanceof AbstractRepositoryQuery) { - TasksUiUtil.refreshAndOpenTaskListElement((AbstractTaskContainer)element); + TasksUiUtil.refreshAndOpenTaskListElement((AbstractTaskContainer) element); } } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java index 86974f641..c15df855a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskSelectionDialog.java @@ -57,8 +57,7 @@ import org.eclipse.ui.dialogs.SelectionStatusDialog; public class TaskSelectionDialog extends SelectionStatusDialog { /** - * Implements a {@link ViewFilter} based on content typed in the filter - * field + * Implements a {@link ViewFilter} based on content typed in the filter field */ private static class TaskFilter extends ViewerFilter { @@ -84,13 +83,12 @@ public class TaskSelectionDialog extends SelectionStatusDialog { } if (element instanceof AbstractTask) { AbstractTask repositoryTask = (AbstractTask) element; - String taskString = repositoryTask.getTaskKey() + ": " - + repositoryTask.getSummary(); + String taskString = repositoryTask.getTaskKey() + ": " + repositoryTask.getSummary(); return pattern.matcher(taskString).find(); } else if (element instanceof AbstractTask) { String taskString = ((AbstractTask) element).getSummary(); return pattern.matcher(taskString).find(); - } + } return false; } } @@ -163,7 +161,8 @@ public class TaskSelectionDialog extends SelectionStatusDialog { // Compute the task navigation history (in recent-to-older order) final List<AbstractTask> taskHistory = new ArrayList<AbstractTask>(TasksUiPlugin.getTaskListManager() - .getTaskActivationHistory().getPreviousTasks()); + .getTaskActivationHistory() + .getPreviousTasks()); Collections.reverse(taskHistory); // Compute the task set who will be presented on dialog; the trick to diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java index 3fb2f9937..9ba305f8d 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java @@ -61,7 +61,7 @@ import org.eclipse.ui.internal.dialogs.WorkingSetLabelProvider; public class TaskWorkingSetAction extends Action implements IMenuCreator { public static final String LABEL_SETS_NONE = "All"; - + public static String ID_TASK_WORKING_SET = "org.eclipse.mylyn.tasks.ui.workingSet"; public static String TASK_WORKING_SET_TEXT_LABEL = "Select and Edit Working Sets"; @@ -252,8 +252,7 @@ public class TaskWorkingSetAction extends Action implements IMenuCreator { } } newList.removeAll(tempList); - getWindow().getActivePage() - .setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); + getWindow().getActivePage().setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); } } @@ -269,28 +268,27 @@ public class TaskWorkingSetAction extends Action implements IMenuCreator { @Override public void runWithEvent(Event event) { Set<IWorkingSet> newList = new HashSet<IWorkingSet>(Arrays.asList(getEnabledSets())); - - Set<IWorkingSet> tempList = new HashSet<IWorkingSet>(); - Iterator<IWorkingSet> iter = newList.iterator(); - while (iter.hasNext()) { - IWorkingSet workingSet = iter.next(); - if (workingSet != null && workingSet.getId().equalsIgnoreCase(ID_TASK_WORKING_SET)) { - tempList.add(workingSet); - } - } - newList.removeAll(tempList); - - if (isChecked()) { - IWorkingSet[] allWorkingSets = getAllWorkingSets(); - for (IWorkingSet workingSet : allWorkingSets) { - if (workingSet != null && workingSet.getId().equalsIgnoreCase(ID_TASK_WORKING_SET)) { - newList.add(workingSet); - } - } - } - - getWindow().getActivePage() - .setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); + + Set<IWorkingSet> tempList = new HashSet<IWorkingSet>(); + Iterator<IWorkingSet> iter = newList.iterator(); + while (iter.hasNext()) { + IWorkingSet workingSet = iter.next(); + if (workingSet != null && workingSet.getId().equalsIgnoreCase(ID_TASK_WORKING_SET)) { + tempList.add(workingSet); + } + } + newList.removeAll(tempList); + + if (isChecked()) { + IWorkingSet[] allWorkingSets = getAllWorkingSets(); + for (IWorkingSet workingSet : allWorkingSets) { + if (workingSet != null && workingSet.getId().equalsIgnoreCase(ID_TASK_WORKING_SET)) { + newList.add(workingSet); + } + } + } + + getWindow().getActivePage().setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); } } @@ -365,8 +363,7 @@ public class TaskWorkingSetAction extends Action implements IMenuCreator { } } - getWindow().getActivePage() - .setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); + getWindow().getActivePage().setWorkingSets(newList.toArray(new IWorkingSet[newList.size()])); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java index f41badc00..925bb9bb9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/commands/RemoteTaskSelectionDialog.java @@ -94,8 +94,7 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog { List<TaskRepository> repositories = new ArrayList<TaskRepository>(); TaskRepositoryManager repositoryManager = TasksUiPlugin.getRepositoryManager(); for (AbstractRepositoryConnector connector : repositoryManager.getRepositoryConnectors()) { - Set<TaskRepository> connectorRepositories = repositoryManager - .getRepositories(connector.getConnectorKind()); + Set<TaskRepository> connectorRepositories = repositoryManager.getRepositories(connector.getConnectorKind()); for (TaskRepository repository : connectorRepositories) { if (TaskRepositoryFilter.CAN_CREATE_TASK_FROM_KEY.accept(repository, connector)) { repositories.add(repository); @@ -118,8 +117,8 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog { matchingTasksLabel.setText("&Matching tasks:"); tasksViewer = new TableViewer(area, SWT.SINGLE | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL); tasksViewer.getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(400, 200).create()); - tasksViewer.setLabelProvider(new DecoratingLabelProvider(new TaskElementLabelProvider(true), PlatformUI - .getWorkbench().getDecoratorManager().getLabelDecorator())); + tasksViewer.setLabelProvider(new DecoratingLabelProvider(new TaskElementLabelProvider(true), + PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); tasksViewer.setContentProvider(new ArrayContentProvider()); tasksViewer.addFilter(new ViewerFilter() { @@ -223,8 +222,8 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog { categoryViewer = new ComboViewer(addToTaskListComposite, SWT.DROP_DOWN | SWT.READ_ONLY); categoryViewer.setContentProvider(new ArrayContentProvider()); TaskList taskList = TasksUiPlugin.getTaskListManager().getTaskList(); - LinkedList<AbstractTaskContainer> categories = new LinkedList<AbstractTaskContainer>(taskList - .getUserCategories()); + LinkedList<AbstractTaskContainer> categories = new LinkedList<AbstractTaskContainer>( + taskList.getUserCategories()); categories.addFirst(taskList.getDefaultCategory()); categoryViewer.setInput(categories); categoryViewer.setLabelProvider(new LabelProvider() { @@ -367,13 +366,11 @@ public class RemoteTaskSelectionDialog extends SelectionStatusDialog { if (!taskSelection.isEmpty()) { selectedTask = (AbstractTask) ((IStructuredSelection) taskSelection).getFirstElement(); } else { - selectedRepository = (TaskRepository) ((IStructuredSelection) repositoriesViewer.getSelection()) - .getFirstElement(); + selectedRepository = (TaskRepository) ((IStructuredSelection) repositoriesViewer.getSelection()).getFirstElement(); } shouldAddToTaskList = addToTaskListCheck.getSelection(); if (shouldAddToTaskList) { - selectedCategory = (AbstractTaskCategory) ((IStructuredSelection) categoryViewer.getSelection()) - .getFirstElement(); + selectedCategory = (AbstractTaskCategory) ((IStructuredSelection) categoryViewer.getSelection()).getFirstElement(); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java index d37853c15..b5676e44d 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentTableLabelProvider.java @@ -37,8 +37,8 @@ public class AttachmentTableLabelProvider extends DecoratingLabelProvider implem private IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager(); - public AttachmentTableLabelProvider(AbstractRepositoryTaskEditor AbstractTaskEditor, - ILabelProvider provider, ILabelDecorator decorator) { + public AttachmentTableLabelProvider(AbstractRepositoryTaskEditor AbstractTaskEditor, ILabelProvider provider, + ILabelDecorator decorator) { super(provider, decorator); this.AbstractTaskEditor = AbstractTaskEditor; } @@ -47,7 +47,7 @@ public class AttachmentTableLabelProvider extends DecoratingLabelProvider implem RepositoryAttachment attachment = (RepositoryAttachment) element; if (columnIndex == 0) { if (AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION.equals(attachment.getDescription()) - || AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION_LEGACY.equals(attachment.getDescription())) { + || AbstractAttachmentHandler.MYLAR_CONTEXT_DESCRIPTION_LEGACY.equals(attachment.getDescription())) { return TasksUiImages.getImage(TasksUiImages.CONTEXT_TRANSFER); } else if (attachment.isPatch()) { return TasksUiImages.getImage(TasksUiImages.ATTACHMENT_PATCH); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentsTableContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentsTableContentProvider.java index 4b0c80d01..1e0d521da 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentsTableContentProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/AttachmentsTableContentProvider.java @@ -18,13 +18,13 @@ import org.eclipse.mylyn.tasks.core.RepositoryAttachment; * @author Mik Kersten */ public class AttachmentsTableContentProvider implements IStructuredContentProvider { - + private List<RepositoryAttachment> attachments; - + public AttachmentsTableContentProvider(List<RepositoryAttachment> attachments) { this.attachments = attachments; } - + public Object[] getElements(Object inputElement) { return attachments.toArray(); } @@ -39,4 +39,3 @@ public class AttachmentsTableContentProvider implements IStructuredContentProvid } } } - diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditor.java index 1f272e9a1..1528aa9ed 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditor.java @@ -35,7 +35,7 @@ import org.eclipse.ui.part.EditorPart; public class CategoryEditor extends EditorPart { public static final String ID_EDITOR = "org.eclipse.mylyn.tasks.ui.editors.category"; - + private Text url; private CategoryEditorInput input = null; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditorInput.java index 7db7d2bf7..02ce78e2c 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditorInput.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/CategoryEditorInput.java @@ -60,7 +60,7 @@ public class CategoryEditorInput implements IEditorInput { public String getCategoryName() { return category.getSummary(); } - + public String getUrl() { return category.getUrl(); } @@ -69,7 +69,7 @@ public class CategoryEditorInput implements IEditorInput { TasksUiPlugin.getTaskListManager().getTaskList().renameContainer(category, description); // category.setDescription(summary); } - + public void setUrl(String url) { category.setUrl(url); Set<AbstractTaskContainer> updated = new HashSet<AbstractTaskContainer>(); @@ -77,5 +77,5 @@ public class CategoryEditorInput implements IEditorInput { TasksUiPlugin.getTaskListManager().getTaskList().notifyContainersUpdated(updated); // .notifyContainerUpdated(category); } - + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ContentOutlineTools.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ContentOutlineTools.java index 8fa469aae..7a782e735 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ContentOutlineTools.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ContentOutlineTools.java @@ -10,7 +10,6 @@ *******************************************************************************/ package org.eclipse.mylyn.internal.tasks.ui.editors; - /** * @author Rob Elves * @author Mik Kersten @@ -21,8 +20,8 @@ public class ContentOutlineTools { public static final String OFFLINE_SERVER_DEFAULT = "[local]"; /** - * Returns a unique handle for the bugzilla selection. Contains the bug taskId, - * the bug server, and (if applicable) the comment number. + * Returns a unique handle for the bugzilla selection. Contains the bug taskId, the bug server, and (if applicable) + * the comment number. * * @param taskSelection * The bugzilla selection. @@ -42,7 +41,8 @@ public class ContentOutlineTools { } public static String getName(IRepositoryTaskSelection taskSelection) { - String name = taskSelection.getRepositoryUrl() + ": Bug#: " + taskSelection.getId() + ": " + taskSelection.getBugSummary(); + String name = taskSelection.getRepositoryUrl() + ": Bug#: " + taskSelection.getId() + ": " + + taskSelection.getBugSummary(); if (taskSelection.hasComment()) { name += " : Comment#: " + taskSelection.getComment().getNumber(); } else if (taskSelection.isCommentHeader()) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorBusyIndicator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorBusyIndicator.java index 5bed1f2f0..3240e00ef 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorBusyIndicator.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/EditorBusyIndicator.java @@ -60,8 +60,8 @@ public class EditorBusyIndicator { try { if (images == null) { images = TasksUiImages.getProgressImages();// If we fail to - // load do not - // continue + // load do not + // continue if (images == null) { showingBusy = false; return; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/IRepositoryTaskSelection.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/IRepositoryTaskSelection.java index c8719d56a..997e6d9ad 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/IRepositoryTaskSelection.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/IRepositoryTaskSelection.java @@ -22,18 +22,17 @@ public interface IRepositoryTaskSelection extends ISelection { public boolean hasComment(); /** - * @return the <code>Comment</code> object for this selection, or - * <code>null</code> if a comment was not selected. + * @return the <code>Comment</code> object for this selection, or <code>null</code> if a comment was not + * selected. */ public TaskComment getComment(); /** - * Sets the <code>Comment</code> object for this selection. If a comment - * was not selected, then this should be <code>null</code>. + * Sets the <code>Comment</code> object for this selection. If a comment was not selected, then this should be + * <code>null</code>. * * @param taskComment - * The selection's comment, or <code>null</code> if not - * applicable. + * The selection's comment, or <code>null</code> if not applicable. */ public void setComment(TaskComment taskComment); @@ -64,8 +63,8 @@ public interface IRepositoryTaskSelection extends ISelection { public void setId(String id); /** - * @return The server of the Bugzilla object that the selection was on, or - * <code>null</code> if no server is supplied. + * @return The server of the Bugzilla object that the selection was on, or <code>null</code> if no server is + * supplied. */ public String getRepositoryUrl(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineComparer.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineComparer.java index 33ced3a02..ea94930a7 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineComparer.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineComparer.java @@ -14,8 +14,7 @@ package org.eclipse.mylyn.internal.tasks.ui.editors; import org.eclipse.jface.viewers.IElementComparer; /** - * This class is used to compare two <code>IRepositoryTaskSelection</code> - * objects. + * This class is used to compare two <code>IRepositoryTaskSelection</code> objects. * * @see IElementComparer * @see IRepositoryTaskSelection @@ -29,8 +28,7 @@ public class RepositoryTaskOutlineComparer implements IElementComparer { // An IRepositoryTaskSelection is uniquely defined by its handle and // its contents - return ((ContentOutlineTools.getHandle(s1).equals(ContentOutlineTools.getHandle(s2))) && ((s1.getContents() == null) ? (s2 - .getContents() == null) + return ((ContentOutlineTools.getHandle(s1).equals(ContentOutlineTools.getHandle(s2))) && ((s1.getContents() == null) ? (s2.getContents() == null) : s1.getContents().equals(s2.getContents()))); } return a.equals(b); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineNode.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineNode.java index dae4f7e22..39fbd12ae 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineNode.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlineNode.java @@ -86,12 +86,11 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { } /** - * @return The children of this node, represented as an <code>Object</code> - * array. + * @return The children of this node, represented as an <code>Object</code> array. */ public RepositoryTaskOutlineNode[] getChildren() { - return (nodeChildren == null) ? new RepositoryTaskOutlineNode[0] : nodeChildren - .toArray(new RepositoryTaskOutlineNode[nodeChildren.size()]); + return (nodeChildren == null) ? new RepositoryTaskOutlineNode[0] + : nodeChildren.toArray(new RepositoryTaskOutlineNode[nodeChildren.size()]); } /** @@ -116,8 +115,8 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { } /** - * @return <code>true</code> if the given object is another node - * representing the same piece of data in the editor. + * @return <code>true</code> if the given object is another node representing the same piece of data in the + * editor. */ @Override public boolean equals(Object arg0) { @@ -158,9 +157,8 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { } /** - * Parses the given <code>IBugzillaBug</code> into a tree of - * <code>RepositoryTaskOutlineNode</code>'s suitable for use in the - * <code>RepositoryTaskOutlinePage</code> view. + * Parses the given <code>IBugzillaBug</code> into a tree of <code>RepositoryTaskOutlineNode</code>'s suitable + * for use in the <code>RepositoryTaskOutlinePage</code> view. * * @param bug * The bug that needs parsing. @@ -211,9 +209,8 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { // } /** - * Parses the given <code>BugReport</code> into a tree of - * <code>RepositoryTaskOutlineNode</code>'s suitable for use in the - * <code>RepositoryTaskOutlinePage</code> view. + * Parses the given <code>BugReport</code> into a tree of <code>RepositoryTaskOutlineNode</code>'s suitable for + * use in the <code>RepositoryTaskOutlinePage</code> view. * * @param bug * The <code>BugReport</code> that needs parsing. @@ -223,11 +220,11 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { String bugId = bug.getId(); String bugServer = bug.getRepositoryUrl(); - RepositoryTaskOutlineNode topNode = new RepositoryTaskOutlineNode(bugId, bugServer, bug.getLabel(), bug, bug - .getSummary()); + RepositoryTaskOutlineNode topNode = new RepositoryTaskOutlineNode(bugId, bugServer, bug.getLabel(), bug, + bug.getSummary()); - RepositoryTaskOutlineNode desc = new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_DESCRIPTION, bug - .getDescription(), bug.getSummary()); + RepositoryTaskOutlineNode desc = new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_DESCRIPTION, + bug.getDescription(), bug.getSummary()); desc.setIsDescription(true); topNode.addChild(desc); @@ -236,26 +233,26 @@ public class RepositoryTaskOutlineNode implements IRepositoryTaskSelection { for (Iterator<TaskComment> iter = bug.getComments().iterator(); iter.hasNext();) { TaskComment taskComment = iter.next(); // first comment is the bug summary - if(taskComment.getNumber() == 0) continue; + if (taskComment.getNumber() == 0) + continue; if (comments == null) { - comments = new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_COMMENTS, taskComment, bug - .getSummary()); + comments = new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_COMMENTS, taskComment, + bug.getSummary()); comments.setIsCommentHeader(true); } - comments.addChild(new RepositoryTaskOutlineNode(bugId, bugServer, taskComment.getCreated(), - taskComment, bug.getSummary())); + comments.addChild(new RepositoryTaskOutlineNode(bugId, bugServer, taskComment.getCreated(), taskComment, + bug.getSummary())); } if (comments != null) { topNode.addChild(comments); } if (hasNewComment) { - topNode - .addChild(new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_NEW_COMMENT, null, bug.getSummary())); + topNode.addChild(new RepositoryTaskOutlineNode(bugId, bugServer, LABEL_NEW_COMMENT, null, bug.getSummary())); } - - RepositoryTaskOutlineNode titleNode = new RepositoryTaskOutlineNode(bugId, bugServer, "BugReport Object", - null, bug.getSummary()); + + RepositoryTaskOutlineNode titleNode = new RepositoryTaskOutlineNode(bugId, bugServer, "BugReport Object", null, + bug.getSummary()); titleNode.addChild(topNode); return titleNode; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlinePage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlinePage.java index 09b5d9b46..66ffe5a02 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlinePage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskOutlinePage.java @@ -38,10 +38,8 @@ public class RepositoryTaskOutlinePage extends ContentOutlinePage { if ((part instanceof AbstractRepositoryTaskEditor) && (selection instanceof IStructuredSelection)) { if (((IStructuredSelection) selection).getFirstElement() instanceof IRepositoryTaskSelection) { if (((IStructuredSelection) getSelection()).getFirstElement() instanceof IRepositoryTaskSelection) { - IRepositoryTaskSelection brs1 = (IRepositoryTaskSelection) ((IStructuredSelection) getSelection()) - .getFirstElement(); - IRepositoryTaskSelection brs2 = ((IRepositoryTaskSelection) ((IStructuredSelection) selection) - .getFirstElement()); + IRepositoryTaskSelection brs1 = (IRepositoryTaskSelection) ((IStructuredSelection) getSelection()).getFirstElement(); + IRepositoryTaskSelection brs2 = ((IRepositoryTaskSelection) ((IStructuredSelection) selection).getFirstElement()); if (ContentOutlineTools.getHandle(brs1).compareTo(ContentOutlineTools.getHandle(brs2)) == 0) { // don't need to make a selection for the same // element @@ -58,7 +56,7 @@ public class RepositoryTaskOutlinePage extends ContentOutlinePage { /** * Creates a new <code>RepositoryTaskOutlinePage</code>. - * + * * @param topTreeNode * The top data node of the tree for this view. * @param editor @@ -80,10 +78,11 @@ public class RepositoryTaskOutlinePage extends ContentOutlinePage { if (element instanceof RepositoryTaskOutlineNode) { RepositoryTaskOutlineNode node = (RepositoryTaskOutlineNode) element; - if (RepositoryTaskOutlineNode.LABEL_COMMENTS.equals(node.getContents())|| - RepositoryTaskOutlineNode.LABEL_NEW_COMMENT.equals(node.getContents())) { + if (RepositoryTaskOutlineNode.LABEL_COMMENTS.equals(node.getContents()) + || RepositoryTaskOutlineNode.LABEL_NEW_COMMENT.equals(node.getContents())) { return TasksUiImages.getImage(TasksUiImages.COMMENT); - } if (RepositoryTaskOutlineNode.LABEL_DESCRIPTION.equals(node.getContents())) { + } + if (RepositoryTaskOutlineNode.LABEL_DESCRIPTION.equals(node.getContents())) { return TasksUiImages.getImage(TasksUiImages.TASK_NOTES); } else if (node.getComment() != null) { return TasksUiImages.getImage(TasksUiImages.PERSON); @@ -134,7 +133,7 @@ public class RepositoryTaskOutlinePage extends ContentOutlinePage { /** * A content provider for the tree for this view. - * + * * @see ITreeContentProvider */ protected static class BugTaskOutlineContentProvider implements ITreeContentProvider { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskSelection.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskSelection.java index d19c89e71..ede200eb9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskSelection.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryTaskSelection.java @@ -30,14 +30,12 @@ public class RepositoryTaskSelection implements IRepositoryTaskSelection { protected String repositoryKind; /** - * The comment, if a comment was selected. If the selection was not a - * comment, then this is <code>null</code>. + * The comment, if a comment was selected. If the selection was not a comment, then this is <code>null</code>. */ protected TaskComment taskComment; /** - * Creates a new <code>RepositoryTaskSelection</code> with no supplied - * comment. + * Creates a new <code>RepositoryTaskSelection</code> with no supplied comment. * * @param taskId * The taskId of the Bugzilla object that the selection was on. @@ -62,9 +60,8 @@ public class RepositoryTaskSelection implements IRepositoryTaskSelection { * @param contents * The contents of the selection. * @param taskComment - * The <code>Comment</code> object for this selection. If a - * comment was not selected, then this should be - * <code>null</code>. + * The <code>Comment</code> object for this selection. If a comment was not selected, then this should + * be <code>null</code>. */ public RepositoryTaskSelection(String id, String server, String kind, String contents, TaskComment taskComment, String summary) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryViewerConfig.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryViewerConfig.java index d53e1c45e..64652c41a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryViewerConfig.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RepositoryViewerConfig.java @@ -89,7 +89,7 @@ public class RepositoryViewerConfig extends SourceViewerConfiguration { @Override public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) { - List<IHyperlinkDetector> detectors = new ArrayList<IHyperlinkDetector>(); + List<IHyperlinkDetector> detectors = new ArrayList<IHyperlinkDetector>(); detectors.addAll(Arrays.asList(TasksUiPlugin.getDefault().getTaskHyperlinkDetectors())); return detectors.toArray(new IHyperlinkDetector[detectors.size()]); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SpellingDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SpellingDialog.java index 1eecc2f19..f89edaca6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SpellingDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/SpellingDialog.java @@ -24,8 +24,7 @@ import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; /** - * TODO this is used only for spell checking which is not yet implemented, - * therefore this is not properly tested + * TODO this is used only for spell checking which is not yet implemented, therefore this is not properly tested * * @author Shawn Minto */ diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorInputFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorInputFactory.java index 7cd27a7e0..3e0d2fc78 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorInputFactory.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorInputFactory.java @@ -35,9 +35,9 @@ public class TaskEditorInputFactory implements IElementFactory { } return null; } - + public static void saveState(IMemento memento, TaskEditorInput input) { - if(memento != null && input != null && input.getTask() != null) { + if (memento != null && input != null && input.getTask() != null) { memento.putString(TAG_TASK_HANDLE, input.getTask().getHandleIdentifier()); } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java index 6ce859add..4a9449607 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java @@ -77,7 +77,7 @@ public class TaskHyperlinkDetector extends AbstractHyperlinkDetector { if (repository != null) { return repository; } - + IResource resource = (IResource) getAdapter(IResource.class); if (resource == null) { if (textViewer instanceof RepositoryTextViewer) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java index ee5a9abd3..dc79895c9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java @@ -134,7 +134,7 @@ public class TaskPlanningEditor extends TaskFormPage { private ImageHyperlink getDescLink; private ImageHyperlink openUrlLink; - + private TaskEditor parentEditor = null; private ITaskListChangeListener TASK_LIST_LISTENER = new ITaskListChangeListener() { @@ -142,7 +142,7 @@ public class TaskPlanningEditor extends TaskFormPage { public void containersChanged(Set<TaskContainerDelta> containers) { for (TaskContainerDelta taskContainerDelta : containers) { if (taskContainerDelta.getContainer() instanceof AbstractTask) { - final AbstractTask updateTask = (AbstractTask)taskContainerDelta.getContainer(); + final AbstractTask updateTask = (AbstractTask) taskContainerDelta.getContainer(); if (updateTask != null && task != null && updateTask.getHandleIdentifier().equals(task.getHandleIdentifier())) { if (PlatformUI.getWorkbench() != null && !PlatformUI.getWorkbench().isClosing()) { @@ -506,9 +506,9 @@ public class TaskPlanningEditor extends TaskFormPage { } public void linkExited(HyperlinkEvent e) { - } + } }); - + toolkit.paintBordersFor(urlComposite); toolkit.paintBordersFor(statusComposite); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskSpellingReconcileStrategy.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskSpellingReconcileStrategy.java index b1fcdaad9..2f0a10083 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskSpellingReconcileStrategy.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskSpellingReconcileStrategy.java @@ -34,8 +34,7 @@ import org.eclipse.ui.texteditor.spelling.SpellingContext; import org.eclipse.ui.texteditor.spelling.SpellingProblem; /** - * Adapted from - * org.eclipse.jdt.internal.ui.text.spelling.PropertiesSpellingReconcileStrategy + * Adapted from org.eclipse.jdt.internal.ui.text.spelling.PropertiesSpellingReconcileStrategy * * @author Jeff Pound * @author Rob Elves @@ -43,8 +42,8 @@ import org.eclipse.ui.texteditor.spelling.SpellingProblem; public class TaskSpellingReconcileStrategy implements IReconcilerExtension, IReconcilingStrategy { /** - * Spelling problem collector that forwards {@link SpellingProblem}s as - * {@link IProblem}s to the {@link org.eclipse.jdt.core.IProblemRequestor}. + * Spelling problem collector that forwards {@link SpellingProblem}s as {@link IProblem}s to the + * {@link org.eclipse.jdt.core.IProblemRequestor}. */ private class SpellingProblemCollector implements ISpellingProblemCollector { @@ -69,10 +68,10 @@ public class TaskSpellingReconcileStrategy implements IReconcilerExtension, IRec */ public void accept(SpellingProblem problem) { try { - int line = fDocument.getLineOfOffset(problem.getOffset()) + 1; - - fAddAnnotations.put(new ErrorAnnotation(line, null), new Position(problem.getOffset(), problem - .getLength())); + int line = fDocument.getLineOfOffset(problem.getOffset()) + 1; + + fAddAnnotations.put(new ErrorAnnotation(line, null), new Position(problem.getOffset(), + problem.getLength())); } catch (BadLocationException x) { // drop this SpellingProblem @@ -122,9 +121,8 @@ public class TaskSpellingReconcileStrategy implements IReconcilerExtension, IRec /** * The spelling context containing the Java properties content type. * <p> - * Since his reconcile strategy is for the Properties File editor which - * normally edits Java properties files we always use the Java properties - * file content type for performance reasons. + * Since his reconcile strategy is for the Properties File editor which normally edits Java properties files we + * always use the Java properties file content type for performance reasons. * </p> * * @since 3.2 diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java index 270f72d41..b660119f9 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlink.java @@ -20,6 +20,7 @@ public class TaskUrlHyperlink extends URLHyperlink { public TaskUrlHyperlink(IRegion region, String urlString) { super(region, urlString); } + @Override public void open() { String url = getURLString(); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/DateSelectionDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/DateSelectionDialog.java index 24afc8793..3506604f8 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/DateSelectionDialog.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/DateSelectionDialog.java @@ -37,31 +37,32 @@ public class DateSelectionDialog extends Dialog { private Date reminderDate = null; private String title = "Date Selection"; - + private Calendar initialCalendar = GregorianCalendar.getInstance(); private FormToolkit toolkit; - + public DateSelectionDialog(Shell parentShell, String title) { this(parentShell, GregorianCalendar.getInstance(), title); } public DateSelectionDialog(Shell parentShell, Calendar initialDate, String title) { super(parentShell); - - toolkit = new FormToolkit(parentShell.getDisplay());; - if(title != null) { + + toolkit = new FormToolkit(parentShell.getDisplay()); + ; + if (title != null) { this.title = title; } - if(initialDate != null) { - this.initialCalendar.setTime(initialDate.getTime()); + if (initialDate != null) { + this.initialCalendar.setTime(initialDate.getTime()); } reminderDate = initialCalendar.getTime(); } @Override protected Control createDialogArea(Composite parent) { - getShell().setText(title); + getShell().setText(title); DatePickerPanel datePanel = new DatePickerPanel(parent, SWT.NULL, initialCalendar); datePanel.addSelectionChangedListener(new ISelectionChangedListener() { @@ -72,10 +73,10 @@ public class DateSelectionDialog extends Dialog { } } }); - datePanel.setBackground(toolkit.getColors().getBackground()); + datePanel.setBackground(toolkit.getColors().getBackground()); return datePanel; } - + @Override public boolean close() { toolkit.dispose(); @@ -88,11 +89,11 @@ public class DateSelectionDialog extends Dialog { createButton(parent, IDialogConstants.CLIENT_ID + 1, "Clear", false); super.createButtonsForButtonBar(parent); } - + @Override protected void buttonPressed(int buttonId) { super.buttonPressed(buttonId); - if(buttonId == IDialogConstants.CLIENT_ID + 1) { + if (buttonId == IDialogConstants.CLIENT_ID + 1) { reminderDate = null; okPressed(); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ITaskPlannerContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ITaskPlannerContentProvider.java index c2a308a24..761fca62d 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ITaskPlannerContentProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ITaskPlannerContentProvider.java @@ -16,5 +16,6 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; public interface ITaskPlannerContentProvider { public void removeTask(AbstractTask task); + public void addTask(AbstractTask task); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/InProgressTaskCollector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/InProgressTaskCollector.java index c3c230abf..940b08808 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/InProgressTaskCollector.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/InProgressTaskCollector.java @@ -23,8 +23,7 @@ import org.eclipse.mylyn.monitor.core.InteractionEvent; import org.eclipse.mylyn.tasks.core.AbstractTask; /** - * Collects tasks that are not complete but have been worked on during the - * specified number of previous days. + * Collects tasks that are not complete but have been worked on during the specified number of previous days. * * @author Wesley Coelho (Adapted from CompletedTaskCollector by Key Sueda) * @author Mik Kersten @@ -36,7 +35,8 @@ public class InProgressTaskCollector implements ITaskCollector { private Date periodStartDate; protected static boolean hasActivitySince(AbstractTask task, Date startDate) { - IInteractionContext mylarContext = ContextCorePlugin.getContextManager().loadContext(task.getHandleIdentifier()); + IInteractionContext mylarContext = ContextCorePlugin.getContextManager() + .loadContext(task.getHandleIdentifier()); if (mylarContext != null) { List<InteractionEvent> events = mylarContext.getInteractionHistory(); if (events.size() > 0) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/OpenTaskEditorAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/OpenTaskEditorAction.java index b60cb33c2..07c5770dd 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/OpenTaskEditorAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/OpenTaskEditorAction.java @@ -44,7 +44,7 @@ public class OpenTaskEditorAction extends Action { ISelection selection = viewer.getSelection(); Object object = ((IStructuredSelection) selection).getFirstElement(); if (object instanceof AbstractTask) { - TasksUiUtil.openEditor((AbstractTask)object, false); + TasksUiUtil.openEditor((AbstractTask) object, false); } // if (obj instanceof Task) { // ((Task) obj).openTaskInEditor(false); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ReminderCellEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ReminderCellEditor.java index 362587880..814e1710a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ReminderCellEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/ReminderCellEditor.java @@ -35,7 +35,7 @@ public class ReminderCellEditor extends DialogCellEditor { private DateSelectionDialog dialog; private String formatString = "dd-MMM-yyyy"; - + private SimpleDateFormat format = new SimpleDateFormat(formatString, Locale.ENGLISH); public ReminderCellEditor(Composite parent) { @@ -59,15 +59,15 @@ public class ReminderCellEditor extends DialogCellEditor { } } Calendar newCalendar = GregorianCalendar.getInstance(); - if(initialCalendar != null) { + if (initialCalendar != null) { newCalendar.setTime(initialCalendar.getTime()); - } - + } + dialog = new DateSelectionDialog(cellEditorWindow.getShell(), newCalendar, DatePicker.TITLE_DIALOG); int dialogResponse = dialog.open(); - - if(dialogResponse == DateSelectionDialog.CANCEL) { - if(initialCalendar != null) { + + if (dialogResponse == DateSelectionDialog.CANCEL) { + if (initialCalendar != null) { reminderDate = initialCalendar.getTime(); } else { reminderDate = null; @@ -75,7 +75,7 @@ public class ReminderCellEditor extends DialogCellEditor { } else { reminderDate = dialog.getDate(); } - + String result = null; if (reminderDate != null) { result = format.format(reminderDate); @@ -87,10 +87,10 @@ public class ReminderCellEditor extends DialogCellEditor { return reminderDate; } - @Override - protected void doSetFocus() { - reminderDate = null; - super.doSetFocus(); - } - + @Override + protected void doSetFocus() { + reminderDate = null; + super.doSetFocus(); + } + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorInput.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorInput.java index 63565412a..ea0d526d6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorInput.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorInput.java @@ -38,7 +38,7 @@ public class TaskActivityEditorInput implements IEditorInput { private Set<AbstractTask> completedTasks = new HashSet<AbstractTask>(); private Set<AbstractTask> inProgressTasks = new HashSet<AbstractTask>(); - + private Set<AbstractTask> plannedTasks = new HashSet<AbstractTask>(); private TaskReportGenerator taskReportGenerator = null; @@ -70,11 +70,11 @@ public class TaskActivityEditorInput implements IEditorInput { completedTasks = completedTaskCollector.getTasks(); inProgressTasks = inProgressTaskCollector.getTasks(); - + plannedTasks.addAll(TasksUiPlugin.getTaskListManager().getActivityNextWeek().getChildren()); - + plannedTasks.addAll(TasksUiPlugin.getTaskListManager().getActivityFuture().getChildren()); - + //plannedTasks = new HashSet<ITask>(); } @@ -110,7 +110,7 @@ public class TaskActivityEditorInput implements IEditorInput { public Set<AbstractTask> getInProgressTasks() { return inProgressTasks; } - + public Set<AbstractTask> getPlannedTasks() { return plannedTasks; } @@ -155,23 +155,23 @@ public class TaskActivityEditorInput implements IEditorInput { } return duration; } - - public void removeCompletedTask( AbstractTask task) { - completedTasks.remove(task); + + public void removeCompletedTask(AbstractTask task) { + completedTasks.remove(task); } - + public void removeInProgressTask(AbstractTask task) { inProgressTasks.remove(task); } - - public void addPlannedTask(AbstractTask task) { - plannedTasks.add(task); + + public void addPlannedTask(AbstractTask task) { + plannedTasks.add(task); } - + public void removePlannedTask(AbstractTask task) { plannedTasks.remove(task); } - + public int getPlannedEstimate() { int estimated = 0; for (AbstractTask task : plannedTasks) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorPart.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorPart.java index da1d42ac8..54407cf0c 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorPart.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityEditorPart.java @@ -62,15 +62,13 @@ import org.eclipse.ui.part.EditorPart; /** * - * Note: Some methods have been generalized to remove duplicate code but the - * design still isn't right (long parameter lists, inflexible table creation). - * Needs refactoring. (Planned tasks section is currently disabled but should - * also use the new common methods) + * Note: Some methods have been generalized to remove duplicate code but the design still isn't right (long parameter + * lists, inflexible table creation). Needs refactoring. (Planned tasks section is currently disabled but should also + * use the new common methods) * * @author Mik Kersten * @author Ken Sueda (original prototype) - * @author Wesley Coelho (added tasks in progress section, refactored-out - * similar code) + * @author Wesley Coelho (added tasks in progress section, refactored-out similar code) * @author Mik Kersten (rewrite) */ public class TaskActivityEditorPart extends EditorPart { @@ -395,7 +393,7 @@ public class TaskActivityEditorPart extends EditorPart { private TableViewer createTableSection(Composite parent, FormToolkit toolkit, String title, String[] columnNames, int[] columnWidths, int[] sortConstants) { Section tableSection = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR); // | - // ExpandableComposite.TWISTIE + // ExpandableComposite.TWISTIE tableSection.setText(title); // tableSection.setExpanded(true); tableSection.marginHeight = 8; @@ -692,9 +690,9 @@ public class TaskActivityEditorPart extends EditorPart { BufferedWriter writer = new BufferedWriter(new FileWriter(outputFile)); writer.write("<html><head></head><body>" // + "<link rel=\"stylesheet\" - // href=\"http://eclipse.org/mylar/style.css\" - // type=\"text/css\"></head><body>" - ); + // href=\"http://eclipse.org/mylar/style.css\" + // type=\"text/css\"></head><body>" + ); exportSummarySection(writer); @@ -717,8 +715,7 @@ public class TaskActivityEditorPart extends EditorPart { writer.write("<table border=\"1\" width=\"100%\" id=\"plannedActivityTable\">"); writer.write("<tr>"); - writer - .write("<td width=\"59\"><b>Type</b></td><td width=\"55\"><b>Priority</b></td><td width=\"495\"><b>Description</b></td>"); + writer.write("<td width=\"59\"><b>Type</b></td><td width=\"55\"><b>Priority</b></td><td width=\"495\"><b>Description</b></td>"); writer.write("<td><b>Elapsed</b></td><td><b>Estimated</b></td><td><b>Reminder</b></td>"); writer.write("</tr>"); @@ -729,7 +726,8 @@ public class TaskActivityEditorPart extends EditorPart { String formatString = "dd-MM-yyyy"; SimpleDateFormat format = new SimpleDateFormat(formatString, Locale.ENGLISH); - String elapsedTimeString = DateUtil.getFormattedDuration(TasksUiPlugin.getTaskListManager().getElapsedTime(currentTask), false); + String elapsedTimeString = DateUtil.getFormattedDuration(TasksUiPlugin.getTaskListManager() + .getElapsedTime(currentTask), false); String estimatedTimeString = currentTask.getEstimateTimeHours() + " hours"; if (elapsedTimeString.equals("")) elapsedTimeString = BLANK_CELL; @@ -766,10 +764,8 @@ public class TaskActivityEditorPart extends EditorPart { writer.write("<table border=\"1\" width=\"100%\" id=\"activityTable\">"); writer.write("<tr>"); - writer - .write("<td width=\"59\"><b>Type</b></td><td width=\"55\"><b>Priority</b></td><td width=\"495\"><b>Description</b></td>"); - writer - .write("<td><b>Created</b></td><td><b>Completed</b></td><td><b>Elapsed</b></td><td><b>Estimated</b></td>"); + writer.write("<td width=\"59\"><b>Type</b></td><td width=\"55\"><b>Priority</b></td><td width=\"495\"><b>Description</b></td>"); + writer.write("<td><b>Created</b></td><td><b>Completed</b></td><td><b>Elapsed</b></td><td><b>Estimated</b></td>"); writer.write("</tr>"); for (Object element : activityContentProvider.getElements(null)) { @@ -779,7 +775,8 @@ public class TaskActivityEditorPart extends EditorPart { String formatString = "dd-MM-yyyy"; SimpleDateFormat format = new SimpleDateFormat(formatString, Locale.ENGLISH); - String elapsedTimeString = DateUtil.getFormattedDuration(TasksUiPlugin.getTaskListManager().getElapsedTime(currentTask), false); + String elapsedTimeString = DateUtil.getFormattedDuration(TasksUiPlugin.getTaskListManager() + .getElapsedTime(currentTask), false); String estimatedTimeString = currentTask.getEstimateTimeHours() + " hours"; if (elapsedTimeString.equals("")) elapsedTimeString = NO_TIME_ELAPSED; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivitySorter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivitySorter.java index 5682a8ee9..5e5275513 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivitySorter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivitySorter.java @@ -92,6 +92,7 @@ public class TaskActivitySorter extends ViewerSorter { } protected int compareDuration(AbstractTask task1, AbstractTask task2) { - return TasksUiPlugin.getTaskListManager().getElapsedTime(task1) < TasksUiPlugin.getTaskListManager().getElapsedTime(task2) ? 1 : -1; + return TasksUiPlugin.getTaskListManager().getElapsedTime(task1) < TasksUiPlugin.getTaskListManager() + .getElapsedTime(task2) ? 1 : -1; } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizard.java index 00ba82e34..701715c81 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizard.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizard.java @@ -29,7 +29,7 @@ import org.eclipse.ui.PartInitException; public class TaskActivityWizard extends Wizard implements INewWizard { private static final String TITLE = "New Task Activity Report"; - + private TaskActivityWizardPage planningGamePage; public TaskActivityWizard() { @@ -41,12 +41,11 @@ public class TaskActivityWizard extends Wizard implements INewWizard { @Override public boolean performFinish() { try { - IWorkbenchPage page = TasksUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow() - .getActivePage(); + IWorkbenchPage page = TasksUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(); if (page == null) return false; - IEditorInput input = new TaskActivityEditorInput(planningGamePage.getReportStartDate(), planningGamePage - .getSelectedContainers(), TasksUiPlugin.getTaskListManager().getTaskList()); + IEditorInput input = new TaskActivityEditorInput(planningGamePage.getReportStartDate(), + planningGamePage.getSelectedContainers(), TasksUiPlugin.getTaskListManager().getTaskList()); page.openEditor(input, TaskPlanningEditor.ID_EDITOR_PLANNING); } catch (PartInitException ex) { StatusHandler.log(ex, "couldn't open summary editor"); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizardPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizardPage.java index 256ece68b..494b817d0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizardPage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/planner/TaskActivityWizardPage.java @@ -70,7 +70,7 @@ public class TaskActivityWizardPage extends WizardPage { private int numDaysToReport = 0; private Table filtersTable; - + private TaskElementLabelProvider labelProvider = new TaskElementLabelProvider(false); public TaskActivityWizardPage() { @@ -296,7 +296,7 @@ public class TaskActivityWizardPage extends WizardPage { TableItem[] items = filtersTable.getItems(); for (TableItem item : items) { if (item.getChecked() && item.getData() instanceof AbstractTaskCategory) { - result.add((AbstractTaskCategory)item.getData()); + result.add((AbstractTaskCategory) item.getData()); } } return result; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/TaskFocusedUiPreferencePage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/TaskFocusedUiPreferencePage.java index 7267c58b4..f0eb3b677 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/TaskFocusedUiPreferencePage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/preferences/TaskFocusedUiPreferencePage.java @@ -30,7 +30,7 @@ public class TaskFocusedUiPreferencePage extends PreferencePage implements IWork Label label = new Label(container, SWT.NULL); label.setText("Please select a preference page below \"Mylyn\"."); - + return container; } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectPropertiesLinkProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectPropertiesLinkProvider.java index f5cfe8396..9073b5525 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectPropertiesLinkProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectPropertiesLinkProvider.java @@ -50,7 +50,6 @@ public class ProjectPropertiesLinkProvider extends AbstractTaskRepositoryLinkPro return null; } - @Override public boolean canSetTaskRepository(IResource resource) { IProject project = resource.getProject(); @@ -63,7 +62,7 @@ public class ProjectPropertiesLinkProvider extends AbstractTaskRepositoryLinkPro if (project == null || !project.isAccessible()) { return false; } - + IScopeContext projectScope = new ProjectScope(project); IEclipsePreferences projectNode = projectScope.getNode(TasksUiPlugin.ID_PLUGIN); if (projectNode != null) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectTaskRepositoryPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectTaskRepositoryPage.java index fd23fe6a6..588ca1959 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectTaskRepositoryPage.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/properties/ProjectTaskRepositoryPage.java @@ -74,7 +74,7 @@ public class ProjectTaskRepositoryPage extends PropertyPage { description.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); listViewer = CheckboxTableViewer.newCheckList(composite, SWT.TOP | SWT.BORDER); - listViewer.getTable().setFont(font); + listViewer.getTable().setFont(font); GridData data = new GridData(GridData.FILL_BOTH); data.grabExcessHorizontalSpace = true; @@ -85,8 +85,8 @@ public class ProjectTaskRepositoryPage extends PropertyPage { listViewer.getTable().setLayoutData(data); listViewer.getTable().setFont(font); - listViewer.setLabelProvider(new DecoratingLabelProvider(new TaskRepositoryLabelProvider(), PlatformUI - .getWorkbench().getDecoratorManager().getLabelDecorator())); + listViewer.setLabelProvider(new DecoratingLabelProvider(new TaskRepositoryLabelProvider(), + PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); listViewer.setContentProvider(new IStructuredContentProvider() { public void inputChanged(Viewer v, Object oldInput, Object newInput) { } @@ -174,7 +174,7 @@ public class ProjectTaskRepositoryPage extends PropertyPage { TaskRepository selectedRepository = (TaskRepository) listViewer.getCheckedElements()[0]; try { TasksUiPlugin plugin = TasksUiPlugin.getDefault(); - if(plugin.canSetRepositoryForResource(project)) { + if (plugin.canSetRepositoryForResource(project)) { plugin.setRepositoryForResource(project, selectedRepository); } } catch (CoreException e) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/CreateQueryFromSearchAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/CreateQueryFromSearchAction.java index 759fdcb0f..531e9405a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/CreateQueryFromSearchAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/CreateQueryFromSearchAction.java @@ -67,7 +67,8 @@ public class CreateQueryFromSearchAction extends Action { AbstractRepositoryQuery query = searchHitCollector.getRepositoryQuery(); InputDialog dialog = new InputDialog(PlatformUI.getWorkbench() .getActiveWorkbenchWindow() - .getShell(), "Create Query", "Name of query to be added to the " + TaskListView.LABEL_VIEW + ": ", "", null); + .getShell(), "Create Query", "Name of query to be added to the " + TaskListView.LABEL_VIEW + + ": ", "", null); int dialogResult = dialog.open(); if (dialogResult == Window.OK) { query.setHandleIdentifier(dialog.getValue()); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/OpenSearchResultAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/OpenSearchResultAction.java index bdd1487e4..46efc88ae 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/OpenSearchResultAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/OpenSearchResultAction.java @@ -32,8 +32,7 @@ public class OpenSearchResultAction extends Action { * @param text * The text for this action * @param resultView - * The <code>RepositorySearchResultView</code> this action - * works on + * The <code>RepositorySearchResultView</code> this action works on */ public OpenSearchResultAction(String text, RepositorySearchResultView resultView) { setText(text); @@ -55,7 +54,8 @@ public class OpenSearchResultAction extends Action { // go through each of the selected items and show it in an editor for (Iterator<AbstractTask> it = selection.iterator(); it.hasNext();) { AbstractTask repositoryHit = it.next(); - TasksUiUtil.openRepositoryTask(repositoryHit.getRepositoryUrl(), repositoryHit.getTaskId(), repositoryHit.getUrl()); + TasksUiUtil.openRepositoryTask(repositoryHit.getRepositoryUrl(), repositoryHit.getTaskId(), + repositoryHit.getUrl()); // try { // int taskId = Integer.parseInt(repositoryHit.getId()); // String bugUrl = diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultContentProvider.java index 204065e7f..f2a303cb5 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultContentProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultContentProvider.java @@ -48,8 +48,7 @@ public abstract class SearchResultContentProvider implements IStructuredContentP } /** - * This method is called whenever the set of matches for the given elements - * changes. + * This method is called whenever the set of matches for the given elements changes. * * @param updatedElements * The array of objects that has to be refreshed diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java index f65251b27..fee9bc3c1 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSortAction.java @@ -15,6 +15,7 @@ import org.eclipse.jface.action.Action; /** * This class sorts search results by a supplied category. + * * @author Rob Elves (moved to tasks.ui) */ public class SearchResultSortAction extends Action { @@ -29,8 +30,7 @@ public class SearchResultSortAction extends Action { * Constructor * * @param label - * The string used as the text for the action, or null if there - * is no text + * The string used as the text for the action, or null if there is no text * @param page * The view where the Bugzilla search results are displayed. * @param sortOrder diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterDescription.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterDescription.java index 9c442cf1c..744ea0247 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterDescription.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterDescription.java @@ -26,13 +26,12 @@ public class SearchResultSorterDescription extends ViewerSorter { private TaskKeyComparator taskKeyComparator = new TaskKeyComparator(); /** - * Returns a negative, zero, or positive number depending on whether the - * first bug's summary goes before, is the same as, or goes after the - * second element's summary. + * Returns a negative, zero, or positive number depending on whether the first bug's summary goes before, is the + * same as, or goes after the second element's summary. * <p> * - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, - * java.lang.Object, java.lang.Object) + * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { @@ -54,9 +53,8 @@ public class SearchResultSorterDescription extends ViewerSorter { } /** - * Returns the category of the given element. The category is a number used - * to allocate elements to bins; the bins are arranged in ascending numeric - * order. The elements within a bin are arranged via a second level sort + * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins + * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort * criterion. * <p> * diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java index a71bbd66e..3082fc6ef 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterId.java @@ -21,13 +21,12 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; public class SearchResultSorterId extends ViewerSorter { /** - * Returns a negative, zero, or positive number depending on whether the - * first bug's taskId is less than, equal to, or greater than the second - * bug's taskId. + * Returns a negative, zero, or positive number depending on whether the first bug's taskId is less than, equal to, + * or greater than the second bug's taskId. * <p> * - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, - * java.lang.Object, java.lang.Object) + * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { @@ -53,9 +52,8 @@ public class SearchResultSorterId extends ViewerSorter { } /** - * Returns the category of the given element. The category is a number used - * to allocate elements to bins; the bins are arranged in ascending numeric - * order. The elements within a bin are arranged via a second level sort + * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins + * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort * criterion. * <p> * diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java index 3b38e4bc8..6f0077891 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultSorterPriority.java @@ -17,18 +17,18 @@ import org.eclipse.mylyn.tasks.core.AbstractTask; /** * Sorts results of Bugzilla search by bug priority. + * * @author Rob Elves (modifications) */ public class SearchResultSorterPriority extends ViewerSorter { /** - * Returns a negative, zero, or positive number depending on whether the - * first bug's priority goes before, is the same as, or goes after the - * second element's priority. + * Returns a negative, zero, or positive number depending on whether the first bug's priority goes before, is the + * same as, or goes after the second element's priority. * <p> * - * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, - * java.lang.Object, java.lang.Object) + * @see org.eclipse.jface.viewers.ViewerSorter#compare(org.eclipse.jface.viewers.Viewer, java.lang.Object, + * java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { @@ -44,9 +44,8 @@ public class SearchResultSorterPriority extends ViewerSorter { } /** - * Returns the category of the given element. The category is a number used - * to allocate elements to bins; the bins are arranged in ascending numeric - * order. The elements within a bin are arranged via a second level sort + * Returns the category of the given element. The category is a number used to allocate elements to bins; the bins + * are arranged in ascending numeric order. The elements within a bin are arranged via a second level sort * criterion. * <p> * diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTableContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTableContentProvider.java index 0f472abd9..13f5308a6 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTableContentProvider.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchResultTableContentProvider.java @@ -17,8 +17,8 @@ import org.eclipse.jface.viewers.Viewer; import org.eclipse.mylyn.tasks.ui.search.RepositorySearchResult; /** - * This implementation of <code>SearchResultContentProvider</code> is used for the - * table view of a Bugzilla search result. + * This implementation of <code>SearchResultContentProvider</code> is used for the table view of a Bugzilla search + * result. * * @author Rob Elves (moved into task.ui) */ @@ -54,7 +54,7 @@ public class SearchResultTableContentProvider extends SearchResultContentProvide viewer.update(updatedElements[i], null); else { // if (!tableLimited || viewer.getTable().getItemCount() < SearchPreferencePage.getTableLimit()) - viewer.add(updatedElements[i]); + viewer.add(updatedElements[i]); } } else viewer.remove(updatedElements[i]); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java index 97be58098..7f427dbf0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/search/SearchScoreComputerAdapterFactory.java @@ -17,8 +17,8 @@ import org.eclipse.mylyn.tasks.core.AbstractTaskContainer; import org.eclipse.search.ui.ISearchPageScoreComputer; /** - * Implements a {@link IAdapterFactory} for {@link ISearchPageScoreComputer}s - * which ranks {@link AbstractTaskContainer}s high for the task search page + * Implements a {@link IAdapterFactory} for {@link ISearchPageScoreComputer}s which ranks {@link AbstractTaskContainer}s + * high for the task search page * * @author Willian Mitsuda */ diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/IBackgroundSaveListener.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/IBackgroundSaveListener.java index deb8943ae..e0cde61be 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/IBackgroundSaveListener.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/IBackgroundSaveListener.java @@ -11,16 +11,14 @@ package org.eclipse.mylyn.internal.tasks.ui.util; /** - * Interface implemented by clients who are to be notified of periodic requests - * to save data to disk. + * Interface implemented by clients who are to be notified of periodic requests to save data to disk. * * @author Wesley Coelho */ public interface IBackgroundSaveListener { /** - * Called to notify the client of a PeriodicSaveTimer that a save should be - * performed + * Called to notify the client of a PeriodicSaveTimer that a save should be performed */ public void saveRequested(); } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportJob.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportJob.java index 8ea534c22..8c90dbb2e 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportJob.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskDataExportJob.java @@ -37,9 +37,8 @@ import org.eclipse.mylyn.tasks.core.TaskRepositoryManager; import org.eclipse.mylyn.tasks.ui.TasksUiPlugin; /** - * Job that performs exporting (copying or zipping) of Mylar Task List data - * Assumes that check with user for overwrite already done. Overwrites - * destination if exists! + * Job that performs exporting (copying or zipping) of Mylar Task List data Assumes that check with user for overwrite + * already done. Overwrites destination if exists! * * @author Wesley Coelho * @author Mik Kersten @@ -68,7 +67,8 @@ public class TaskDataExportJob implements IRunnableWithProgress { /** export all data */ public TaskDataExportJob(String destinationDirectory, boolean zipIt, String zipFileName) { this(destinationDirectory, true, true, true, zipIt, zipFileName, TasksUiPlugin.getTaskListManager() - .getTaskList().getAllTasks()); + .getTaskList() + .getAllTasks()); } /** export specified data */ @@ -127,8 +127,8 @@ public class TaskDataExportJob implements IRunnableWithProgress { destRepositoriesFile.delete(); } if (!copy(sourceRepositoriesFile, destRepositoriesFile)) { - StatusHandler.fail(new Exception("Export Exception"), - "Could not export repositories file.", false); + StatusHandler.fail(new Exception("Export Exception"), "Could not export repositories file.", + false); } monitor.worked(1); } @@ -153,8 +153,7 @@ public class TaskDataExportJob implements IRunnableWithProgress { destTaskListFile.delete(); } if (!copy(sourceTaskListFile, destTaskListFile)) { - StatusHandler.fail(new Exception("Export Exception"), "Could not export task list file.", - false); + StatusHandler.fail(new Exception("Export Exception"), "Could not export task list file.", false); } monitor.worked(1); } @@ -165,7 +164,8 @@ public class TaskDataExportJob implements IRunnableWithProgress { if (exportActivationHistory) { try { File sourceActivationHistoryFile = new File(contextsDirectory, - InteractionContextManager.CONTEXT_HISTORY_FILE_NAME + InteractionContextManager.CONTEXT_FILE_EXTENSION); + InteractionContextManager.CONTEXT_HISTORY_FILE_NAME + + InteractionContextManager.CONTEXT_FILE_EXTENSION); if (sourceActivationHistoryFile.exists()) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListSaveManager.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListSaveManager.java index 038cecb79..149def207 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListSaveManager.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListSaveManager.java @@ -78,7 +78,8 @@ public class TaskListSaveManager implements ITaskListChangeListener, IBackground } /** - * Should only be used by TaskListManager and unit tests + * Should only be used by TaskListManager and unit tests + * * @param saveContext * @param async */ @@ -109,14 +110,13 @@ public class TaskListSaveManager implements ITaskListChangeListener, IBackground PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { if (PlatformUI.getWorkbench() != null && PlatformUI.getWorkbench().getDisplay() != null) { - MessageDialog - .openInformation( - PlatformUI.getWorkbench().getDisplay().getActiveShell(), - ITasksUiConstants.TITLE_DIALOG, - "If task list is blank, Mylar Task List may have failed to initialize.\n\n" - + "First, try restarting to see if that corrects the problem.\n\n" - + "Then, check the Error Log view for messages, and the FAQ for solutions.\n\n" - + ITasksUiConstants.URL_HOMEPAGE); + MessageDialog.openInformation( + PlatformUI.getWorkbench().getDisplay().getActiveShell(), + ITasksUiConstants.TITLE_DIALOG, + "If task list is blank, Mylar Task List may have failed to initialize.\n\n" + + "First, try restarting to see if that corrects the problem.\n\n" + + "Then, check the Error Log view for messages, and the FAQ for solutions.\n\n" + + ITasksUiConstants.URL_HOMEPAGE); } } }); @@ -131,8 +131,7 @@ public class TaskListSaveManager implements ITaskListChangeListener, IBackground } /** - * Copies all files in the current data directory to the specified folder. - * Will overwrite. + * Copies all files in the current data directory to the specified folder. Will overwrite. */ public void copyDataDirContentsTo(String targetFolderPath) { saveTaskList(true, false); @@ -147,8 +146,8 @@ public class TaskListSaveManager implements ITaskListChangeListener, IBackground File destDir = new File(targetFolderPath + File.separator + currFile.getName()); if (!destDir.exists()) { if (!destDir.mkdir()) { - StatusHandler.log("Unable to create destination context folder: " - + destDir.getAbsolutePath(), this); + StatusHandler.log("Unable to create destination context folder: " + destDir.getAbsolutePath(), + this); continue; } } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java index 1e9df78ba..3fe8f1137 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskListWriter.java @@ -322,7 +322,7 @@ public class TaskListWrit |