534407: BugzillaRestPostNewTask.TaskAttributeTypeAdapter.write wrong
compare

Change-Id: I646170c7d5f1cbcb0d8a082a9c0b310d09c1b9a5
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=534407
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
index c18e43f..9c13aef 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java
@@ -62,19 +62,16 @@
 		}
 
 		@Override
-		public void write(JsonWriter out, TaskData value) throws IOException {
+		public void write(JsonWriter out, TaskData taskData) throws IOException {
 			out.beginObject();
 			addAuthenticationToGson(out, location);
 			for (Object element : taskData.getRoot().getAttributes().values()) {
 				TaskAttribute taskAttribute = (TaskAttribute) element;
 				String id = taskAttribute.getId();
-				String value1 = BugzillaRestGsonUtil.convertString2GSonString(taskAttribute.getValue());
+				String attributValue = BugzillaRestGsonUtil.convertString2GSonString(taskAttribute.getValue());
 				if (legalCreateAttributes.contains(id) || id.startsWith("cf_")) { //$NON-NLS-1$
 					id = BugzillaRestCreateTaskSchema.getFieldNameFromAttributeName(id);
-					if (id.equals("status") //$NON-NLS-1$
-							&& (value != null && value.equals(TaskAttribute.PREFIX_OPERATION + "default"))) { //$NON-NLS-1$
-						continue;
-					} else if (id.equals("cc")) { //$NON-NLS-1$
+					if (id.equals("cc")) { //$NON-NLS-1$
 						HashSet<String> setNew = new HashSet<String>(
 								Arrays.asList(taskAttribute.getValue().split("\\s*,\\s*"))); //$NON-NLS-1$
 						BugzillaRestGsonUtil.buildArrayFromHash(out, id, setNew, false);
@@ -91,21 +88,21 @@
 					} else {
 
 						if (id.equals(BugzillaRestCreateTaskSchema.getDefault().KEYWORDS.getKey())) {
-							value1 = taskAttribute.getValues().toString();
-							value1 = value1.substring(1, value1.length() - 1);
+							attributValue = taskAttribute.getValues().toString();
+							attributValue = attributValue.substring(1, attributValue.length() - 1);
 						}
 
 						if (taskAttribute.getMetaData().getType() != null
 								&& taskAttribute.getMetaData().getType().equals(TaskAttribute.TYPE_MULTI_SELECT)) {
 							List<String> values = taskAttribute.getValues();
 							int ii = 0;
-							value1 = ""; //$NON-NLS-1$
+							attributValue = ""; //$NON-NLS-1$
 							for (String string : values) {
 								string = BugzillaRestGsonUtil.convertString2GSonString(string);
-								value1 += ((ii++ == 0 ? "" : ",") + string); //$NON-NLS-1$ //$NON-NLS-2$
+								attributValue += ((ii++ == 0 ? "" : ",") + string); //$NON-NLS-1$ //$NON-NLS-2$
 							}
 						}
-						out.name(id).value(value1);
+						out.name(id).value(attributValue);
 						if (id.equals("description")) { //$NON-NLS-1$
 							TaskAttribute descriptionpri = taskAttribute.getAttribute(
 									BugzillaRestCreateTaskSchema.getDefault().DESCRIPTION_IS_PRIVATE.getKey());
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
index 81d22a9..1d45794 100644
--- a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
+++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java
@@ -107,9 +107,6 @@
 		if ((legalUpdateAttributes.contains(id) || id.startsWith("cf_")) && value != null) { //$NON-NLS-1$
 			id = BugzillaRestTaskSchema.getFieldNameFromAttributeName(id);
 			if (id.equals("status")) { //$NON-NLS-1$
-				if (value != null && value.equals(TaskAttribute.PREFIX_OPERATION + "default")) { //$NON-NLS-1$
-					return;
-				}
 				if (value.equals("duplicate")) { //$NON-NLS-1$
 					TaskAttribute res = element.getParentAttribute()
 							.getAttribute(BugzillaRestTaskSchema.getDefault().RESOLUTION.getKey());