summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-07-30 05:48:28 (EDT)
committer Gerrit Code Review @ Eclipse.org2013-07-30 06:17:02 (EDT)
commit32fcdb827173d44a0ba16522e22eeee39522c28c (patch)
tree8e5e05c75f2a3307ce703948b9dbdc17f8a223e1
parent107918bfc6acdbfd831c2a5df79a569af43efe94 (diff)
downloadorg.eclipse.mylyn.reviews-32fcdb827173d44a0ba16522e22eeee39522c28c.zip
org.eclipse.mylyn.reviews-32fcdb827173d44a0ba16522e22eeee39522c28c.tar.gz
org.eclipse.mylyn.reviews-32fcdb827173d44a0ba16522e22eeee39522c28c.tar.bz2
fail if httpMethod is something else than expected GET or POSTrefs/changes/56/14956/2
Change-Id: I331a54c7c258bd22fadcfeb73d0a0bbdc2d3f9e1 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java1
1 files changed, 1 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java
index 8577137..8a70074 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java
@@ -139,6 +139,7 @@ public class GerritHttpClient {
} else if (httpMethod == HttpMethod.GET) {
method = new GetMethod(getUrl() + serviceUri);
}
+ Assert.isNotNull(method, "Failed to create method for " + httpMethod); //$NON-NLS-1$
method.setRequestHeader("Content-Type", "application/json; charset=utf-8"); //$NON-NLS-1$//$NON-NLS-2$
method.setRequestHeader("Accept", "application/json"); //$NON-NLS-1$//$NON-NLS-2$