@@ -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 ); // $hasJexlInjection
21
+ e .evaluate (jc ); // $Alert
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 ); // $hasJexlInjection
28
+ e .evaluate (jc ); // $Alert
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 ); // $hasJexlInjection
35
+ script .execute (jc ); // $Alert
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 (); // $hasJexlInjection
44
+ script .callable (jc ).call (); // $Alert
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 ); // $hasJexlInjection
52
+ jexl .getProperty (new Object (), jexlExpr ); // $Alert
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 ()); // $hasJexlInjection
57
+ jexl .setProperty (new Object (), jexlExpr , new Object ()); // $Alert
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 ()); // $hasJexlInjection
63
+ jxlt .createExpression (jexlExpr ).evaluate (new MapContext ()); // $Alert
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 ()); // $hasJexlInjection
69
+ jxlt .createExpression (jexlExpr ).prepare (new MapContext ()); // $Alert
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 ()); // $hasJexlInjection
75
+ jxlt .createTemplate (jexlExpr ).evaluate (new MapContext (), new StringWriter ()); // $Alert
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 (); // $hasJexlInjection
84
+ e .callable (jc ).call (); // $Alert
85
85
} catch (Exception ex ) {
86
86
throw new RuntimeException (ex );
87
87
}
@@ -91,7 +91,7 @@ private static void testWithSocket(Consumer<String> action) throws Exception {
91
91
try (ServerSocket serverSocket = new ServerSocket (0 )) {
92
92
try (Socket socket = serverSocket .accept ()) {
93
93
byte [] bytes = new byte [1024 ];
94
- int n = socket .getInputStream ().read (bytes );
94
+ int n = socket .getInputStream ().read (bytes ); // $Source
95
95
String jexlExpr = new String (bytes , 0 , n );
96
96
action .accept (jexlExpr );
97
97
}
@@ -141,14 +141,14 @@ public static void testWithJexlExpressionCallable() throws Exception {
141
141
}
142
142
143
143
@ PostMapping ("/request" )
144
- public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromPathVariable (@ PathVariable String expr ) {
144
+ public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromPathVariable (@ PathVariable String expr ) { // $Source
145
145
146
146
runJexlExpression (expr );
147
147
return ResponseEntity .ok (HttpStatus .OK );
148
148
}
149
149
150
150
@ PostMapping ("/request" )
151
- public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBody (@ RequestBody Data data ) {
151
+ public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBody (@ RequestBody Data data ) { // $Source
152
152
153
153
String expr = data .getExpr ();
154
154
runJexlExpression (expr );
@@ -158,7 +158,7 @@ public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBody(@
158
158
159
159
@ PostMapping ("/request" )
160
160
public ResponseEntity testWithSpringControllerThatEvaluatesJexlFromRequestBodyWithNestedObjects (
161
- @ RequestBody CustomRequest customRequest ) {
161
+ @ RequestBody CustomRequest customRequest ) { // $Source
162
162
163
163
String expr = customRequest .getData ().getExpr ();
164
164
runJexlExpression (expr );
0 commit comments