Fix unchecked warnings
This commit is contained in:
parent
9f2c1c4774
commit
c77bac44a2
|
@ -26,7 +26,7 @@ import org.osgi.util.tracker.ServiceTracker;
|
||||||
*/
|
*/
|
||||||
public class OsgiLoggerFactory extends InternalLoggerFactory {
|
public class OsgiLoggerFactory extends InternalLoggerFactory {
|
||||||
|
|
||||||
private final ServiceTracker logServiceTracker;
|
private final ServiceTracker<LogService, LogService> logServiceTracker;
|
||||||
private final InternalLoggerFactory fallback;
|
private final InternalLoggerFactory fallback;
|
||||||
volatile LogService logService;
|
volatile LogService logService;
|
||||||
|
|
||||||
|
@ -46,18 +46,17 @@ public class OsgiLoggerFactory extends InternalLoggerFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fallback = fallback;
|
this.fallback = fallback;
|
||||||
logServiceTracker = new ServiceTracker(
|
logServiceTracker = new ServiceTracker<LogService, LogService>(
|
||||||
ctx, "org.osgi.service.log.LogService", null) {
|
ctx, "org.osgi.service.log.LogService", null) {
|
||||||
@Override
|
@Override
|
||||||
public Object addingService(ServiceReference reference) {
|
public LogService addingService(ServiceReference<LogService> reference) {
|
||||||
LogService service = (LogService) super.addingService(reference);
|
LogService service = super.addingService(reference);
|
||||||
logService = service;
|
logService = service;
|
||||||
return service;
|
return service;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removedService(ServiceReference reference,
|
public void removedService(ServiceReference<LogService> reference, LogService service) {
|
||||||
Object service) {
|
|
||||||
logService = null;
|
logService = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package io.netty.testsuite.transport.socket;
|
package io.netty.testsuite.transport.socket;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import io.netty.bootstrap.AbstractBootstrap;
|
import io.netty.bootstrap.AbstractBootstrap;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
|
@ -26,13 +25,14 @@ import io.netty.channel.socket.DatagramChannel;
|
||||||
import io.netty.channel.socket.DatagramPacket;
|
import io.netty.channel.socket.DatagramPacket;
|
||||||
import io.netty.channel.socket.oio.OioDatagramChannel;
|
import io.netty.channel.socket.oio.OioDatagramChannel;
|
||||||
import io.netty.util.NetworkConstants;
|
import io.netty.util.NetworkConstants;
|
||||||
|
import org.junit.Ignore;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.junit.Ignore;
|
import static org.junit.Assert.*;
|
||||||
import org.junit.Test;
|
|
||||||
|
|
||||||
public class DatagramMulticastTest extends AbstractDatagramTest {
|
public class DatagramMulticastTest extends AbstractDatagramTest {
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@ public class DatagramMulticastTest extends AbstractDatagramTest {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testMulticast(AbstractBootstrap sb, AbstractBootstrap cb) throws Throwable {
|
public void testMulticast(AbstractBootstrap<?> sb, AbstractBootstrap<?> cb) throws Throwable {
|
||||||
MulticastTestHandler mhandler = new MulticastTestHandler();
|
MulticastTestHandler mhandler = new MulticastTestHandler();
|
||||||
|
|
||||||
sb.handler(new ChannelInboundMessageHandlerAdapter<DatagramPacket>() {
|
sb.handler(new ChannelInboundMessageHandlerAdapter<DatagramPacket>() {
|
||||||
|
|
|
@ -15,18 +15,18 @@
|
||||||
*/
|
*/
|
||||||
package io.netty.testsuite.transport.socket;
|
package io.netty.testsuite.transport.socket;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
|
||||||
import io.netty.bootstrap.AbstractBootstrap;
|
import io.netty.bootstrap.AbstractBootstrap;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.Channel;
|
import io.netty.channel.Channel;
|
||||||
import io.netty.channel.ChannelHandlerContext;
|
import io.netty.channel.ChannelHandlerContext;
|
||||||
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
import io.netty.channel.ChannelInboundMessageHandlerAdapter;
|
||||||
import io.netty.channel.socket.DatagramPacket;
|
import io.netty.channel.socket.DatagramPacket;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
import org.junit.Test;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class DatagramUnicastTest extends AbstractDatagramTest {
|
public class DatagramUnicastTest extends AbstractDatagramTest {
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ public class DatagramUnicastTest extends AbstractDatagramTest {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testSimpleSend(AbstractBootstrap sb, AbstractBootstrap cb) throws Throwable {
|
public void testSimpleSend(AbstractBootstrap<?> sb, AbstractBootstrap<?> cb) throws Throwable {
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
|
|
||||||
sb.handler(new ChannelInboundMessageHandlerAdapter<DatagramPacket>() {
|
sb.handler(new ChannelInboundMessageHandlerAdapter<DatagramPacket>() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user