Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-06-26 17:13:15 -0400
committerrelves2007-06-26 17:13:15 -0400
commitd5b3fe308dafbb2c40f923c274b32910890fa9a5 (patch)
treeef578e92eb989ddad4ac9818554bbe7f3793c18d
parent58fcd6fd91b673dec9522ca054e971310d2f7ed5 (diff)
downloadorg.eclipse.mylyn.tasks-d5b3fe308dafbb2c40f923c274b32910890fa9a5.tar.gz
org.eclipse.mylyn.tasks-d5b3fe308dafbb2c40f923c274b32910890fa9a5.tar.xz
org.eclipse.mylyn.tasks-d5b3fe308dafbb2c40f923c274b32910890fa9a5.zip
NEW - bug 194468: Error while attaching large context along with a patch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=194468
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java19
1 files changed, 14 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 078dee213..639674150 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -591,6 +591,9 @@ public class BugzillaClient {
public void postAttachment(String bugReportID, String comment, ITaskAttachment attachment) throws HttpException,
IOException, CoreException {
+
+ // TODO: Throw IllegalArgumentException if passed null parameter
+
WebClientUtil.setupHttpClient(httpClient, proxy, repositoryUrl.toString(), htAuthUser, htAuthPass);
if (!authenticated && hasAuthenticationCredentials()) {
authenticate();
@@ -607,12 +610,18 @@ public class BugzillaClient {
postMethod.getParams().setBooleanParameter(HttpMethodParams.USE_EXPECT_CONTINUE, true);
List<PartBase> parts = new ArrayList<PartBase>();
parts.add(new StringPart(IBugzillaConstants.POST_INPUT_ACTION, VALUE_ACTION_INSERT, characterEncoding));
- parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGZILLA_LOGIN, username, characterEncoding));
- parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGZILLA_PASSWORD, password, characterEncoding));
+ if (username != null && password != null) {
+ parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGZILLA_LOGIN, username, characterEncoding));
+ parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGZILLA_PASSWORD, password, characterEncoding));
+ }
parts.add(new StringPart(IBugzillaConstants.POST_INPUT_BUGID, bugReportID, characterEncoding));
- parts.add(new StringPart(IBugzillaConstants.POST_INPUT_DESCRIPTION, attachment.getDescription(),
- characterEncoding));
- parts.add(new StringPart(IBugzillaConstants.POST_INPUT_COMMENT, comment, characterEncoding));
+ if (attachment.getDescription() != null) {
+ parts.add(new StringPart(IBugzillaConstants.POST_INPUT_DESCRIPTION, attachment.getDescription(),
+ characterEncoding));
+ }
+ if (comment != null) {
+ parts.add(new StringPart(IBugzillaConstants.POST_INPUT_COMMENT, comment, characterEncoding));
+ }
parts.add(new FilePart(IBugzillaConstants.POST_INPUT_DATA, new AttachmentPartSource(attachment)));
if (attachment.isPatch()) {

Back to the top