修复一个奇怪的bug
This commit is contained in:
parent
a631f1447e
commit
50b01790af
8
pom.xml
8
pom.xml
@ -56,14 +56,8 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<source>1.7</source>
|
<source>1.7</source>
|
||||||
<target>1.7</target>
|
<target>1.7</target>
|
||||||
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
<dependencies>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.codehaus.plexus</groupId>
|
|
||||||
<artifactId>plexus-compiler-javac</artifactId>
|
|
||||||
<version>2.5</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
|||||||
@ -13,6 +13,11 @@ import org.apache.commons.httpclient.HttpClient;
|
|||||||
*/
|
*/
|
||||||
public class HttpComponent3Factory extends HttpClientFactory {
|
public class HttpComponent3Factory extends HttpClientFactory {
|
||||||
|
|
||||||
|
public HttpComponent3Factory() {
|
||||||
|
// odd bug
|
||||||
|
Class _ = HttpClient.class;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public com.foxinmy.weixin4j.http.HttpClient newInstance() {
|
public com.foxinmy.weixin4j.http.HttpClient newInstance() {
|
||||||
return new HttpComponent3(new HttpClient());
|
return new HttpComponent3(new HttpClient());
|
||||||
|
|||||||
@ -15,10 +15,15 @@ import com.foxinmy.weixin4j.http.HttpClient;
|
|||||||
*/
|
*/
|
||||||
public class HttpComponent4Factory extends HttpClientFactory {
|
public class HttpComponent4Factory extends HttpClientFactory {
|
||||||
|
|
||||||
|
private final VersionInfo version;
|
||||||
|
|
||||||
|
public HttpComponent4Factory() {
|
||||||
|
version = VersionInfo.loadVersionInfo("org.apache.http.client",
|
||||||
|
HttpClient.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpClient newInstance() {
|
public HttpClient newInstance() {
|
||||||
VersionInfo version = VersionInfo.loadVersionInfo(
|
|
||||||
"org.apache.http.client", HttpClient.class.getClassLoader());
|
|
||||||
String release = (version != null) ? version.getRelease()
|
String release = (version != null) ? version.getRelease()
|
||||||
: VersionInfo.UNAVAILABLE;
|
: VersionInfo.UNAVAILABLE;
|
||||||
if (release.startsWith("4.")) {
|
if (release.startsWith("4.")) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user