Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2006-11-22 00:24:02 -0500
committerspingel2006-11-22 00:24:02 -0500
commit30b1b857b1ab547e14f4f08ac58be5d0c5abad9f (patch)
tree8588bb16c0f09bcd82c6e11982a5b6ae815126a2 /org.eclipse.mylyn.trac.core/src
parenta32471471f9e0cc8ffc54e13b9bf096dda99c8c0 (diff)
downloadorg.eclipse.mylyn.tasks-30b1b857b1ab547e14f4f08ac58be5d0c5abad9f.tar.gz
org.eclipse.mylyn.tasks-30b1b857b1ab547e14f4f08ac58be5d0c5abad9f.tar.xz
org.eclipse.mylyn.tasks-30b1b857b1ab547e14f4f08ac58be5d0c5abad9f.zip
RESOLVED - bug 155151: attach context check box in Trac rich editor does not work
https://bugs.eclipse.org/bugs/show_bug.cgi?id=155151
Diffstat (limited to 'org.eclipse.mylyn.trac.core/src')
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/AbstractTracClient.java1
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/util/TracHttpClientTransportFactory.java48
2 files changed, 23 insertions, 26 deletions
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/AbstractTracClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/AbstractTracClient.java
index 146b28d06..ad01317f3 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/AbstractTracClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/AbstractTracClient.java
@@ -58,7 +58,6 @@ public abstract class AbstractTracClient implements ITracClient {
return username != null && username.length() > 0;
}
-
public TracComponent[] getComponents() {
return (data.components != null) ? data.components.toArray(new TracComponent[0]) : null;
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/util/TracHttpClientTransportFactory.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/util/TracHttpClientTransportFactory.java
index 9d3e6b342..e620a4888 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/util/TracHttpClientTransportFactory.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/util/TracHttpClientTransportFactory.java
@@ -26,7 +26,7 @@ import org.apache.xmlrpc.client.XmlRpcClientException;
import org.apache.xmlrpc.client.XmlRpcCommonsTransport;
import org.apache.xmlrpc.client.XmlRpcHttpClientConfig;
import org.apache.xmlrpc.client.XmlRpcTransport;
-import org.apache.xmlrpc.client.XmlRpcTransportFactoryImpl;
+import org.apache.xmlrpc.client.XmlRpcTransportFactory;
import org.eclipse.mylar.internal.tasks.core.WebClientUtil;
/**
@@ -35,7 +35,7 @@ import org.eclipse.mylar.internal.tasks.core.WebClientUtil;
*
* @author Steffen Pingel
*/
-public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
+public class TracHttpClientTransportFactory implements XmlRpcTransportFactory {
public static class TracHttpException extends XmlRpcException {
@@ -58,7 +58,6 @@ public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
super(client);
XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) client.getConfig();
-
// this needs to be set to avoid exceptions
getHttpClient().getParams().setAuthenticationPreemptive(config.getBasicUserName() != null);
}
@@ -67,16 +66,6 @@ public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
return (HttpClient) getValue("client");
}
- @Override
- protected InputStream getInputStream() throws XmlRpcException {
- int responseCode = getMethod().getStatusCode();
- if (responseCode != HttpURLConnection.HTTP_OK) {
- throw new TracHttpException(responseCode);
- }
-
- return super.getInputStream();
- }
-
public PostMethod getMethod() {
return (PostMethod) getValue("method");
}
@@ -91,7 +80,7 @@ public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
field.setAccessible(true);
return field.get(this);
} catch (Throwable t) {
- throw new RuntimeException("Internal error accessing HttpClient", t);
+ throw new RuntimeException("Internal error accessing field: " + name, t);
}
}
@@ -101,10 +90,20 @@ public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
field.setAccessible(true);
field.set(this, value);
} catch (Throwable t) {
- throw new RuntimeException("Internal error accessing HttpClient", t);
+ throw new RuntimeException("Internal error accessing field: " + name, t);
}
}
+
+ @Override
+ protected InputStream getInputStream() throws XmlRpcException {
+ int responseCode = getMethod().getStatusCode();
+ if (responseCode != HttpURLConnection.HTTP_OK) {
+ throw new TracHttpException(responseCode);
+ }
+ return super.getInputStream();
+ }
+
@Override
protected void initHttpHeaders(XmlRpcRequest request) throws XmlRpcClientException {
// super call needed to initialize private fields of XmlRpcCommonsTransport
@@ -148,24 +147,23 @@ public class TracHttpClientTransportFactory extends XmlRpcTransportFactoryImpl {
}
- private final TracHttpClientTransport transport;
+ private XmlRpcClient client;
+ private Proxy proxy;
public TracHttpClientTransportFactory(XmlRpcClient client) {
- super(client);
-
- transport = new TracHttpClientTransport(client);
+ this.client = client;
}
public XmlRpcTransport getTransport() {
- return transport;
+ return new TracHttpClientTransport(client);
}
- public void setProxy(Proxy proxy) {
- transport.setProxy(proxy);
+ public Proxy getProxy() {
+ return proxy;
}
- public Proxy getProxy() {
- return transport.getProxy();
+ public void setProxy(Proxy proxy) {
+ this.proxy = proxy;
}
-
+
}

Back to the top