Skip to content

Commit 46d1367

Browse files
committed
Fixed compiler unchecked warning
1 parent 4861aad commit 46d1367

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/cooja/java/se/sics/cooja/MoteInterfaceHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ public MoteInterfaceHandler(Mote mote, Class<? extends MoteInterface>[] interfac
105105
*/
106106
public <N extends MoteInterface> N getInterfaceOfType(Class<N> interfaceType) {
107107
for (MoteInterface intf : moteInterfaces) {
108-
if (interfaceType.isAssignableFrom(intf.getClass())) {
109-
return (N) intf;
108+
if (interfaceType.isInstance(intf)) {
109+
return interfaceType.cast(intf);
110110
}
111111
}
112112

0 commit comments

Comments
 (0)