Skip to content

Commit e6428f2

Browse files
author
thji
committed
feat: code style
1 parent dbb4af3 commit e6428f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

arex-instrumentation/dynamic/arex-dynamic-common/src/main/java/io/arex/inst/dynamic/common/ExpressionParseUtil.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ public static String generateKey(Method method, Object[] args, String keyExpress
4242
if (expression == null) {
4343
return null;
4444
}
45-
// create root object
46-
MethodRootObject rootObject = new MethodRootObject(method, args);
45+
4746

4847
try {
4948
String[] parameterNames = NAME_DISCOVERER.getParameterNames(method);
5049
if (parameterNames == null || args.length != parameterNames.length) {
5150
return null;
5251
}
52+
53+
MethodRootObject rootObject = new MethodRootObject(method, args);
54+
5355
EvaluationContext context = new StandardEvaluationContext(rootObject);
5456
for (int i = 0; i < args.length; i++) {
5557
context.setVariable(parameterNames[i], args[i]);
@@ -64,7 +66,10 @@ public static String generateKey(Method method, Object[] args, String keyExpress
6466
}
6567
}
6668

67-
69+
/**
70+
* the root object used during the expression evaluation. It contains the method and its
71+
* arguments.
72+
*/
6873
private static class MethodRootObject {
6974
private final Method method;
7075
private final Object[] args;

0 commit comments

Comments
 (0)