Skip to content

Commit 30e106a

Browse files
author
Stephane Landelle
committed
Clean up warnings
1 parent cb4b4c4 commit 30e106a

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed

api/src/main/java/org/asynchttpclient/AsyncHttpClientConfigDefaults.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414

1515
import static org.asynchttpclient.util.MiscUtils.getBoolean;
1616

17-
import org.asynchttpclient.util.DefaultHostnameVerifier;
18-
19-
import javax.net.ssl.HostnameVerifier;
20-
2117
public final class AsyncHttpClientConfigDefaults {
2218

2319
private AsyncHttpClientConfigDefaults() {

api/src/main/java/org/asynchttpclient/util/ProxyHostnameChecker.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public ProxyHostnameChecker() {
3333
private Object getHostnameChecker() {
3434
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
3535
try {
36+
@SuppressWarnings("unchecked")
3637
final Class<Object> hostnameCheckerClass = (Class<Object>) classLoader.loadClass("sun.security.util.HostnameChecker");
3738
final Method instanceMethod = hostnameCheckerClass.getMethod("getInstance", Byte.TYPE);
3839
return instanceMethod.invoke(null, TYPE_TLS);

api/src/test/java/org/asynchttpclient/async/util/TestUtils.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import static org.testng.Assert.assertEquals;
44

55
import org.apache.commons.io.FileUtils;
6-
import org.asynchttpclient.async.HostnameVerifierTest;
76
import org.asynchttpclient.util.StandardCharsets;
87
import org.eclipse.jetty.security.ConstraintMapping;
98
import org.eclipse.jetty.security.ConstraintSecurityHandler;

api/src/test/java/org/asynchttpclient/websocket/CloseCodeReasonMessageTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public void wrongStatusCode() throws Throwable {
109109
final CountDownLatch latch = new CountDownLatch(1);
110110
final AtomicReference<Throwable> throwable = new AtomicReference<Throwable>();
111111

112-
WebSocket websocket = c.prepareGet("http://apache.org/").execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketTextListener() {
112+
c.prepareGet("http://apache.org/").execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketTextListener() {
113113

114114
@Override
115115
public void onMessage(String message) {
@@ -149,7 +149,7 @@ public void wrongProtocolCode() throws Throwable {
149149
final CountDownLatch latch = new CountDownLatch(1);
150150
final AtomicReference<Throwable> throwable = new AtomicReference<Throwable>();
151151

152-
WebSocket websocket = c.prepareGet("ws://www.google.com").execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketTextListener() {
152+
c.prepareGet("ws://www.google.com").execute(new WebSocketUpgradeHandler.Builder().addWebSocketListener(new WebSocketTextListener() {
153153

154154
@Override
155155
public void onMessage(String message) {

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyConnectListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private void writeRequest(Channel channel) {
8787
public void onFutureSuccess(final Channel channel) throws ConnectException {
8888
Channels.setAttribute(channel, future);
8989
final HostnameVerifier hostnameVerifier = config.getHostnameVerifier();
90-
final SslHandler sslHandler = channelManager.getSslHandler(channel.pipeline());
90+
final SslHandler sslHandler = ChannelManager.getSslHandler(channel.pipeline());
9191
if (hostnameVerifier != null && sslHandler != null) {
9292
final String host = future.getURI().getHost();
9393
sslHandler.handshakeFuture().addListener(new GenericFutureListener<Future<? super Channel>>() {

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/NettyRequestSender.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ private <T> ListenableFuture<T> sendRequestWithCertainForceConnect(//
141141
* until we get a valid channel from the pool and it's still valid once the
142142
* request is built
143143
*/
144+
@SuppressWarnings("unused")
144145
private <T> ListenableFuture<T> sendRequestThroughSslProxy(//
145146
Request request,//
146147
AsyncHandler<T> asyncHandler,//
@@ -443,6 +444,7 @@ public boolean applyIoExceptionFiltersAndReplayRequest(NettyResponseFuture<?> fu
443444

444445
boolean replayed = false;
445446

447+
@SuppressWarnings({ "unchecked", "rawtypes" })
446448
FilterContext<?> fc = new FilterContext.FilterContextBuilder().asyncHandler(future.getAsyncHandler()).request(future.getRequest()).ioException(e).build();
447449
for (IOExceptionFilter asyncFilter : config.getIOExceptionFilters()) {
448450
try {

providers/netty/src/main/java/org/asynchttpclient/providers/netty/request/body/NettyBodyBody.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import org.asynchttpclient.RandomAccessBody;
2020
import org.asynchttpclient.providers.netty.NettyAsyncHttpProviderConfig;
2121
import org.asynchttpclient.providers.netty.channel.ChannelManager;
22-
import org.asynchttpclient.providers.netty.channel.Channels;
2322
import org.asynchttpclient.providers.netty.future.NettyResponseFuture;
2423
import org.asynchttpclient.providers.netty.request.ProgressListener;
2524
import org.asynchttpclient.providers.netty.request.body.FeedableBodyGenerator.FeedListener;

0 commit comments

Comments
 (0)