summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2018-05-12 10:18:31 -0400
committerFrank Becker2018-06-16 08:53:52 -0400
commit312f9cbad2b82bd71a50b58ed8587df2a6254045 (patch)
tree31171df9a97a29685140eea076fec27c6d7e8c60
parent50b259f33cc33e5537be1076e87686102dfb77f2 (diff)
downloadorg.eclipse.mylyn.tasks-312f9cbad2b82bd71a50b58ed8587df2a6254045.tar.gz
org.eclipse.mylyn.tasks-312f9cbad2b82bd71a50b58ed8587df2a6254045.tar.xz
org.eclipse.mylyn.tasks-312f9cbad2b82bd71a50b58ed8587df2a6254045.zip
534407: BugzillaRestPostNewTask.TaskAttributeTypeAdapter.write wrong
compare Change-Id: I646170c7d5f1cbcb0d8a082a9c0b310d09c1b9a5 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=534407
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPostNewTask.java19
-rw-r--r--connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core/src/org/eclipse/mylyn/internal/bugzilla/rest/core/BugzillaRestPutUpdateTask.java3
2 files changed, 8 insertions, 14 deletions
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 c18e43ff5..9c13aefff 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 @@ public class BugzillaRestPostNewTask extends BugzillaRestPostRequest<BugzillaRes
}
@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 @@ public class BugzillaRestPostNewTask extends BugzillaRestPostRequest<BugzillaRes
} 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 81d22a9a6..1d4579424 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 @@ public class BugzillaRestPutUpdateTask extends BugzillaRestPutRequest<PutUpdateR
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());