6881442: (reflect) Race condition in Class.getName()
Only read "name" field racily once Reviewed-by: darcy
This commit is contained in:
parent
ee98fe5cd9
commit
b5f1c84e3e
@ -565,8 +565,9 @@ public final
|
||||
* represented by this object.
|
||||
*/
|
||||
public String getName() {
|
||||
String name = this.name;
|
||||
if (name == null)
|
||||
name = getName0();
|
||||
this.name = name = getName0();
|
||||
return name;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user