// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// public final class FlowInstanceDescriptorHolder implements Serializable{
//     private static final long serialVersionUID = 969547478248429191L;
//     private static final String STRATEGY_THREADLOCAL = "threadlocal";
//     private static Map<String, FlowInstanceDescriptorHolderStrategy> strategies;
//     private static String currentStrategy;
// 
//     static {
//         strategies = new HashMap<String, FlowInstanceDescriptorHolderStrategy>();
//         strategies.put(STRATEGY_THREADLOCAL, new ThreadLocalFlowInstanceDescriptorHolderStrategy());
//         currentStrategy = STRATEGY_THREADLOCAL;
//     }
// 
//     private static FlowInstanceDescriptorHolderStrategy getStrategy() {
//         return strategies.get(currentStrategy);
//     }
// 
//     public static void setStrategy(String strategy) {
//         Assert.notNull(currentStrategy, "The 'currentStrategy' argument must not be null.");
//         currentStrategy = strategy;
//     }
// 
//     @SuppressWarnings({"unchecked"})
//     public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//         return (T) getStrategy().getDescriptor();
//     }
// 
//     public static void setFlowInstanceDescriptor(FlowInstanceDescriptor descriptor) {
//         getStrategy().setDescriptor(descriptor);
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/TransitionActionContext.java
// public final class TransitionActionContext implements Serializable{
//     private static final long serialVersionUID = -2438974871913081078L;
//     private String targetStateId;
//     private Object[] arguments;
// 
//     public TransitionActionContext(String targetStateId, Object[] arguments) {
//         this.targetStateId = targetStateId;
//         this.arguments = arguments;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public String getTargetStateId() {
//         return targetStateId;
//     }
// 
//     public void setTargetStateId(String targetStateId) {
//         this.targetStateId = targetStateId;
//     }
// }


import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;
import static org.springframework.util.Assert.notNull;
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.PropertyAccessor;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.extensions.workflow.annotation.Descriptor;
import org.springframework.extensions.workflow.annotation.DescriptorProperty;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder;
import org.springframework.extensions.workflow.context.TransitionActionContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
                this.method = method;
                break;
            }
        }
        if (this.method == null) {
            throw new IllegalArgumentException("Object " + target + " does not define [accessible] method " + methodName);
        }
        prepareCall();
    }

    private void prepareCall() {
        parameterAnnotations = method.getParameterAnnotations();

        LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();

        parameterNames = discoverer.getParameterNames(method);
    }

    Object invoke(TransitionActionContext actionContext) throws IllegalAccessException, InvocationTargetException {
        List<Object> arguments = new ArrayList<Object>();
        int fromContext = 0;

        for (int i = 0; i < parameterAnnotations.length; i++)  {
            Annotation[] parameterAnnotation = parameterAnnotations[i];
            boolean fromDescriptor = false;

            for (Annotation annotation : parameterAnnotation) {
                if (annotation.annotationType().equals(Descriptor.class)) {
                    fromDescriptor = true;

// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// @SuppressWarnings({"unchecked"})
// public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//     return (T) getStrategy().getDescriptor();
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/FlowInstanceDescriptorHolder.java
// public final class FlowInstanceDescriptorHolder implements Serializable{
//     private static final long serialVersionUID = 969547478248429191L;
//     private static final String STRATEGY_THREADLOCAL = "threadlocal";
//     private static Map<String, FlowInstanceDescriptorHolderStrategy> strategies;
//     private static String currentStrategy;
// 
//     static {
//         strategies = new HashMap<String, FlowInstanceDescriptorHolderStrategy>();
//         strategies.put(STRATEGY_THREADLOCAL, new ThreadLocalFlowInstanceDescriptorHolderStrategy());
//         currentStrategy = STRATEGY_THREADLOCAL;
//     }
// 
//     private static FlowInstanceDescriptorHolderStrategy getStrategy() {
//         return strategies.get(currentStrategy);
//     }
// 
//     public static void setStrategy(String strategy) {
//         Assert.notNull(currentStrategy, "The 'currentStrategy' argument must not be null.");
//         currentStrategy = strategy;
//     }
// 
//     @SuppressWarnings({"unchecked"})
//     public static <T extends FlowInstanceDescriptor> T getFlowInstanceDescriptor() {
//         return (T) getStrategy().getDescriptor();
//     }
// 
//     public static void setFlowInstanceDescriptor(FlowInstanceDescriptor descriptor) {
//         getStrategy().setDescriptor(descriptor);
//     }
// 
// }
// 
// Path: src/main/java/org/springframework/extensions/workflow/context/TransitionActionContext.java
// public final class TransitionActionContext implements Serializable{
//     private static final long serialVersionUID = -2438974871913081078L;
//     private String targetStateId;
//     private Object[] arguments;
// 
//     public TransitionActionContext(String targetStateId, Object[] arguments) {
//         this.targetStateId = targetStateId;
//         this.arguments = arguments;
//     }
// 
//     public Object[] getArguments() {
//         return arguments;
//     }
// 
//     public String getTargetStateId() {
//         return targetStateId;
//     }
// 
//     public void setTargetStateId(String targetStateId) {
//         this.targetStateId = targetStateId;
//     }
// }


// Path: src/main/java/org/springframework/extensions/workflow/support/TransitionMethodInvoker.java
import static org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder.getFlowInstanceDescriptor;
import static org.springframework.util.Assert.notNull;
import org.springframework.util.Assert;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.DirectFieldAccessor;
import org.springframework.beans.PropertyAccessor;
import org.springframework.core.LocalVariableTableParameterNameDiscoverer;
import org.springframework.extensions.workflow.annotation.Descriptor;
import org.springframework.extensions.workflow.annotation.DescriptorProperty;
import org.springframework.extensions.workflow.annotation.ReturnsState;
import org.springframework.extensions.workflow.context.FlowInstanceDescriptorHolder;
import org.springframework.extensions.workflow.context.TransitionActionContext;
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

                this.method = method;
                break;
            }
        }
        if (this.method == null) {
            throw new IllegalArgumentException("Object " + target + " does not define [accessible] method " + methodName);
        }
        prepareCall();
    }

    private void prepareCall() {
        parameterAnnotations = method.getParameterAnnotations();

        LocalVariableTableParameterNameDiscoverer discoverer = new LocalVariableTableParameterNameDiscoverer();

        parameterNames = discoverer.getParameterNames(method);
    }

    Object invoke(TransitionActionContext actionContext) throws IllegalAccessException, InvocationTargetException {
        List<Object> arguments = new ArrayList<Object>();
        int fromContext = 0;

        for (int i = 0; i < parameterAnnotations.length; i++)  {
            Annotation[] parameterAnnotation = parameterAnnotations[i];
            boolean fromDescriptor = false;

            for (Annotation annotation : parameterAnnotation) {
                if (annotation.annotationType().equals(Descriptor.class)) {
                    fromDescriptor = true;

                    arguments.add(getFlowInstanceDescriptor());