From 2502c12b2da9f3419a130fcb53c343be388670f7 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 22 Feb 2022 13:34:35 +0000 Subject: code tidyup git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1898322 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/ss/formula/atp/WorkdayCalculator.java | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'poi') 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 friSatWeekend = new HashSet<>(Arrays.asList(Calendar.FRIDAY, Calendar.SATURDAY)); - private static final Set monWeekend = - new HashSet<>(Arrays.asList(Calendar.MONDAY)); - private static final Set tuesWeekend = - new HashSet<>(Arrays.asList(Calendar.TUESDAY)); - private static final Set wedsWeekend = - new HashSet<>(Arrays.asList(Calendar.WEDNESDAY)); - private static final Set thursWeekend = - new HashSet<>(Arrays.asList(Calendar.THURSDAY)); - private static final Set friWeekend = - new HashSet<>(Arrays.asList(Calendar.FRIDAY)); - private static final Set satWeekend = - new HashSet<>(Arrays.asList(Calendar.SATURDAY)); - private static final Set sunWeekend = - new HashSet<>(Arrays.asList(Calendar.SUNDAY)); + private static final Set monWeekend = Collections.singleton(Calendar.MONDAY); + private static final Set tuesWeekend = Collections.singleton(Calendar.TUESDAY); + private static final Set wedsWeekend = Collections.singleton(Calendar.WEDNESDAY); + private static final Set thursWeekend = Collections.singleton(Calendar.THURSDAY); + private static final Set friWeekend = Collections.singleton(Calendar.FRIDAY); + private static final Set satWeekend = Collections.singleton(Calendar.SATURDAY); + private static final Set sunWeekend = Collections.singleton(Calendar.SUNDAY); private static final Map> weekendTypeMap = new HashMap<>(); static { -- cgit v1.2.3