From f7b088edb7792cc62cdf4ae7163b7ceae1b4e24f Mon Sep 17 00:00:00 2001
From: Olga Maciaszek-Sharma
Date: Fri, 11 Apr 2025 16:17:45 +0200
Subject: [PATCH 1/2] Fix typo.
Signed-off-by: Olga Maciaszek-Sharma
---
.../cloud/client/loadbalancer/LoadBalancerUriTools.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerUriTools.java b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerUriTools.java
index c23d0f29..7715875d 100644
--- a/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerUriTools.java
+++ b/spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerUriTools.java
@@ -56,7 +56,7 @@ public final class LoadBalancerUriTools {
boolean encoded = (uri.getRawQuery() != null && uri.getRawQuery().contains(PERCENTAGE_SIGN))
|| (uri.getRawPath() != null && uri.getRawPath().contains(PERCENTAGE_SIGN))
|| (uri.getRawFragment() != null && uri.getRawFragment().contains(PERCENTAGE_SIGN));
- // Verify if it is real ly fully encoded. Treat partial encoded as unencoded.
+ // Verify if it is really fully encoded. Treat partial encoded as unencoded.
if (encoded) {
try {
UriComponentsBuilder.fromUri(uri).build(true);
From 999a323a1b261759bde025d2daadabc03e9270e4 Mon Sep 17 00:00:00 2001
From: Yanming Zhou
Date: Wed, 16 Apr 2025 23:35:01 +0800
Subject: [PATCH 2/2] Improve GenericScope to remove unused evaluationContext
(#1486)
Signed-off-by: Yanming Zhou
---
.../cloud/context/scope/GenericScope.java | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
index b75a564f..449c390e 100644
--- a/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
+++ b/spring-cloud-context/src/main/java/org/springframework/cloud/context/scope/GenericScope.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012-2020 the original author or authors.
+ * Copyright 2012-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -57,7 +57,6 @@ import org.springframework.expression.Expression;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.ParseException;
import org.springframework.expression.spel.standard.SpelExpressionParser;
-import org.springframework.expression.spel.support.StandardEvaluationContext;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
@@ -67,6 +66,7 @@ import org.springframework.util.StringUtils;
*
*
* @author Dave Syer
+ * @author Yanming Zhou
* @since 3.1
*
*/
@@ -81,13 +81,11 @@ public class GenericScope
private ConfigurableListableBeanFactory beanFactory;
- private StandardEvaluationContext evaluationContext;
-
private String id;
- private Map errors = new ConcurrentHashMap<>();
+ private final Map errors = new ConcurrentHashMap<>();
- private ConcurrentMap locks = new ConcurrentHashMap<>();
+ private final ConcurrentMap locks = new ConcurrentHashMap<>();
static RuntimeException wrapIfNecessary(Throwable throwable) {
if (throwable instanceof RuntimeException) {
@@ -213,7 +211,7 @@ public class GenericScope
@Override
public Object resolveContextualObject(String key) {
Expression expression = parseExpression(key);
- return expression.getValue(this.evaluationContext, this.beanFactory);
+ return expression.getValue(this.beanFactory);
}
private Expression parseExpression(String input) {