From 5e47c8c37d90f438a9bd4bca8eaf064d3d435569 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Mon, 3 Aug 2015 23:36:28 +0000 Subject: [PATCH] FindBugs fixes - MS_SHOULD_BE_FINAL git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1693984 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/poifs/crypt/EncryptionInfo.java | 8 ++++---- src/java/org/apache/poi/sl/draw/DrawFactory.java | 2 +- .../java/org/apache/poi/xssf/util/NumericRanges.java | 10 +++++----- .../src/org/apache/poi/hslf/usermodel/HSLFNotes.java | 2 +- .../apache/poi/hslf/usermodel/HSLFTextParagraph.java | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java b/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java index 3aafb90cac..6f8c04fd3b 100644 --- a/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java +++ b/src/java/org/apache/poi/poifs/crypt/EncryptionInfo.java @@ -48,25 +48,25 @@ public class EncryptionInfo { * A flag that specifies whether CryptoAPI RC4 or ECMA-376 encryption * ECMA-376 is used. It MUST be 1 unless flagExternal is 1. If flagExternal is 1, it MUST be 0. */ - public static BitField flagCryptoAPI = BitFieldFactory.getInstance(0x04); + public static final BitField flagCryptoAPI = BitFieldFactory.getInstance(0x04); /** * A value that MUST be 0 if document properties are encrypted. * The encryption of document properties is specified in section 2.3.5.4. */ - public static BitField flagDocProps = BitFieldFactory.getInstance(0x08); + public static final BitField flagDocProps = BitFieldFactory.getInstance(0x08); /** * A value that MUST be 1 if extensible encryption is used. If this value is 1, * the value of every other field in this structure MUST be 0. */ - public static BitField flagExternal = BitFieldFactory.getInstance(0x10); + public static final BitField flagExternal = BitFieldFactory.getInstance(0x10); /** * A value that MUST be 1 if the protected content is an ECMA-376 document * ECMA-376. If the fAES bit is 1, the fCryptoAPI bit MUST also be 1. */ - public static BitField flagAES = BitFieldFactory.getInstance(0x20); + public static final BitField flagAES = BitFieldFactory.getInstance(0x20); /** diff --git a/src/java/org/apache/poi/sl/draw/DrawFactory.java b/src/java/org/apache/poi/sl/draw/DrawFactory.java index 9d2f05ca4f..8e75514e4d 100644 --- a/src/java/org/apache/poi/sl/draw/DrawFactory.java +++ b/src/java/org/apache/poi/sl/draw/DrawFactory.java @@ -42,7 +42,7 @@ import org.apache.poi.sl.usermodel.TextRun; import org.apache.poi.sl.usermodel.TextShape; public class DrawFactory { - protected static ThreadLocal defaultFactory = new ThreadLocal(); + protected static final ThreadLocal defaultFactory = new ThreadLocal(); /** * Set a custom draw factory for the current thread. diff --git a/src/ooxml/java/org/apache/poi/xssf/util/NumericRanges.java b/src/ooxml/java/org/apache/poi/xssf/util/NumericRanges.java index 516b535649..442e24a48a 100644 --- a/src/ooxml/java/org/apache/poi/xssf/util/NumericRanges.java +++ b/src/ooxml/java/org/apache/poi/xssf/util/NumericRanges.java @@ -19,11 +19,11 @@ package org.apache.poi.xssf.util; public class NumericRanges { - public static int NO_OVERLAPS = -1; - public static int OVERLAPS_1_MINOR = 0; - public static int OVERLAPS_2_MINOR = 1; - public static int OVERLAPS_1_WRAPS = 2; - public static int OVERLAPS_2_WRAPS = 3; + public static final int NO_OVERLAPS = -1; + public static final int OVERLAPS_1_MINOR = 0; + public static final int OVERLAPS_2_MINOR = 1; + public static final int OVERLAPS_1_WRAPS = 2; + public static final int OVERLAPS_2_WRAPS = 3; public static long[] getOverlappingRange(long[] range1, long[] range2) { int overlappingType = getOverlappingType(range1, range2); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java index 7f47eafe22..34cb8cf2c3 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFNotes.java @@ -33,7 +33,7 @@ import org.apache.poi.util.POILogger; */ public final class HSLFNotes extends HSLFSheet implements Notes { - protected static POILogger logger = POILogFactory.getLogger(HSLFNotes.class); + protected static final POILogger logger = POILogFactory.getLogger(HSLFNotes.class); private List> _paragraphs = new ArrayList>(); diff --git a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java index b07a8f8b67..0dc8de65f4 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java +++ b/src/scratchpad/src/org/apache/poi/hslf/usermodel/HSLFTextParagraph.java @@ -40,7 +40,7 @@ import org.apache.poi.util.*; */ public final class HSLFTextParagraph implements TextParagraph { - protected static POILogger logger = POILogFactory.getLogger(HSLFTextParagraph.class); + protected static final POILogger logger = POILogFactory.getLogger(HSLFTextParagraph.class); /** * How to align the text