Skip to content

Commit

Permalink
adding cubertura ignore for generated code. javadoc fixes for Calenda…
Browse files Browse the repository at this point in the history
…rUtil.
  • Loading branch information
svendiedrichsen committed Jan 2, 2018
1 parent d075629 commit 8c1c564
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 39 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@
<configuration>
<format>xml</format>
<maxmem>256m</maxmem>
<instrumentation>
<ignores>
<ignore>de.jollyday.config.*</ignore>
</ignores>
</instrumentation>
</configuration>
</plugin>
</plugins>
Expand Down
61 changes: 22 additions & 39 deletions src/main/java/de/jollyday/util/CalendarUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,10 @@ public LocalDate create(int year, int month, int day) {
/**
* Creates the date within the provided chronology.
*
* @param year
* a int.
* @param month
* a int.
* @param day
* a int.
* @param chronology
* the chronology to use
* @param year a int.
* @param month a int.
* @param day a int.
* @param chronology the chronology to use
* @return date the {@link LocalDate}
*/
public ChronoLocalDate create(int year, int month, int day, Chronology chronology) {
Expand All @@ -85,10 +81,8 @@ public ChronoLocalDate create(int year, int month, int day, Chronology chronolog
/**
* Creates the date from the month/day within the specified year.
*
* @param year
* a int.
* @param fixed
* a {@link de.jollyday.config.Fixed} object.
* @param year a int.
* @param fixed a {@link de.jollyday.config.Fixed} object.
* @return A local date instance.
*/
public LocalDate create(int year, Fixed fixed) {
Expand All @@ -98,21 +92,18 @@ public LocalDate create(int year, Fixed fixed) {
/**
* Creates a LocalDate. Does not use the Chronology of the Calendar.
*
* @param c
* a {@link java.util.Calendar} object.
* @param c a {@link java.util.Calendar} object.
* @return The local date representing the provided date.
*/
public LocalDate create(final Calendar c) {
//TODO: javadoc needs updating
return LocalDate.of(c.get(Calendar.YEAR), c.get(Calendar.MONTH) + 1, c
.get(Calendar.DAY_OF_MONTH));
}

/**
* Returns the easter sunday for a given year.
*
* @param year
* a int.
* @param year a int.
* @return Easter sunday.
*/
public LocalDate getEasterSunday(int year) {
Expand All @@ -126,8 +117,7 @@ public LocalDate getEasterSunday(int year) {
/**
* Returns the easter sunday within the julian chronology.
*
* @param year
* a int.
* @param year a int.
* @return julian easter sunday
*/
public LocalDate getJulianEasterSunday(int year) {
Expand All @@ -147,8 +137,7 @@ public LocalDate getJulianEasterSunday(int year) {
/**
* Returns the easter sunday within the gregorian chronology.
*
* @param year
* a int.
* @param year a int.
* @return gregorian easter sunday.
*/
public LocalDate getGregorianEasterSunday(int year) {
Expand All @@ -175,8 +164,7 @@ public LocalDate getGregorianEasterSunday(int year) {
/**
* Returns if this date is on a wekkend.
*
* @param date
* a {@link LocalDate} object.
* @param date a {@link LocalDate} object.
* @return is weekend
*/
public boolean isWeekend(final LocalDate date) {
Expand All @@ -190,12 +178,9 @@ public boolean isWeekend(final LocalDate date) {
* date in an gregorian year. i.e.: In the gregorian year 2008 there were
* two 1/1. They occurred on 1/10 and 12/29.
*
* @param gregorianYear
* a int.
* @param islamicMonth
* a int.
* @param islamicDay
* a int.
* @param gregorianYear a int.
* @param islamicMonth a int.
* @param islamicDay a int.
* @return List of gregorian dates for the islamic month/day.
*/
public Set<LocalDate> getIslamicHolidaysInGregorianYear(int gregorianYear, int islamicMonth, int islamicDay) {
Expand All @@ -209,13 +194,10 @@ public Set<LocalDate> getIslamicHolidaysInGregorianYear(int gregorianYear, int i
* different from the gregorian there may be more than one occurrence of an
* ethiopian orthodox date in an gregorian year.
*
* @param gregorianYear
* a int.
* @param gregorianYear a int.
* @param eoMonth a int.
* @param eoDay a int.
* @return List of gregorian dates for the ethiopian orthodox month/day.
* @param eoMonth
* a int.
* @param eoDay
* a int.
*/
public Set<LocalDate> getEthiopianOrthodoxHolidaysInGregorianYear(int gregorianYear, int eoMonth, int eoDay) {
return getDatesFromChronologyWithinGregorianYear(eoMonth, eoDay, gregorianYear, CopticChronology.INSTANCE);
Expand Down Expand Up @@ -243,7 +225,7 @@ private Set<LocalDate> getDatesFromChronologyWithinGregorianYear(int targetMonth
int targetYear = firstTargetDate.get(ChronoField.YEAR);
final int lastYear = lastTargetDate.get(ChronoField.YEAR);

for (; targetYear <= lastYear; ) {
while (targetYear <= lastYear) {
ChronoLocalDate d = targetChrono.date(targetYear, targetMonth, targetDay);
if (!firstGregorianDate.isAfter(d) && !lastGregorianDate.isBefore(d)) {
holidays.add(LocalDate.from(d));
Expand All @@ -256,8 +238,8 @@ private Set<LocalDate> getDatesFromChronologyWithinGregorianYear(int targetMonth
/**
* Shows if the requested date is contained in the Set of holidays.
*
* @param holidays a {@link java.util.Set} object.
* @param date a {@link LocalDate} object.
* @param holidays a {@link java.util.Set} object.
* @param date a {@link LocalDate} object.
* @param holidayType a {@link HolidayType} object
* @return contains this date
*/
Expand All @@ -267,8 +249,9 @@ public boolean contains(final Set<Holiday> holidays, final LocalDate date, final

/**
* Calls #contains(holidays, date, null)
*
* @param holidays the holidays to search through
* @param date the date to look for
* @param date the date to look for
* @return the date is contained in the set of holidays
*/
public boolean contains(final Set<Holiday> holidays, final LocalDate date) {
Expand Down

0 comments on commit 8c1c564

Please sign in to comment.