Clover Coverage Report - Atlassian XWork(Aggregated)
Coverage timestamp: Wed Jul 27 2011 23:39:31 CDT
9   41   4   4.5
0   32   0.44   2
2     2  
1    
 
 
  Xwork12VersionSupport       Line # 12 9 4 45.5% 0.45454547
 
  (1)
 
1    package com.atlassian.xwork12;
2   
3    import com.atlassian.xwork.XWorkVersionSupport;
4    import com.opensymphony.xwork.Action;
5    import com.opensymphony.xwork.ActionInvocation;
6   
7    import java.lang.reflect.Method;
8   
9    /**
10    * Wrapper for functions specific to XWork 1.2
11    */
 
12    public class Xwork12VersionSupport implements XWorkVersionSupport
13    {
 
14  0 toggle public Action extractAction(ActionInvocation invocation)
15    {
16  0 return (Action) invocation.getAction();
17    }
18   
 
19  1 toggle public Method extractMethod(ActionInvocation invocation) throws NoSuchMethodException
20    {
21  1 final Class<?> actionClass = invocation.getAction().getClass();
22  1 final String methodName = invocation.getProxy().getMethod();
23   
24  1 try
25    {
26  1 return actionClass.getMethod(methodName);
27    }
28    catch (NoSuchMethodException e)
29    {
30  0 try
31    {
32  0 String altMethodName = "do" + methodName.substring(0, 1).toUpperCase() + methodName.substring(1);
33  0 return actionClass.getMethod(altMethodName);
34    }
35    catch (NoSuchMethodException e1) {
36    // throw the original one
37  0 throw e;
38    }
39    }
40    }
41    }