Polish "Add factory to create a NamedThreadLocal with an initial value"

See gh-24705
This commit is contained in:
Stephane Nicoll
2023-08-23 18:47:06 +02:00
parent e1d0176faa
commit 5878a0741e
3 changed files with 10 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* Copyright 2002-2023 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.
@@ -55,7 +55,8 @@ public class SimpleThreadScope implements Scope {
private static final Log logger = LogFactory.getLog(SimpleThreadScope.class);
private final ThreadLocal<Map<String, Object>> threadScope = NamedThreadLocal.withInitial("SimpleThreadScope", HashMap::new);
private final ThreadLocal<Map<String, Object>> threadScope = NamedThreadLocal.withInitial(
"SimpleThreadScope", HashMap::new);
@Override
public Object get(String name, ObjectFactory<?> objectFactory) {