mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-16 08:29:34 +00:00
6853617: race condition in java.awt.Font.getAttributes() (private method)
Reviewed-by: igor, jgodinez
This commit is contained in:
parent
cb5399d380
commit
886c516b5b
@ -445,18 +445,19 @@ public class Font implements java.io.Serializable
|
||||
*/
|
||||
private AttributeValues getAttributeValues() {
|
||||
if (values == null) {
|
||||
values = new AttributeValues();
|
||||
values.setFamily(name);
|
||||
values.setSize(pointSize); // expects the float value.
|
||||
AttributeValues valuesTmp = new AttributeValues();
|
||||
valuesTmp.setFamily(name);
|
||||
valuesTmp.setSize(pointSize); // expects the float value.
|
||||
|
||||
if ((style & BOLD) != 0) {
|
||||
values.setWeight(2); // WEIGHT_BOLD
|
||||
valuesTmp.setWeight(2); // WEIGHT_BOLD
|
||||
}
|
||||
|
||||
if ((style & ITALIC) != 0) {
|
||||
values.setPosture(.2f); // POSTURE_OBLIQUE
|
||||
valuesTmp.setPosture(.2f); // POSTURE_OBLIQUE
|
||||
}
|
||||
values.defineAll(PRIMARY_MASK); // for streaming compatibility
|
||||
valuesTmp.defineAll(PRIMARY_MASK); // for streaming compatibility
|
||||
values = valuesTmp;
|
||||
}
|
||||
|
||||
return values;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user