View | Details | Raw Unified | Return to bug 56708
Collapse All | Expand All

(-)jmeter/src/functions/org/apache/jmeter/functions/Jexl2Function.java (-6 / +14 lines)
Lines 49-60 Link Here
49
    private static final List<String> desc = new LinkedList<String>();
49
    private static final List<String> desc = new LinkedList<String>();
50
50
51
    // TODO should the engine be static?
51
    // TODO should the engine be static?
52
    private static final JexlEngine jexl = new JexlEngine();
52
    private static final ThreadLocal<JexlEngine> threadLocal_jexl = new ThreadLocal<JexlEngine>();
53
    static {
54
       jexl.setCache(512);
55
       jexl.setLenient(false);
56
       jexl.setSilent(false);
57
    }
58
53
59
    static
54
    static
60
    {
55
    {
Lines 64-69 Link Here
64
59
65
    private Object[] values;
60
    private Object[] values;
66
61
62
    public JexlEngine getJexlEngine() {
63
        JexlEngine engine = threadLocal_jexl.get();
64
        if(engine == null) {
65
            engine = new JexlEngine();
66
            engine.setCache(512);
67
            engine.setLenient(false);
68
            engine.setSilent(false);
69
            threadLocal_jexl.set(engine);
70
        }
71
        return engine;
72
    }
73
67
    /** {@inheritDoc} */
74
    /** {@inheritDoc} */
68
    @Override
75
    @Override
69
    public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
76
    public synchronized String execute(SampleResult previousResult, Sampler currentSampler)
Lines 81-86 Link Here
81
88
82
        JMeterContext jmctx = JMeterContextService.getContext();
89
        JMeterContext jmctx = JMeterContextService.getContext();
83
        JMeterVariables vars = jmctx.getVariables();
90
        JMeterVariables vars = jmctx.getVariables();
91
        JexlEngine jexl = getJexlEngine();
84
92
85
        try
93
        try
86
        {
94
        {

Return to bug 56708