Skip to content

Commit

Permalink
Remove license headers (#65)
Browse files Browse the repository at this point in the history
* 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
kaklakariada and kaklakariada authored Jul 7, 2024
1 parent da533d8 commit 3feef3b
Show file tree
Hide file tree
Showing 38 changed files with 104 additions and 726 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
with:
fetch-depth: 2

- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

- uses: actions/setup-java@v4
with:
distribution: 'temurin'
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.1] - unreleased
## [0.2.2] - unreleased

## [0.2.1] - 2024-07-07

- [#30](https://github.com/itsallcode/holiday-calculator/issues/30) Updated and enhanced [README.md](README.md).
- [#53](https://github.com/itsallcode/holiday-calculator/pull/53) Upgrade dependencies.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ repositories {
mavenCentral()
}
dependencies {
compile 'org.itsallcode:holiday-calculator:0.2.0'
compile 'org.itsallcode:holiday-calculator:0.2.1'
}
```

Expand All @@ -43,7 +43,7 @@ dependencies {
<dependency>
<groupId>org.itsallcode</groupId>
<artifactId>holiday-calculator</artifactId>
<version>0.2.0</version>
<version>0.2.1</version>
</dependency>
```

Expand Down
10 changes: 0 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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 {
Expand Down
15 changes: 0 additions & 15 deletions gradle/license-header.txt

This file was deleted.

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;
Expand Down Expand Up @@ -89,4 +72,4 @@ public static LocalDate orthodox(int year) {
return LocalDate.of(year, 5, day - 30);
}
}
}
}
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;
Expand Down
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;

Expand Down Expand Up @@ -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);
Expand Down
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;
Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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);
}

Expand Down
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;
Expand All @@ -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;
}

Expand All @@ -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");
}

Expand All @@ -62,7 +45,7 @@ public int hashCode() {
}

@Override
public boolean equals(Object obj) {
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
Expand Down
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;

Expand All @@ -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);
}

Expand All @@ -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)
Expand All @@ -99,7 +77,7 @@ public int hashCode() {
}

@Override
public boolean equals(Object obj) {
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
Expand Down
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;
Expand Down
Loading

0 comments on commit 3feef3b

Please sign in to comment.