提交 a21563c1 编写于 作者: P prr

6853617: race condition in java.awt.Font.getAttributes() (private method)

Reviewed-by: igor, jgodinez
上级 f9bfec4c
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册