@@ -35,33 +35,31 @@ public MvcHandlerCompilerRunner(Object instance) throws Exception {
3535 .compilesWithoutError ();
3636 }
3737
38- public MvcHandlerCompilerRunner compile (String executableName , Class [] args ,
38+ public MvcHandlerCompilerRunner compile (String path ,
3939 SneakyThrows .Consumer <Route .Handler > consumer ) throws Exception {
40- return compile ("GET" , executableName , args , false , consumer );
40+ return compile (path , false , consumer );
4141 }
4242
43- public MvcHandlerCompilerRunner compile (String httpMethod , String executableName , Class [] args ,
43+ public MvcHandlerCompilerRunner compile (String path , boolean debug ,
4444 SneakyThrows .Consumer <Route .Handler > consumer ) throws Exception {
45- return compile (httpMethod , executableName , args , false , consumer );
45+ return compile ("GET" , path , debug , consumer );
4646 }
4747
48- public MvcHandlerCompilerRunner compile (String executableName , Class [] args , boolean debug ,
48+ public MvcHandlerCompilerRunner compile (String method , String path ,
4949 SneakyThrows .Consumer <Route .Handler > consumer ) throws Exception {
50- return compile ("GET" , executableName , args , debug , consumer );
50+ return compile (method , path , false , consumer );
5151 }
5252
53- public MvcHandlerCompilerRunner compile (String httpMethod , String executableName , Class [] args , boolean debug ,
53+ public MvcHandlerCompilerRunner compile (String method , String path , boolean debug ,
5454 SneakyThrows .Consumer <Route .Handler > consumer ) throws Exception {
55- Class clazz = instance .getClass ();
56- Method method = clazz .getMethod (executableName , args );
57- String key = clazz .getName () + "." + executableName + Type .getMethodDescriptor (method );
58- // key = key.replace("[B", "Lbyte[];");
55+ String key = method .toUpperCase () + path ;
56+ // key = key.replace("[B", "Lbyte[];");
5957 MvcHandlerCompiler compiler = processor .compilerFor (key );
60- assertNotNull ("Compiler not found for: " + method , compiler );
58+ assertNotNull ("Compiler not found for: " + key , compiler );
6159 if (debug ) {
6260 System .out .println (compiler );
6361 }
64- String handlerName = clazz . getName () + "$" + httpMethod + "$" + executableName ;
62+ String handlerName = compiler . getGeneratedClass () ;
6563 Class <? extends Route .Handler > handleClass = compileClass (handlerName , compiler .compile ());
6664 Constructor <? extends Route .Handler > constructor = handleClass
6765 .getDeclaredConstructor (Provider .class );
0 commit comments