mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Merge branch '7.0.x'
# Conflicts: # framework-platform/framework-platform.gradle
This commit is contained in:
@@ -9,7 +9,7 @@ javaPlatform {
|
||||
dependencies {
|
||||
api(platform("com.fasterxml.jackson:jackson-bom:2.21.2"))
|
||||
api(platform("io.micrometer:micrometer-bom:1.16.5"))
|
||||
api(platform("io.netty:netty-bom:4.2.12.Final"))
|
||||
api(platform("io.netty:netty-bom:4.2.13.Final"))
|
||||
api(platform("io.projectreactor:reactor-bom:2025.0.5"))
|
||||
api(platform("io.rsocket:rsocket-bom:1.1.5"))
|
||||
api(platform("org.apache.groovy:groovy-bom:5.0.5"))
|
||||
@@ -120,7 +120,7 @@ dependencies {
|
||||
api("org.glassfish:jakarta.el:4.0.2")
|
||||
api("org.graalvm.sdk:graal-sdk:22.3.1")
|
||||
api("org.hamcrest:hamcrest:3.0")
|
||||
api("org.hibernate.orm:hibernate-core:7.3.2.Final")
|
||||
api("org.hibernate.orm:hibernate-core:7.3.3.Final")
|
||||
api("org.hibernate.validator:hibernate-validator:9.1.0.Final")
|
||||
api("org.hsqldb:hsqldb:2.7.4")
|
||||
api("org.htmlunit:htmlunit:4.21.0")
|
||||
|
||||
+2
-2
@@ -956,8 +956,8 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
|
||||
actualName = propertyName.substring(0, keyStart);
|
||||
}
|
||||
String key = propertyName.substring(keyStart + PROPERTY_KEY_PREFIX.length(), keyEnd);
|
||||
if (key.length() > 1 && (key.startsWith("'") && key.endsWith("'")) ||
|
||||
(key.startsWith("\"") && key.endsWith("\""))) {
|
||||
if (key.length() > 1 && ((key.startsWith("'") && key.endsWith("'")) ||
|
||||
(key.startsWith("\"") && key.endsWith("\"")))) {
|
||||
key = key.substring(1, key.length() - 1);
|
||||
}
|
||||
keys.add(key);
|
||||
|
||||
@@ -154,7 +154,8 @@ public abstract class PropertyAccessorUtils {
|
||||
PropertyAccessor.PROPERTY_KEY_SUFFIX, keyStart + PropertyAccessor.PROPERTY_KEY_PREFIX.length());
|
||||
if (keyEnd != -1) {
|
||||
String key = sb.substring(keyStart + PropertyAccessor.PROPERTY_KEY_PREFIX.length(), keyEnd);
|
||||
if ((key.startsWith("'") && key.endsWith("'")) || (key.startsWith("\"") && key.endsWith("\""))) {
|
||||
if (key.length() > 1 && ((key.startsWith("'") && key.endsWith("'")) ||
|
||||
(key.startsWith("\"") && key.endsWith("\"")))) {
|
||||
sb.delete(keyStart + 1, keyStart + 2);
|
||||
sb.delete(keyEnd - 2, keyEnd - 1);
|
||||
keyEnd = keyEnd - 2;
|
||||
|
||||
+2
@@ -1413,6 +1413,8 @@ abstract class AbstractPropertyAccessorTests {
|
||||
assertThat(accessor.getPropertyValue("map[key5[foo]].name")).isEqualTo("name8");
|
||||
assertThat(accessor.getPropertyValue("map['key5[foo]'].name")).isEqualTo("name8");
|
||||
assertThat(accessor.getPropertyValue("map[\"key5[foo]\"].name")).isEqualTo("name8");
|
||||
assertThat(accessor.getPropertyValue("map['].name")).isEqualTo("name9");
|
||||
assertThat(accessor.getPropertyValue("map[\"].name")).isEqualTo("name9");
|
||||
assertThat(accessor.getPropertyValue("iterableMap[key1].name")).isEqualTo("nameC");
|
||||
assertThat(accessor.getPropertyValue("iterableMap[key2][0].name")).isEqualTo("nameA");
|
||||
assertThat(accessor.getPropertyValue("iterableMap[key2][1].name")).isEqualTo("nameB");
|
||||
|
||||
@@ -79,6 +79,10 @@ class PropertyAccessorUtilsTests {
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map[key1].name")).isEqualTo("map[key1].name");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map['key1'].name")).isEqualTo("map[key1].name");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map[\"key1\"].name")).isEqualTo("map[key1].name");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map['key1]")).isEqualTo("map['key1]");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map[\"key1]")).isEqualTo("map[\"key1]");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map[']")).isEqualTo("map[']");
|
||||
assertThat(PropertyAccessorUtils.canonicalPropertyName("map[\"]")).isEqualTo("map[\"]");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
+3
@@ -76,6 +76,7 @@ public class IndexedTestBean {
|
||||
TestBean tb6 = new TestBean("name6", 0);
|
||||
TestBean tb7 = new TestBean("name7", 0);
|
||||
TestBean tb8 = new TestBean("name8", 0);
|
||||
TestBean tb9 = new TestBean("name9", 0);
|
||||
TestBean tbA = new TestBean("nameA", 0);
|
||||
TestBean tbB = new TestBean("nameB", 0);
|
||||
TestBean tbC = new TestBean("nameC", 0);
|
||||
@@ -104,6 +105,8 @@ public class IndexedTestBean {
|
||||
list.add(tbY);
|
||||
this.map.put("key4", list);
|
||||
this.map.put("key5[foo]", tb8);
|
||||
this.map.put("'", tb9);
|
||||
this.map.put("\"", tb9);
|
||||
this.myTestBeans = new MyTestBeans(tbZ);
|
||||
}
|
||||
|
||||
|
||||
@@ -1539,9 +1539,6 @@ public class ResolvableType implements Serializable {
|
||||
return new ResolvableType(type, null, typeProvider, variableResolver);
|
||||
}
|
||||
|
||||
// Purge empty entries on access since we don't have a clean-up thread or the like.
|
||||
cache.purgeUnreferencedEntries();
|
||||
|
||||
// Check the cache - we may have a ResolvableType which has been resolved before...
|
||||
ResolvableType resultType = new ResolvableType(type, typeProvider, variableResolver);
|
||||
ResolvableType cachedType = cache.get(resultType);
|
||||
|
||||
@@ -499,10 +499,17 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove any entries that have been garbage collected and are no longer referenced.
|
||||
* Under normal circumstances garbage collected entries are automatically purged as
|
||||
* items are added or removed from the Map. This method can be used to force a purge,
|
||||
* and is useful when the Map is read frequently but updated less often.
|
||||
* Remove any entries that have been garbage-collected and are no longer referenced.
|
||||
* Note that this call implies segment locking and can lead to thread contention.
|
||||
* <p>Under normal circumstances, garbage-collected entries are automatically purged as
|
||||
* items are added or removed from the Map. This method can be used to force a purge
|
||||
* which is useful when the Map is read frequently but hardly ever updated anymore.
|
||||
* <p>Note that it may be preferable to simply {@link #clear() clear} the entire cache at
|
||||
* certain points of the lifecycle, not just dropping unreferenced entries but even the
|
||||
* entire cache content: assuming that most entries in the cache won't be needed anymore
|
||||
* after certain processing phases, therefore rather rebuilding the cache going forward.
|
||||
* @since 4.1.1
|
||||
* @see #clear()
|
||||
*/
|
||||
public void purgeUnreferencedEntries() {
|
||||
for (Segment segment : this.segments) {
|
||||
@@ -716,7 +723,7 @@ public class ConcurrentReferenceHashMap<K, V> extends AbstractMap<K, V> implemen
|
||||
int currCount = this.count.get();
|
||||
boolean needsResize = allowResize && (currCount > 0 && currCount >= this.resizeThreshold);
|
||||
Reference<K, V> ref = this.referenceManager.pollForPurge();
|
||||
if (ref != null || (needsResize)) {
|
||||
if (ref != null || needsResize) {
|
||||
restructure(allowResize, ref);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user