mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-21 02:57:37 +08:00
正确处理InterruptException
Sonar-2142: "InterruptedException" should not be ignored
This commit is contained in:
@@ -76,7 +76,7 @@ public class WxMessageInMemoryDuplicateChecker implements WxMessageDuplicateChec
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -196,6 +196,7 @@ public class StandardSessionManager implements WxSessionManager, InternalSession
|
||||
Thread.sleep(StandardSessionManager.this.backgroundProcessorDelay * 1000L);
|
||||
backgroundProcess();
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
StandardSessionManager.this.log.error("SessionManagerImpl.backgroundProcess error", e);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,9 @@
|
||||
package me.chanjar.weixin.common.util.http.apache;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.annotation.NotThreadSafe;
|
||||
@@ -25,10 +29,6 @@ import org.apache.http.protocol.HttpContext;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* httpclient 连接管理器 自带DNS解析.
|
||||
* <p>大部分代码拷贝自:DefaultApacheHttpClientBuilder</p>
|
||||
@@ -292,6 +292,7 @@ public class ApacheHttpDnsClientBuilder implements ApacheHttpClientBuilder {
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException ignore) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user