Commit 972a76d
Fix potential race condition in
The getNullable() method had a subtle race condition where the value field
could be read as null after being assigned but before the resolved flag was
set to true. This could occur if another thread read the value between lines
136 and 137.
This change maintains the existing behavior documented in the class Javadoc
that the supplier may be called multiple times under concurrent access, while
fixing the potential for incorrect null returns.
Signed-off-by: jbj338033 <jbj338033@gmail.com>
Closes #3368Lazy.getNullable().1 parent 0ed5609 commit 972a76d
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
136 | 137 | | |
137 | 138 | | |
138 | | - | |
| 139 | + | |
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| |||
0 commit comments