修复一个奇怪的bug

This commit is contained in:
jinyu
2015-09-21 21:51:50 +08:00
parent a631f1447e
commit 50b01790af
3 changed files with 13 additions and 9 deletions
@@ -13,6 +13,11 @@ import org.apache.commons.httpclient.HttpClient;
*/
public class HttpComponent3Factory extends HttpClientFactory {
public HttpComponent3Factory() {
// odd bug
Class _ = HttpClient.class;
}
@Override
public com.foxinmy.weixin4j.http.HttpClient newInstance() {
return new HttpComponent3(new HttpClient());
@@ -14,11 +14,16 @@ import com.foxinmy.weixin4j.http.HttpClient;
* @see
*/
public class HttpComponent4Factory extends HttpClientFactory {
private final VersionInfo version;
public HttpComponent4Factory() {
version = VersionInfo.loadVersionInfo("org.apache.http.client",
HttpClient.class.getClassLoader());
}
@Override
public HttpClient newInstance() {
VersionInfo version = VersionInfo.loadVersionInfo(
"org.apache.http.client", HttpClient.class.getClassLoader());
String release = (version != null) ? version.getRelease()
: VersionInfo.UNAVAILABLE;
if (release.startsWith("4.")) {