static {
final Map<Integer, Borders> tempMap = new HashMap<>();
for (Borders p : values()) {
- tempMap.put(Integer.valueOf(p.getValue()), p);
+ tempMap.put(p.getValue(), p);
}
imap = Collections.unmodifiableMap(tempMap);
}
==================================================================== */
package org.apache.poi.xwpf.usermodel;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
*/
TEXT_WRAPPING(3);
- private static Map<Integer, BreakType> imap = new HashMap<>();
+ private static final Map<Integer, BreakType> imap;
static {
+ final Map<Integer, BreakType> tempMap = new HashMap<>();
for (BreakType p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;
==================================================================== */
package org.apache.poi.xwpf.usermodel;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
AT_LEAST(3);
- private static Map<Integer, LineSpacingRule> imap = new HashMap<>();
+ private static final Map<Integer, LineSpacingRule> imap;
static {
+ final Map<Integer, LineSpacingRule> tempMap = new HashMap<>();
for (LineSpacingRule p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.STJcTable;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
CENTER(STJcTable.INT_CENTER),
RIGHT(STJcTable.INT_END);
- private static Map<Integer, TableRowAlign> imap = new HashMap<>();
+ private static final Map<Integer, TableRowAlign> imap;
static {
+ final Map<Integer, TableRowAlign> tempMap = new HashMap<>();
for (TableRowAlign p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;
==================================================================== */
package org.apache.poi.xwpf.usermodel;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
EXACT(2),
AT_LEAST(3);
- private static Map<Integer, TableRowHeightRule> imap = new HashMap<>();
+ private static final Map<Integer, TableRowHeightRule> imap;
static {
+ final Map<Integer, TableRowHeightRule> tempMap = new HashMap<>();
for (TableRowHeightRule p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;
==================================================================== */
package org.apache.poi.xwpf.usermodel;
+import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
*/
AUTO(5);
- private static Map<Integer, TextAlignment> imap = new HashMap<>();
+ private static final Map<Integer, TextAlignment> imap;
static {
+ final Map<Integer, TextAlignment> tempMap = new HashMap<>();
for (TextAlignment p : values()) {
- imap.put(p.getValue(), p);
+ tempMap.put(p.getValue(), p);
}
+ imap = Collections.unmodifiableMap(tempMap);
}
private final int value;
* ones, so we can't just re-use the HSMF ones.
*/
public final class TNEFProperty {
- private static Map<Integer, List<TNEFProperty>> properties = new HashMap<>();
+ private static final Map<Integer, List<TNEFProperty>> properties = new HashMap<>();
// Types taken from http://msdn.microsoft.com/en-us/library/microsoft.exchange.data.contenttypes.tnef.tnefattributetype%28v=EXCHG.140%29.aspx
public static final int TYPE_TRIPLES = 0x0000;
*/
@SuppressWarnings("unused")
public class MAPIProperty {
- private static Map<Integer, MAPIProperty> attributes = new HashMap<>();
+ private static final Map<Integer, MAPIProperty> attributes = new HashMap<>();
public static final MAPIProperty AB_DEFAULT_DIR =
new MAPIProperty(0x3d06, BINARY, "AbDefaultDir", "PR_AB_DEFAULT_DIR");
package org.apache.poi.ss.formula.functions;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
public int getIntValue() { return intValue; }
}
- private static Map<Integer, MatchMode> matchModeMap = new HashMap<>();
- private static Map<Integer, SearchMode> searchModeMap = new HashMap<>();
+ private static final Map<Integer, MatchMode> matchModeMap;
+ private static final Map<Integer, SearchMode> searchModeMap;
static {
+ final Map<Integer, MatchMode> mmMap = new HashMap<>();
for (MatchMode mode : MatchMode.values()) {
- matchModeMap.put(mode.getIntValue(), mode);
+ mmMap.put(mode.getIntValue(), mode);
}
+ matchModeMap = Collections.unmodifiableMap(mmMap);
+ final Map<Integer, SearchMode> smMap = new HashMap<>();
for (SearchMode mode : SearchMode.values()) {
- searchModeMap.put(mode.getIntValue(), mode);
+ smMap.put(mode.getIntValue(), mode);
}
+ searchModeMap = Collections.unmodifiableMap(smMap);
}
public static MatchMode matchMode(int m) {
if (valEval instanceof StringEval) {
String stringValue = ((StringEval) valEval).getStringValue();
- if(stringValue.length() < 1) {
+ if(stringValue.isEmpty()) {
// More trickiness:
// Empty string is not the same as BlankEval. It causes #VALUE! error
throw EvaluationException.invalidValue();
* Represents a type of a conditional formatting rule
*/
public class ConditionType {
- private static Map<Integer,ConditionType> lookup = new HashMap<>();
+ private static final Map<Integer, ConditionType> lookup = new HashMap<>();
/**
* This conditional formatting rule compares a cell value