-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove license plugin * Remove license header from files * Update changelog release date * Cleanup codeql action * Fix sonar: Avoid varargs * Fix sonar: Move constructor --------- Co-authored-by: kaklakariada <[email protected]>
- Loading branch information
1 parent
da533d8
commit 3feef3b
Showing
38 changed files
with
104 additions
and
726 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ plugins { | |
id 'signing' | ||
id 'maven-publish' | ||
id 'jacoco' | ||
id 'com.github.hierynomus.license' version '0.16.1' | ||
id 'org.sonarqube' version '5.1.0.4882' | ||
id "io.github.gradle-nexus.publish-plugin" version "2.0.0" | ||
id "com.github.ben-manes.versions" version '0.51.0' | ||
|
@@ -73,15 +72,6 @@ testing { | |
} | ||
} | ||
|
||
license { | ||
header = file('gradle/license-header.txt') | ||
ext.project = 'holiday-calculator' | ||
ext.year = 2022 | ||
ext.name = 'itsallcode' | ||
ext.email = '[email protected]' | ||
include '**/*.java' | ||
} | ||
|
||
jacocoTestReport { | ||
dependsOn test | ||
reports { | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic; | ||
|
||
import java.time.LocalDate; | ||
|
@@ -89,4 +72,4 @@ public static LocalDate orthodox(int year) { | |
return LocalDate.of(year, 5, day - 30); | ||
} | ||
} | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
src/main/java/org/itsallcode/holidays/calculator/logic/Formatter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic; | ||
|
||
import java.time.DayOfWeek; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,7 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic; | ||
|
||
import java.time.LocalDate; | ||
import java.util.ArrayList; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.*; | ||
|
||
import org.itsallcode.holidays.calculator.logic.variants.Holiday; | ||
|
||
|
@@ -65,7 +42,7 @@ public HolidaySet(final Collection<Holiday> definitions) { | |
* @return List of holidays occurring on the given date. If there is no holiday | ||
* on given date, then list is empty. | ||
*/ | ||
public List<Holiday> instances(LocalDate date) { | ||
public List<Holiday> instances(final LocalDate date) { | ||
cacheHolidays(date.getYear()); | ||
|
||
final List<Holiday> instances = holidayInstances.get(date); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic.conditions; | ||
|
||
import java.time.MonthDay; | ||
|
@@ -36,7 +19,7 @@ public abstract class Condition { | |
* @param other other condition to be negated | ||
* @return new condition | ||
*/ | ||
public static final Condition not(Condition other) { | ||
public static final Condition not(final Condition other) { | ||
return new NegatedCondition(other); | ||
} | ||
|
||
|
@@ -71,7 +54,7 @@ public Condition() { | |
* @param pivot pivot date | ||
* @return self for fluent programming | ||
*/ | ||
public Condition withPivotDate(MonthDay pivot) { | ||
public Condition withPivotDate(final MonthDay pivot) { | ||
return this; | ||
} | ||
|
||
|
@@ -88,7 +71,7 @@ public String toString() { | |
* @return string representation of the current condition using the specified | ||
* prefix. | ||
*/ | ||
public String toString(String prefix) { | ||
public String toString(final String prefix) { | ||
return toString(prefix, false); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic.conditions; | ||
|
||
import java.time.Year; | ||
|
@@ -33,12 +16,12 @@ public class ConstantCondition extends Condition { | |
* | ||
* @param value value for the constant condition | ||
*/ | ||
public ConstantCondition(boolean value) { | ||
public ConstantCondition(final boolean value) { | ||
this.value = value; | ||
} | ||
|
||
@Override | ||
public boolean applies(Year year) { | ||
public boolean applies(final Year year) { | ||
return value; | ||
} | ||
|
||
|
@@ -52,7 +35,7 @@ public boolean isValue() { | |
} | ||
|
||
@Override | ||
public String toString(String prefix, boolean negated) { | ||
public String toString(final String prefix, final boolean negated) { | ||
return ((negated ? !value : value) ? "" : "never"); | ||
} | ||
|
||
|
@@ -62,7 +45,7 @@ public int hashCode() { | |
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
public boolean equals(final Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic.conditions; | ||
|
||
import static java.util.stream.Collectors.joining; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.MonthDay; | ||
import java.time.Year; | ||
import java.util.Arrays; | ||
import java.util.HashSet; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
import java.time.*; | ||
import java.util.*; | ||
|
||
import org.itsallcode.holidays.calculator.logic.Formatter; | ||
|
||
|
@@ -50,7 +28,7 @@ public class DayOfWeekCondition extends Condition { | |
* @param daysOfWeek days of the week on which the current condition shall be | ||
* {@code true}. | ||
*/ | ||
public DayOfWeekCondition(DayOfWeek... daysOfWeek) { | ||
public DayOfWeekCondition(final DayOfWeek... daysOfWeek) { | ||
this(null, daysOfWeek); | ||
} | ||
|
||
|
@@ -61,26 +39,26 @@ public DayOfWeekCondition(DayOfWeek... daysOfWeek) { | |
* @param pivot pivot date | ||
* @param daysOfWeek days of the week | ||
*/ | ||
public DayOfWeekCondition(MonthDay pivot, DayOfWeek... daysOfWeek) { | ||
public DayOfWeekCondition(final MonthDay pivot, final DayOfWeek... daysOfWeek) { | ||
this.pivot = pivot; | ||
this.daysOfWeek.addAll(Arrays.asList(daysOfWeek)); | ||
} | ||
|
||
@Override | ||
public boolean applies(Year year) { | ||
public boolean applies(final Year year) { | ||
return daysOfWeek.contains(year.atMonthDay(pivot).getDayOfWeek()); | ||
} | ||
|
||
@Override | ||
public Condition withPivotDate(MonthDay pivot) { | ||
public Condition withPivotDate(final MonthDay pivot) { | ||
if (this.pivot == null) { | ||
this.pivot = pivot; | ||
} | ||
return this; | ||
} | ||
|
||
@Override | ||
public String toString(String prefix, boolean negated) { | ||
public String toString(final String prefix, final boolean negated) { | ||
final String days = Arrays.asList(daysOfWeek.toArray(new DayOfWeek[0])) | ||
.stream() | ||
.sorted(DayOfWeek::compareTo) | ||
|
@@ -99,7 +77,7 @@ public int hashCode() { | |
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
public boolean equals(final Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
|
17 changes: 0 additions & 17 deletions
17
src/main/java/org/itsallcode/holidays/calculator/logic/conditions/NegatedCondition.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,3 @@ | ||
/** | ||
* holiday-calculator | ||
* Copyright (C) 2022 itsallcode <[email protected]> | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.itsallcode.holidays.calculator.logic.conditions; | ||
|
||
import java.time.Year; | ||
|
Oops, something went wrong.