From f454cfa63a7c2d256276ca81d11874a58c4a6fdd Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Thu, 21 Oct 2021 10:14:10 +0000 Subject: [bug-65639] add doc about lack of thread saftey git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894439 13f79535-47bb-0310-9956-ffa450edef68 --- .../main/java/org/apache/poi/hslf/record/FontEmbeddedData.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEmbeddedData.java b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEmbeddedData.java index b27cdb4b53..dc0a8e9410 100644 --- a/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEmbeddedData.java +++ b/poi-scratchpad/src/main/java/org/apache/poi/hslf/record/FontEmbeddedData.java @@ -91,12 +91,22 @@ public class FontEmbeddedData extends RecordAtom implements FontFacet { out.write(_data); } + /** + * Overwrite the font data. Reading values from this FontEmbeddedData instance while calling setFontData + * is not thread safe. + * @param fontData new font data + */ public void setFontData(byte[] fontData) { fontHeader = null; _data = fontData.clone(); LittleEndian.putInt(_header, 4, _data.length); } + /** + * Read the font data. Reading values from this FontEmbeddedData instance while calling {@link #setFontData(byte[])} + * is not thread safe. + * @return font data + */ public FontHeader getFontHeader() { if (fontHeader == null) { FontHeader h = new FontHeader(); -- cgit v1.2.3