MCPcopy Create free account
hub / github.com/LFYSec/MScan / invokePrint

Method invokePrint

src/test/resources/pta/reflection/ArgsRefine.java:9–17  ·  view source on GitHub ↗
(Class<?>[] paramTypes)

Source from the content-addressed store, hash-verified

7 }
8
9 static void invokePrint(Class<?>[] paramTypes) throws Exception {
10 Class bClass = Class.forName("B");
11 Method print = bClass.getMethod("print", paramTypes);
12 B b = new B();
13 print.invoke(b, new Object[]{"hello", "hello"}); // <B: void print(Object,Object)>
14 print.invoke(b, "hello", "hello"); // <B: void print(Object,Object)>
15 Method printNoArg = bClass.getMethod("print");
16 print.invoke(b); // <B: void print()>
17 }
18}
19
20class B {

Callers 1

mainMethod · 0.95

Calls 2

getMethodMethod · 0.65
invokeMethod · 0.45

Tested by

no test coverage detected