Skip to content

Commit 999a323

Browse files
authored
Improve GenericScope to remove unused evaluationContext (#1486)
Signed-off-by: Yanming Zhou <[email protected]>
1 parent f7b088e commit 999a323

File tree

1 file changed

+5
-7
lines changed
  • spring-cloud-context/src/main/java/org/springframework/cloud/context/scope

1 file changed

+5
-7
lines changed

spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2020 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -57,7 +57,6 @@
5757
import org.springframework.expression.ExpressionParser;
5858
import org.springframework.expression.ParseException;
5959
import org.springframework.expression.spel.standard.SpelExpressionParser;
60-
import org.springframework.expression.spel.support.StandardEvaluationContext;
6160
import org.springframework.util.ReflectionUtils;
6261
import org.springframework.util.StringUtils;
6362

@@ -67,6 +66,7 @@
6766
* </p>
6867
*
6968
* @author Dave Syer
69+
* @author Yanming Zhou
7070
* @since 3.1
7171
*
7272
*/
@@ -81,13 +81,11 @@ public class GenericScope
8181

8282
private ConfigurableListableBeanFactory beanFactory;
8383

84-
private StandardEvaluationContext evaluationContext;
85-
8684
private String id;
8785

88-
private Map<String, Exception> errors = new ConcurrentHashMap<>();
86+
private final Map<String, Exception> errors = new ConcurrentHashMap<>();
8987

90-
private ConcurrentMap<String, ReadWriteLock> locks = new ConcurrentHashMap<>();
88+
private final ConcurrentMap<String, ReadWriteLock> locks = new ConcurrentHashMap<>();
9189

9290
static RuntimeException wrapIfNecessary(Throwable throwable) {
9391
if (throwable instanceof RuntimeException) {
@@ -213,7 +211,7 @@ public Object remove(String name) {
213211
@Override
214212
public Object resolveContextualObject(String key) {
215213
Expression expression = parseExpression(key);
216-
return expression.getValue(this.evaluationContext, this.beanFactory);
214+
return expression.getValue(this.beanFactory);
217215
}
218216

219217
private Expression parseExpression(String input) {

0 commit comments

Comments
 (0)