From: Javen O'Neal Date: Tue, 31 Oct 2017 09:38:03 +0000 (+0000) Subject: github-77: Remove the 'public' modifier to make fields package protected (findbugs... X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=722ab2d4f1055357ea4979a0b8fc3bb6fe37ce22;p=poi.git github-77: Remove the 'public' modifier to make fields package protected (findbugs-MS_PKGPROTECT). Thanks to BruceKuiLiu for the PR. This closes #77 on github. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1813859 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/scratchpad/src/org/apache/poi/hmef/CompressedRTF.java b/src/scratchpad/src/org/apache/poi/hmef/CompressedRTF.java index ad38755a0f..b9f4cc4ee6 100644 --- a/src/scratchpad/src/org/apache/poi/hmef/CompressedRTF.java +++ b/src/scratchpad/src/org/apache/poi/hmef/CompressedRTF.java @@ -33,9 +33,11 @@ import org.apache.poi.util.LittleEndian; * handles decompressing it for you. */ public final class CompressedRTF extends LZWDecompresser { - public static final byte[] COMPRESSED_SIGNATURE = + // github-77: mutable static fields could be changed by malicious code or by accident. + // These byte arrays should be package protected. + /*package*/ static final byte[] COMPRESSED_SIGNATURE = new byte[] { (byte)'L', (byte)'Z', (byte)'F', (byte)'u' }; - public static final byte[] UNCOMPRESSED_SIGNATURE = + /*package*/ static final byte[] UNCOMPRESSED_SIGNATURE = new byte[] { (byte)'M', (byte)'E', (byte)'L', (byte)'A' }; public static final int COMPRESSED_SIGNATURE_INT = LittleEndian.getInt(COMPRESSED_SIGNATURE);