return null;
}
// ok - compute compatible policy
HTTPClientPolicy p = new HTTPClientPolicy();
p.setAccept(combine(p1.getAccept(), p2.getAccept()));
p.setAcceptEncoding(combine(p1.getAcceptEncoding(), p2.getAcceptEncoding()));
p.setAcceptLanguage(combine(p1.getAcceptLanguage(), p2.getAcceptLanguage()));
if (p1.isSetAllowChunking()) {
p.setAllowChunking(p1.isAllowChunking());
} else if (p2.isSetAllowChunking()) {
p.setAllowChunking(p2.isAllowChunking());
}
if (p1.isSetAutoRedirect()) {
p.setAutoRedirect(p1.isAutoRedirect());
} else if (p2.isSetAutoRedirect()) {
p.setAutoRedirect(p2.isAutoRedirect());
}
p.setBrowserType(combine(p1.getBrowserType(), p2.getBrowserType()));
if (p1.isSetCacheControl()) {
p.setCacheControl(p1.getCacheControl());
} else if (p2.isSetCacheControl()) {
p.setCacheControl(p2.getCacheControl());
}
if (p1.isSetConnection()) {
p.setConnection(p1.getConnection());
} else if (p2.isSetConnection()) {
p.setConnection(p2.getConnection());
}
if (p1.isSetContentType()) {
p.setContentType(p1.getContentType());
} else if (p2.isSetContentType()) {
p.setContentType(p2.getContentType());
}
p.setCookie(combine(p1.getCookie(), p2.getCookie()));
p.setDecoupledEndpoint(combine(p1.getDecoupledEndpoint(), p2.getDecoupledEndpoint()));
p.setHost(combine(p1.getHost(), p2.getHost()));
p.setProxyServer(combine(p1.getProxyServer(), p2.getProxyServer()));
if (p1.isSetProxyServerPort()) {
p.setProxyServerPort(p1.getProxyServerPort());
} else if (p2.isSetProxyServerPort()) {
p.setProxyServerPort(p2.getProxyServerPort());
}
if (p1.isSetProxyServerType()) {
p.setProxyServerType(p1.getProxyServerType());
} else if (p2.isSetProxyServerType()) {
p.setProxyServerType(p2.getProxyServerType());
}
p.setReferer(combine(p1.getReferer(), p2.getReferer()));
if (p1.isSetConnectionTimeout() || p2.isSetConnectionTimeout()) {
p.setConnectionTimeout(Math.min(p1.getConnectionTimeout(), p2.getConnectionTimeout()));
}
if (p1.isSetReceiveTimeout() || p2.isSetReceiveTimeout()) {
p.setReceiveTimeout(Math.min(p1.getReceiveTimeout(), p2.getReceiveTimeout()));
}
return p;
}