Code example for Method

Methods: invoke, setAccessible

0
                // test s is a SocketChannelImpl$SocketAdapter which isn't 
                // accessible to Killer so an IllegalAccessException was thrown 
                // on RoboVM. invoke() on Android doesn't seem to do enough 
                // security checks since the code apparently worked on Dalvik. 
                Method m = s.getClass().getMethod("close");
                m.setAccessible(true);
                m.invoke(s);
            } catch (Exception ex) {
                ex.printStackTrace();
            } 
        } 
    } 
}