@@ -18,21 +18,21 @@ private static void runJexlExpression(String jexlExpr) {
18
18
JexlEngine jexl = new JexlBuilder ().create ();
19
19
JexlExpression e = jexl .createExpression (jexlExpr );
20
20
JexlContext jc = new MapContext ();
21
- e .evaluate (jc );
21
+ e .evaluate (jc ); // $hasJexlInjection
22
22
}
23
23
24
24
private static void runJexlExpressionWithJexlInfo (String jexlExpr ) {
25
25
JexlEngine jexl = new JexlBuilder ().create ();
26
26
JexlExpression e = jexl .createExpression (new JexlInfo ("unknown" , 0 , 0 ), jexlExpr );
27
27
JexlContext jc = new MapContext ();
28
- e .evaluate (jc );
28
+ e .evaluate (jc ); // $hasJexlInjection
29
29
}
30
30
31
31
private static void runJexlScript (String jexlExpr ) {
32
32
JexlEngine jexl = new JexlBuilder ().create ();
33
33
JexlScript script = jexl .createScript (jexlExpr );
34
34
JexlContext jc = new MapContext ();
35
- script .execute (jc );
35
+ script .execute (jc ); // $hasJexlInjection
36
36
}
37
37
38
38
private static void runJexlScriptViaCallable (String jexlExpr ) {
@@ -41,38 +41,38 @@ private static void runJexlScriptViaCallable(String jexlExpr) {
41
41
JexlContext jc = new MapContext ();
42
42
43
43
try {
44
- script .callable (jc ).call ();
44
+ script .callable (jc ).call (); // $hasJexlInjection
45
45
} catch (Exception e ) {
46
46
throw new RuntimeException (e );
47
47
}
48
48
}
49
49
50
50
private static void runJexlExpressionViaGetProperty (String jexlExpr ) {
51
51
JexlEngine jexl = new JexlBuilder ().create ();
52
- jexl .getProperty (new Object (), jexlExpr );
52
+ jexl .getProperty (new Object (), jexlExpr ); // $hasJexlInjection
53
53
}
54
54
55
55
private static void runJexlExpressionViaSetProperty (String jexlExpr ) {
56
56
JexlEngine jexl = new JexlBuilder ().create ();
57
- jexl .setProperty (new Object (), jexlExpr , new Object ());
57
+ jexl .setProperty (new Object (), jexlExpr , new Object ()); // $hasJexlInjection
58
58
}
59
59
60
60
private static void runJexlExpressionViaJxltEngineExpressionEvaluate (String jexlExpr ) {
61
61
JexlEngine jexl = new JexlBuilder ().create ();
62
62
JxltEngine jxlt = jexl .createJxltEngine ();
63
- jxlt .createExpression (jexlExpr ).evaluate (new MapContext ());
63
+ jxlt .createExpression (jexlExpr ).evaluate (new MapContext ()); // $hasJexlInjection
64
64
}
65
65
66
66
private static void runJexlExpressionViaJxltEngineExpressionPrepare (String jexlExpr ) {
67
67
JexlEngine jexl = new JexlBuilder ().create ();
68
68
JxltEngine jxlt = jexl .createJxltEngine ();
69
- jxlt .createExpression (jexlExpr ).prepare (new MapContext ());
69
+ jxlt .createExpression (jexlExpr ).prepare (new MapContext ()); // $hasJexlInjection
70
70
}
71
71
72
72
private static void runJexlExpressionViaJxltEngineTemplateEvaluate (String jexlExpr ) {
73
73
JexlEngine jexl = new JexlBuilder ().create ();
74
74
JxltEngine jxlt = jexl .createJxltEngine ();
75
- jxlt .createTemplate (jexlExpr ).evaluate (new MapContext (), new StringWriter ());
75
+ jxlt .createTemplate (jexlExpr ).evaluate (new MapContext (), new StringWriter ()); // $hasJexlInjection
76
76
}
77
77
78
78
private static void runJexlExpressionViaCallable (String jexlExpr ) {
@@ -81,7 +81,7 @@ private static void runJexlExpressionViaCallable(String jexlExpr) {
81
81
JexlContext jc = new MapContext ();
82
82
83
83
try {
84
- e .callable (jc ).call ();
84
+ e .callable (jc ).call (); // $hasJexlInjection
85
85
} catch (Exception ex ) {
86
86
throw new RuntimeException (ex );
87
87
}
@@ -141,16 +141,14 @@ public static void testWithJexlExpressionCallable() throws Exception {
141
141
}
142
142
143
143
@ PostMapping ("/request" )
144
- public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromPathVariable (
145
- @ PathVariable String expr ) {
144
+ public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromPathVariable (@ PathVariable String expr ) {
146
145
147
146
runJexlExpression (expr );
148
147
return ResponseEntity .ok (HttpStatus .OK );
149
148
}
150
149
151
150
@ PostMapping ("/request" )
152
- public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBody (
153
- @ RequestBody Data data ) {
151
+ public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBody (@ RequestBody Data data ) {
154
152
155
153
String expr = data .getExpr ();
156
154
runJexlExpression (expr );
0 commit comments