修复一个奇怪的bug
This commit is contained in:
+5
@@ -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());
|
||||
|
||||
+7
-2
@@ -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.")) {
|
||||
|
||||
Reference in New Issue
Block a user