aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-02-22 13:34:35 +0000
committerPJ Fanning <fanningpj@apache.org>2022-02-22 13:34:35 +0000
commit2502c12b2da9f3419a130fcb53c343be388670f7 (patch)
treef1266625e9c18a6d87650bc261bcda2e08f827c0
parentd955dada50a8b6271edb4f88cf52ec31390b36df (diff)
downloadpoi-2502c12b2da9f3419a130fcb53c343be388670f7.tar.gz
poi-2502c12b2da9f3419a130fcb53c343be388670f7.zip
code tidyup
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898322 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java22
1 files changed, 8 insertions, 14 deletions
diff --git a/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java b/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java
index 1ed7533907..17b22a32c1 100644
--- a/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java
+++ b/poi/src/main/java/org/apache/poi/ss/formula/atp/WorkdayCalculator.java
@@ -19,6 +19,7 @@ package org.apache.poi.ss.formula.atp;
import java.util.Arrays;
import java.util.Calendar;
+import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
@@ -49,20 +50,13 @@ public class WorkdayCalculator {
new HashSet<>(Arrays.asList(Calendar.THURSDAY, Calendar.FRIDAY));
private static final Set<Integer> friSatWeekend =
new HashSet<>(Arrays.asList(Calendar.FRIDAY, Calendar.SATURDAY));
- private static final Set<Integer> monWeekend =
- new HashSet<>(Arrays.asList(Calendar.MONDAY));
- private static final Set<Integer> tuesWeekend =
- new HashSet<>(Arrays.asList(Calendar.TUESDAY));
- private static final Set<Integer> wedsWeekend =
- new HashSet<>(Arrays.asList(Calendar.WEDNESDAY));
- private static final Set<Integer> thursWeekend =
- new HashSet<>(Arrays.asList(Calendar.THURSDAY));
- private static final Set<Integer> friWeekend =
- new HashSet<>(Arrays.asList(Calendar.FRIDAY));
- private static final Set<Integer> satWeekend =
- new HashSet<>(Arrays.asList(Calendar.SATURDAY));
- private static final Set<Integer> sunWeekend =
- new HashSet<>(Arrays.asList(Calendar.SUNDAY));
+ private static final Set<Integer> monWeekend = Collections.singleton(Calendar.MONDAY);
+ private static final Set<Integer> tuesWeekend = Collections.singleton(Calendar.TUESDAY);
+ private static final Set<Integer> wedsWeekend = Collections.singleton(Calendar.WEDNESDAY);
+ private static final Set<Integer> thursWeekend = Collections.singleton(Calendar.THURSDAY);
+ private static final Set<Integer> friWeekend = Collections.singleton(Calendar.FRIDAY);
+ private static final Set<Integer> satWeekend = Collections.singleton(Calendar.SATURDAY);
+ private static final Set<Integer> sunWeekend = Collections.singleton(Calendar.SUNDAY);
private static final Map<Integer, Set<Integer>> weekendTypeMap = new HashMap<>();
static {