From 01a84a969e6dbdcc2d604254a93ed985e122bebb Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sat, 15 Jan 2022 22:24:41 +0100 Subject: [PATCH 01/43] Readme for the fork --- README | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/README b/README index 69d4bdd0..eb2dcfcd 100644 --- a/README +++ b/README @@ -1,7 +1,30 @@ +## What + Natty is a natural language date parser written in Java. Given a date expression, natty will apply standard language recognition and translation techniques to produce a list of corresponding dates with optional parse and syntax information. -Complete documentation can be found here: -http://natty.joestelmach.com +## History + +Originally written by Joel Stelmach at https://github.com/joestelmach/natty and developed between 2010 and 2017. Abandoned since then. + +## Idea behind the fork + +Started with [a thread in the original project](https://github.com/joestelmach/natty/issues/274). The aim is to try providing maintenance for the library. + +Plan / Priorities (as of January 2022): + +1. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. Release version `1.0.0` with (possibly) the same code +as the fork root, but under new name, etc. +2. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( +https://github.com/joestelmach/natty/issues) +3. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be +great - i.e. focus on i18n, customization, stability, or what? + +## Contibutions + +Are more then welcome. Feel free to reach out (e.g. by creating an issue in this repo) to offer your support and ideas. I am happy to include more +maintainers. + +I see this project potentially being welcoming to many, incl. quite junior and inexperienced developers, who would like to learn and contribute. From 66c3d4d35333243296792af8de439d790d70af3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sat, 15 Jan 2022 22:25:30 +0100 Subject: [PATCH 02/43] README.md --- README => README.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename README => README.md (100%) diff --git a/README b/README.md similarity index 100% rename from README rename to README.md From 31f9157efb2f2a9800ca5cf1fd439925620bf65f Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sat, 15 Jan 2022 22:28:00 +0100 Subject: [PATCH 03/43] renaming added to the plan --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb2dcfcd..6b6ba222 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Started with [a thread in the original project](https://github.com/joestelmach/n Plan / Priorities (as of January 2022): 1. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. Release version `1.0.0` with (possibly) the same code -as the fork root, but under new name, etc. +as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc. 2. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( https://github.com/joestelmach/natty/issues) 3. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be From dfa60c9f790c3668dfc233c444f729527616dabd Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sun, 16 Jan 2022 15:25:53 +0100 Subject: [PATCH 04/43] Add tests --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6b6ba222..0c478372 100644 --- a/README.md +++ b/README.md @@ -15,11 +15,12 @@ Started with [a thread in the original project](https://github.com/joestelmach/n Plan / Priorities (as of January 2022): -1. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. Release version `1.0.0` with (possibly) the same code +1. Fix the tests (some are failing?). +2. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. Release version `1.0.0` with (possibly) the same code as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc. -2. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( +3. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( https://github.com/joestelmach/natty/issues) -3. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be +4. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be great - i.e. focus on i18n, customization, stability, or what? ## Contibutions From 548b4f2cd0dc10b9ea8e0bd87d1bea5f0e9b8307 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Fri, 21 Jan 2022 21:58:11 +0100 Subject: [PATCH 05/43] Ignoring natty.iml --- .gitignore | 5 ++++- natty.iml | 31 ------------------------------- 2 files changed, 4 insertions(+), 32 deletions(-) delete mode 100644 natty.iml diff --git a/.gitignore b/.gitignore index 8f3706cb..5600eaa5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .classpath .settings .project -.idea workspace.xml bin target @@ -9,3 +8,7 @@ src/main/java/com/joestelmach/natty/generated/* src/main/java/*.tokens src/main/antlr3/com/joestelmach/natty/generated/DebugDateParser.g src/main/antlr3/com/joestelmach/natty/generated/DebugDateWalker.g + +# IntelliJ Idea +*.iml +.idea diff --git a/natty.iml b/natty.iml deleted file mode 100644 index b8cf0290..00000000 --- a/natty.iml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From f9b4857a912708366f089ef6abdcd3ee5d3a7171 Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Fri, 21 Jan 2022 22:01:13 +0100 Subject: [PATCH 06/43] Mention of Gradle added --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0c478372..67c9daac 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ Plan / Priorities (as of January 2022): as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc. 3. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( https://github.com/joestelmach/natty/issues) -4. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be +4. Consider switching to Gradle (as this is a build tool which is modern and I am familiar with) +5. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be great - i.e. focus on i18n, customization, stability, or what? ## Contibutions From bdddd0b16872ab85ba81fc9180f629c045f63b6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Fri, 21 Jan 2022 22:08:33 +0100 Subject: [PATCH 07/43] Ignoring failing tests --- src/test/java/com/joestelmach/natty/DateTimeTest.java | 3 +++ src/test/java/com/joestelmach/natty/RecurrenceTest.java | 2 ++ src/test/java/com/joestelmach/natty/ThreadSafetyTest.java | 2 ++ src/test/java/com/joestelmach/natty/TimeTest.java | 1 + src/test/java/com/joestelmach/natty/TimeZoneTest.java | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/test/java/com/joestelmach/natty/DateTimeTest.java b/src/test/java/com/joestelmach/natty/DateTimeTest.java index e1f3570f..86bf5eea 100644 --- a/src/test/java/com/joestelmach/natty/DateTimeTest.java +++ b/src/test/java/com/joestelmach/natty/DateTimeTest.java @@ -2,6 +2,7 @@ import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; @@ -24,6 +25,7 @@ public static void oneTime() { } @Test + @Ignore("https://github.com/natty-parser/natty/issues/1") public void testSpecific() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).parse("5/19/2012 12:00 am"); @@ -46,6 +48,7 @@ public void testSpecific() throws Exception { } @Test + @Ignore("https://github.com/natty-parser/natty/issues/1") public void testRelative() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).parse("2/24/2011 12:00 am"); diff --git a/src/test/java/com/joestelmach/natty/RecurrenceTest.java b/src/test/java/com/joestelmach/natty/RecurrenceTest.java index f306c502..d64723e8 100644 --- a/src/test/java/com/joestelmach/natty/RecurrenceTest.java +++ b/src/test/java/com/joestelmach/natty/RecurrenceTest.java @@ -8,6 +8,7 @@ import junit.framework.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; /** @@ -23,6 +24,7 @@ public static void oneTime() { } @Test + @Ignore("https://github.com/natty-parser/natty/issues/1") public void testRelative() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).parse("3/3/2011 12:00 am"); diff --git a/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java b/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java index 8d2774dc..6e7a9ec9 100644 --- a/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java +++ b/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java @@ -8,6 +8,7 @@ import org.junit.Assert; +import org.junit.Ignore; import org.junit.Test; import org.junit.BeforeClass; @@ -28,6 +29,7 @@ public static void oneTime() { } @Test + @Ignore("https://github.com/natty-parser/natty/issues/1") public void testManyThreads() throws Exception { Thread[] threads = new Thread[NUM_OF_THREADS]; for (int i = 0; i < NUM_OF_THREADS; i++) { diff --git a/src/test/java/com/joestelmach/natty/TimeTest.java b/src/test/java/com/joestelmach/natty/TimeTest.java index 3d4bb70e..87cfe4c6 100644 --- a/src/test/java/com/joestelmach/natty/TimeTest.java +++ b/src/test/java/com/joestelmach/natty/TimeTest.java @@ -2,6 +2,7 @@ import org.junit.Assert; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; diff --git a/src/test/java/com/joestelmach/natty/TimeZoneTest.java b/src/test/java/com/joestelmach/natty/TimeZoneTest.java index 5dfb8308..1d65ca71 100644 --- a/src/test/java/com/joestelmach/natty/TimeZoneTest.java +++ b/src/test/java/com/joestelmach/natty/TimeZoneTest.java @@ -1,6 +1,7 @@ package com.joestelmach.natty; import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; @@ -18,6 +19,7 @@ public static void oneTime() { } @Test + @Ignore("https://github.com/natty-parser/natty/issues/1") public void testSpecific() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).parse("5/19/2012 12:00 am"); From 3caac2053d3fe21305d44b28f3800a18076c6174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Fri, 21 Jan 2022 22:32:22 +0100 Subject: [PATCH 08/43] Renaming to org.natty --- .gitignore | 6 +-- pom.xml | 41 +++++++++---------- .../natty/generated/DateLexer.g | 4 +- .../natty/generated/DateParser.g | 4 +- .../natty/generated/DateWalker.g | 8 ++-- .../natty/generated/TreeRewrite.g | 2 +- .../natty/generated/imports/NumericRules.g | 0 .../natty/ANTLRNoCaseInputStream.java | 2 +- .../natty/CalendarSource.java | 2 +- .../joestelmach => org}/natty/DateGroup.java | 2 +- .../joestelmach => org}/natty/Holiday.java | 2 +- .../natty/IcsSearcher.java | 2 +- .../natty/NattyTokenSource.java | 2 +- .../natty/ParseListener.java | 2 +- .../natty/ParseLocation.java | 2 +- .../joestelmach => org}/natty/Parser.java | 10 ++--- .../joestelmach => org}/natty/Season.java | 2 +- .../natty/WalkerState.java | 2 +- src/test/gunit/DateLexer.testsuite | 2 +- .../natty/AbstractTest.java | 2 +- .../joestelmach => org}/natty/CPANTest.java | 2 +- .../joestelmach => org}/natty/DateTest.java | 4 +- .../natty/DateTimeTest.java | 2 +- .../joestelmach => org}/natty/IcsTest.java | 2 +- .../natty/RecurrenceTest.java | 2 +- .../joestelmach => org}/natty/SearchTest.java | 2 +- .../natty/ThreadSafetyTest.java | 2 +- .../joestelmach => org}/natty/TimeTest.java | 3 +- .../natty/TimeZoneTest.java | 2 +- .../natty/grammar/AbstractGrammarTest.java | 14 +++---- .../natty/grammar/DateGrammarTest.java | 2 +- .../natty/grammar/DateTimeGrammarTest.java | 2 +- .../natty/grammar/HolidayGrammarTest.java | 2 +- .../natty/grammar/NumericGrammarTest.java | 2 +- .../natty/grammar/TimeGrammarTest.java | 2 +- 35 files changed, 71 insertions(+), 73 deletions(-) rename src/main/antlr3/{com/joestelmach => org}/natty/generated/DateLexer.g (98%) rename src/main/antlr3/{com/joestelmach => org}/natty/generated/DateParser.g (99%) rename src/main/antlr3/{com/joestelmach => org}/natty/generated/DateWalker.g (93%) rename src/main/antlr3/{com/joestelmach => org}/natty/generated/TreeRewrite.g (96%) rename src/main/antlr3/{com/joestelmach => org}/natty/generated/imports/NumericRules.g (100%) rename src/main/java/{com/joestelmach => org}/natty/ANTLRNoCaseInputStream.java (95%) rename src/main/java/{com/joestelmach => org}/natty/CalendarSource.java (95%) rename src/main/java/{com/joestelmach => org}/natty/DateGroup.java (99%) rename src/main/java/{com/joestelmach => org}/natty/Holiday.java (97%) rename src/main/java/{com/joestelmach => org}/natty/IcsSearcher.java (99%) rename src/main/java/{com/joestelmach => org}/natty/NattyTokenSource.java (95%) rename src/main/java/{com/joestelmach => org}/natty/ParseListener.java (98%) rename src/main/java/{com/joestelmach => org}/natty/ParseLocation.java (96%) rename src/main/java/{com/joestelmach => org}/natty/Parser.java (98%) rename src/main/java/{com/joestelmach => org}/natty/Season.java (95%) rename src/main/java/{com/joestelmach => org}/natty/WalkerState.java (99%) rename src/test/java/{com/joestelmach => org}/natty/AbstractTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/CPANTest.java (96%) rename src/test/java/{com/joestelmach => org}/natty/DateTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/DateTimeTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/IcsTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/RecurrenceTest.java (97%) rename src/test/java/{com/joestelmach => org}/natty/SearchTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/ThreadSafetyTest.java (98%) rename src/test/java/{com/joestelmach => org}/natty/TimeTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/TimeZoneTest.java (98%) rename src/test/java/{com/joestelmach => org}/natty/grammar/AbstractGrammarTest.java (82%) rename src/test/java/{com/joestelmach => org}/natty/grammar/DateGrammarTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/grammar/DateTimeGrammarTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/grammar/HolidayGrammarTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/grammar/NumericGrammarTest.java (99%) rename src/test/java/{com/joestelmach => org}/natty/grammar/TimeGrammarTest.java (99%) diff --git a/.gitignore b/.gitignore index 5600eaa5..8a54c833 100644 --- a/.gitignore +++ b/.gitignore @@ -4,10 +4,10 @@ workspace.xml bin target -src/main/java/com/joestelmach/natty/generated/* +src/main/java/org/natty/generated/* src/main/java/*.tokens -src/main/antlr3/com/joestelmach/natty/generated/DebugDateParser.g -src/main/antlr3/com/joestelmach/natty/generated/DebugDateWalker.g +src/main/antlr3/org/natty/generated/DebugDateParser.g +src/main/antlr3/org/natty/generated/DebugDateWalker.g # IntelliJ Idea *.iml diff --git a/pom.xml b/pom.xml index c8db661e..b7279657 100644 --- a/pom.xml +++ b/pom.xml @@ -1,41 +1,40 @@ 4.0.0 - com.joestelmach + natty-parser natty jar 0.14-SNAPSHOT Natty Date Parser natural language date parser - http://natty.joestelmach.com + https://github.com/natty-parser/natty MIT License - LICENSE + https://opensource.org/licenses/MIT - scm:git:git@github.com:joestelmach/natty.git - scm:git:git@github.com:joestelmach/natty.git - scm:git:git@github.com:joestelmach/natty.git + scm:git:git@github.com:natty-parser/natty.git + scm:git:git@github.com:natty-parser/natty.git + scm:git:git@github.com:natty-parser/natty.git - joe - Joe Stelmach - joestelmach@gmail.com - http://github.com/joestelmach + mccartney + Greg Oledzki + http://github.com/mccartney developer - -5 + 1 - ${basedir}/src/main/antlr3/com/joestelmach/natty/generated + ${basedir}/src/main/antlr3/org/natty/generated UTF-8 UTF-8 -Xdoclint:none @@ -98,7 +97,7 @@ - src/main/java/com/joestelmach/natty/generated + src/main/java/org/natty/generated **/*.java @@ -122,14 +121,14 @@ true - src/main/antlr3/com/joestelmach/natty/generated/imports + src/main/antlr3/org/natty/generated/imports src/main/java - com/joestelmach/natty/generated/DateLexer.g - com/joestelmach/natty/generated/DateParser.g + org/natty/generated/DateLexer.g + org/natty/generated/DateParser.g - com/joestelmach/natty/generated/imports/NumericRules.g + org/natty/generated/imports/NumericRules.g @@ -142,11 +141,11 @@ false src/main/java - src/main/antlr3/com/joestelmach/natty/generated/imports + src/main/antlr3/org/natty/generated/imports - com/joestelmach/natty/generated/DateLexer.g - com/joestelmach/natty/generated/DateParser.g - com/joestelmach/natty/generated/imports/NumericRules.g + org/natty/generated/DateLexer.g + org/natty/generated/DateParser.g + org/natty/generated/imports/NumericRules.g diff --git a/src/main/antlr3/com/joestelmach/natty/generated/DateLexer.g b/src/main/antlr3/org/natty/generated/DateLexer.g similarity index 98% rename from src/main/antlr3/com/joestelmach/natty/generated/DateLexer.g rename to src/main/antlr3/org/natty/generated/DateLexer.g index 5f85fa30..1e2d06f4 100644 --- a/src/main/antlr3/com/joestelmach/natty/generated/DateLexer.g +++ b/src/main/antlr3/org/natty/generated/DateLexer.g @@ -1,10 +1,10 @@ lexer grammar DateLexer; -@header { package com.joestelmach.natty.generated; } +@header { package org.natty.generated; } @members { private static org.slf4j.Logger _logger = - org.slf4j.LoggerFactory.getLogger(com.joestelmach.natty.generated.DateLexer.class); + org.slf4j.LoggerFactory.getLogger(org.natty.generated.DateLexer.class); @Override public void displayRecognitionError(String[] tokenNames, RecognitionException re) { diff --git a/src/main/antlr3/com/joestelmach/natty/generated/DateParser.g b/src/main/antlr3/org/natty/generated/DateParser.g similarity index 99% rename from src/main/antlr3/com/joestelmach/natty/generated/DateParser.g rename to src/main/antlr3/org/natty/generated/DateParser.g index d3c99128..a4addaa4 100644 --- a/src/main/antlr3/com/joestelmach/natty/generated/DateParser.g +++ b/src/main/antlr3/org/natty/generated/DateParser.g @@ -37,12 +37,12 @@ tokens { } @header { - package com.joestelmach.natty.generated; + package org.natty.generated; } @members { private static org.slf4j.Logger _logger = - org.slf4j.LoggerFactory.getLogger(com.joestelmach.natty.generated.DateParser.class); + org.slf4j.LoggerFactory.getLogger(org.natty.generated.DateParser.class); @Override public void displayRecognitionError(String[] tokenNames, RecognitionException re) { diff --git a/src/main/antlr3/com/joestelmach/natty/generated/DateWalker.g b/src/main/antlr3/org/natty/generated/DateWalker.g similarity index 93% rename from src/main/antlr3/com/joestelmach/natty/generated/DateWalker.g rename to src/main/antlr3/org/natty/generated/DateWalker.g index 8d87db3b..0d198147 100644 --- a/src/main/antlr3/com/joestelmach/natty/generated/DateWalker.g +++ b/src/main/antlr3/org/natty/generated/DateWalker.g @@ -5,10 +5,10 @@ options { ASTLabelType=CommonTree; } -@header { package com.joestelmach.natty.generated; } +@header { package org.natty.generated; } @members { - private com.joestelmach.natty.WalkerState _walkerState; + private org.natty.WalkerState _walkerState; private java.util.Date referenceDate; @Override @@ -27,9 +27,9 @@ options { this.referenceDate = referenceDate; } - public com.joestelmach.natty.WalkerState getState() { + public org.natty.WalkerState getState() { if(_walkerState==null) { - _walkerState = new com.joestelmach.natty.WalkerState(referenceDate); + _walkerState = new org.natty.WalkerState(referenceDate); } return _walkerState; } diff --git a/src/main/antlr3/com/joestelmach/natty/generated/TreeRewrite.g b/src/main/antlr3/org/natty/generated/TreeRewrite.g similarity index 96% rename from src/main/antlr3/com/joestelmach/natty/generated/TreeRewrite.g rename to src/main/antlr3/org/natty/generated/TreeRewrite.g index 4ca30869..f34be981 100644 --- a/src/main/antlr3/com/joestelmach/natty/generated/TreeRewrite.g +++ b/src/main/antlr3/org/natty/generated/TreeRewrite.g @@ -7,7 +7,7 @@ options { filter=true; } -@header { package com.joestelmach.natty.generated; } +@header { package org.natty.generated; } @members { @Override diff --git a/src/main/antlr3/com/joestelmach/natty/generated/imports/NumericRules.g b/src/main/antlr3/org/natty/generated/imports/NumericRules.g similarity index 100% rename from src/main/antlr3/com/joestelmach/natty/generated/imports/NumericRules.g rename to src/main/antlr3/org/natty/generated/imports/NumericRules.g diff --git a/src/main/java/com/joestelmach/natty/ANTLRNoCaseInputStream.java b/src/main/java/org/natty/ANTLRNoCaseInputStream.java similarity index 95% rename from src/main/java/com/joestelmach/natty/ANTLRNoCaseInputStream.java rename to src/main/java/org/natty/ANTLRNoCaseInputStream.java index 48448f75..30e86dcd 100644 --- a/src/main/java/com/joestelmach/natty/ANTLRNoCaseInputStream.java +++ b/src/main/java/org/natty/ANTLRNoCaseInputStream.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/com/joestelmach/natty/CalendarSource.java b/src/main/java/org/natty/CalendarSource.java similarity index 95% rename from src/main/java/com/joestelmach/natty/CalendarSource.java rename to src/main/java/org/natty/CalendarSource.java index fea7a30b..bd89e44a 100644 --- a/src/main/java/com/joestelmach/natty/CalendarSource.java +++ b/src/main/java/org/natty/CalendarSource.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.util.Date; import java.util.GregorianCalendar; diff --git a/src/main/java/com/joestelmach/natty/DateGroup.java b/src/main/java/org/natty/DateGroup.java similarity index 99% rename from src/main/java/com/joestelmach/natty/DateGroup.java rename to src/main/java/org/natty/DateGroup.java index 5adb99eb..243a7495 100644 --- a/src/main/java/com/joestelmach/natty/DateGroup.java +++ b/src/main/java/org/natty/DateGroup.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.antlr.runtime.tree.Tree; diff --git a/src/main/java/com/joestelmach/natty/Holiday.java b/src/main/java/org/natty/Holiday.java similarity index 97% rename from src/main/java/com/joestelmach/natty/Holiday.java rename to src/main/java/org/natty/Holiday.java index fdb5414f..773a7b68 100644 --- a/src/main/java/com/joestelmach/natty/Holiday.java +++ b/src/main/java/org/natty/Holiday.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/joestelmach/natty/IcsSearcher.java b/src/main/java/org/natty/IcsSearcher.java similarity index 99% rename from src/main/java/com/joestelmach/natty/IcsSearcher.java rename to src/main/java/org/natty/IcsSearcher.java index ddf058d3..521fde3b 100644 --- a/src/main/java/com/joestelmach/natty/IcsSearcher.java +++ b/src/main/java/org/natty/IcsSearcher.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import net.fortuna.ical4j.data.CalendarBuilder; import net.fortuna.ical4j.data.ParserException; diff --git a/src/main/java/com/joestelmach/natty/NattyTokenSource.java b/src/main/java/org/natty/NattyTokenSource.java similarity index 95% rename from src/main/java/com/joestelmach/natty/NattyTokenSource.java rename to src/main/java/org/natty/NattyTokenSource.java index cc69972f..3944e786 100644 --- a/src/main/java/com/joestelmach/natty/NattyTokenSource.java +++ b/src/main/java/org/natty/NattyTokenSource.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.util.List; diff --git a/src/main/java/com/joestelmach/natty/ParseListener.java b/src/main/java/org/natty/ParseListener.java similarity index 98% rename from src/main/java/com/joestelmach/natty/ParseListener.java rename to src/main/java/org/natty/ParseListener.java index 6784eb35..3a3b8454 100644 --- a/src/main/java/com/joestelmach/natty/ParseListener.java +++ b/src/main/java/org/natty/ParseListener.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.antlr.runtime.RecognitionException; import org.antlr.runtime.Token; diff --git a/src/main/java/com/joestelmach/natty/ParseLocation.java b/src/main/java/org/natty/ParseLocation.java similarity index 96% rename from src/main/java/com/joestelmach/natty/ParseLocation.java rename to src/main/java/org/natty/ParseLocation.java index 3636d024..c69a042a 100644 --- a/src/main/java/com/joestelmach/natty/ParseLocation.java +++ b/src/main/java/org/natty/ParseLocation.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; /** * Represents an invocation of a parse rule diff --git a/src/main/java/com/joestelmach/natty/Parser.java b/src/main/java/org/natty/Parser.java similarity index 98% rename from src/main/java/com/joestelmach/natty/Parser.java rename to src/main/java/org/natty/Parser.java index 9a0f666f..608c0f6c 100644 --- a/src/main/java/com/joestelmach/natty/Parser.java +++ b/src/main/java/org/natty/Parser.java @@ -1,9 +1,9 @@ -package com.joestelmach.natty; +package org.natty; -import com.joestelmach.natty.generated.DateLexer; -import com.joestelmach.natty.generated.DateParser; -import com.joestelmach.natty.generated.DateWalker; -import com.joestelmach.natty.generated.TreeRewrite; +import org.natty.generated.DateLexer; +import org.natty.generated.DateParser; +import org.natty.generated.DateWalker; +import org.natty.generated.TreeRewrite; import org.antlr.runtime.*; import org.antlr.runtime.tree.CommonTree; import org.antlr.runtime.tree.CommonTreeNodeStream; diff --git a/src/main/java/com/joestelmach/natty/Season.java b/src/main/java/org/natty/Season.java similarity index 95% rename from src/main/java/com/joestelmach/natty/Season.java rename to src/main/java/org/natty/Season.java index b0f5f8a9..3bc73bb7 100644 --- a/src/main/java/com/joestelmach/natty/Season.java +++ b/src/main/java/org/natty/Season.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/joestelmach/natty/WalkerState.java b/src/main/java/org/natty/WalkerState.java similarity index 99% rename from src/main/java/com/joestelmach/natty/WalkerState.java rename to src/main/java/org/natty/WalkerState.java index 58f29ee3..36834f96 100644 --- a/src/main/java/com/joestelmach/natty/WalkerState.java +++ b/src/main/java/org/natty/WalkerState.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.util.*; diff --git a/src/test/gunit/DateLexer.testsuite b/src/test/gunit/DateLexer.testsuite index 7ccea6a7..fa895a93 100644 --- a/src/test/gunit/DateLexer.testsuite +++ b/src/test/gunit/DateLexer.testsuite @@ -1,5 +1,5 @@ gunit Date; -@header{package com.joestelmach.natty.generated;} +@header{package org.natty.generated;} JANUARY: "january" OK diff --git a/src/test/java/com/joestelmach/natty/AbstractTest.java b/src/test/java/org/natty/AbstractTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/AbstractTest.java rename to src/test/java/org/natty/AbstractTest.java index 34e235df..32382b2e 100644 --- a/src/test/java/com/joestelmach/natty/AbstractTest.java +++ b/src/test/java/org/natty/AbstractTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.junit.Assert; import org.junit.Before; diff --git a/src/test/java/com/joestelmach/natty/CPANTest.java b/src/test/java/org/natty/CPANTest.java similarity index 96% rename from src/test/java/com/joestelmach/natty/CPANTest.java rename to src/test/java/org/natty/CPANTest.java index c1081e5a..df3a0eed 100644 --- a/src/test/java/com/joestelmach/natty/CPANTest.java +++ b/src/test/java/org/natty/CPANTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.io.BufferedReader; import java.io.InputStreamReader; diff --git a/src/test/java/com/joestelmach/natty/DateTest.java b/src/test/java/org/natty/DateTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/DateTest.java rename to src/test/java/org/natty/DateTest.java index c0152878..8b9ec017 100644 --- a/src/test/java/com/joestelmach/natty/DateTest.java +++ b/src/test/java/org/natty/DateTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import junit.framework.Assert; import org.apache.log4j.Level; @@ -346,7 +346,7 @@ public void testRange() throws Exception { validateDate(dates.get(1), 5, 2, 2011); } - // https://github.com/joestelmach/natty/issues/38 + // https://github.org/natty/issues/38 @Test public void testRelativeDateDifferentTimezone() { // Prepare diff --git a/src/test/java/com/joestelmach/natty/DateTimeTest.java b/src/test/java/org/natty/DateTimeTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/DateTimeTest.java rename to src/test/java/org/natty/DateTimeTest.java index 86bf5eea..ca747257 100644 --- a/src/test/java/com/joestelmach/natty/DateTimeTest.java +++ b/src/test/java/org/natty/DateTimeTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.junit.Assert; import org.junit.BeforeClass; diff --git a/src/test/java/com/joestelmach/natty/IcsTest.java b/src/test/java/org/natty/IcsTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/IcsTest.java rename to src/test/java/org/natty/IcsTest.java index 48836955..78e16970 100644 --- a/src/test/java/com/joestelmach/natty/IcsTest.java +++ b/src/test/java/org/natty/IcsTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.junit.BeforeClass; import org.junit.Test; diff --git a/src/test/java/com/joestelmach/natty/RecurrenceTest.java b/src/test/java/org/natty/RecurrenceTest.java similarity index 97% rename from src/test/java/com/joestelmach/natty/RecurrenceTest.java rename to src/test/java/org/natty/RecurrenceTest.java index d64723e8..fce7d800 100644 --- a/src/test/java/com/joestelmach/natty/RecurrenceTest.java +++ b/src/test/java/org/natty/RecurrenceTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.text.DateFormat; import java.util.Date; diff --git a/src/test/java/com/joestelmach/natty/SearchTest.java b/src/test/java/org/natty/SearchTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/SearchTest.java rename to src/test/java/org/natty/SearchTest.java index 2df0adac..140375d8 100644 --- a/src/test/java/com/joestelmach/natty/SearchTest.java +++ b/src/test/java/org/natty/SearchTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import junit.framework.Assert; import org.junit.BeforeClass; diff --git a/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java b/src/test/java/org/natty/ThreadSafetyTest.java similarity index 98% rename from src/test/java/com/joestelmach/natty/ThreadSafetyTest.java rename to src/test/java/org/natty/ThreadSafetyTest.java index 6e7a9ec9..1a49847e 100644 --- a/src/test/java/com/joestelmach/natty/ThreadSafetyTest.java +++ b/src/test/java/org/natty/ThreadSafetyTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import java.text.DateFormat; import java.util.Date; diff --git a/src/test/java/com/joestelmach/natty/TimeTest.java b/src/test/java/org/natty/TimeTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/TimeTest.java rename to src/test/java/org/natty/TimeTest.java index 87cfe4c6..671ff3ad 100644 --- a/src/test/java/com/joestelmach/natty/TimeTest.java +++ b/src/test/java/org/natty/TimeTest.java @@ -1,8 +1,7 @@ -package com.joestelmach.natty; +package org.natty; import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; diff --git a/src/test/java/com/joestelmach/natty/TimeZoneTest.java b/src/test/java/org/natty/TimeZoneTest.java similarity index 98% rename from src/test/java/com/joestelmach/natty/TimeZoneTest.java rename to src/test/java/org/natty/TimeZoneTest.java index 1d65ca71..fb0d2e1f 100644 --- a/src/test/java/com/joestelmach/natty/TimeZoneTest.java +++ b/src/test/java/org/natty/TimeZoneTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty; +package org.natty; import org.junit.BeforeClass; import org.junit.Ignore; diff --git a/src/test/java/com/joestelmach/natty/grammar/AbstractGrammarTest.java b/src/test/java/org/natty/grammar/AbstractGrammarTest.java similarity index 82% rename from src/test/java/com/joestelmach/natty/grammar/AbstractGrammarTest.java rename to src/test/java/org/natty/grammar/AbstractGrammarTest.java index 1e3a69fc..65080d15 100644 --- a/src/test/java/com/joestelmach/natty/grammar/AbstractGrammarTest.java +++ b/src/test/java/org/natty/grammar/AbstractGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import java.io.ByteArrayInputStream; import java.lang.reflect.Method; @@ -12,11 +12,11 @@ import org.antlr.runtime.tree.CommonTreeNodeStream; import org.antlr.runtime.tree.Tree; -import com.joestelmach.natty.ANTLRNoCaseInputStream; -import com.joestelmach.natty.ParseListener; -import com.joestelmach.natty.generated.DateLexer; -import com.joestelmach.natty.generated.DateParser; -import com.joestelmach.natty.generated.TreeRewrite; +import org.natty.ANTLRNoCaseInputStream; +import org.natty.ParseListener; +import org.natty.generated.DateLexer; +import org.natty.generated.DateParser; +import org.natty.generated.TreeRewrite; public abstract class AbstractGrammarTest { protected String _ruleName; @@ -38,7 +38,7 @@ protected void assertAST(String input, String ast) throws Exception { */ protected String buildAST(String value) throws Exception { DateParser parser = buildParser(value); - Class klass = Class.forName("com.joestelmach.natty.generated.DateParser"); + Class klass = Class.forName("org.natty.generated.DateParser"); Method meth = klass.getMethod(_ruleName, (Class[]) null); ParserRuleReturnScope ret = (ParserRuleReturnScope) meth.invoke(parser, (Object[]) null); diff --git a/src/test/java/com/joestelmach/natty/grammar/DateGrammarTest.java b/src/test/java/org/natty/grammar/DateGrammarTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/grammar/DateGrammarTest.java rename to src/test/java/org/natty/grammar/DateGrammarTest.java index ebae82f9..c97b3466 100644 --- a/src/test/java/com/joestelmach/natty/grammar/DateGrammarTest.java +++ b/src/test/java/org/natty/grammar/DateGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import org.junit.Test; diff --git a/src/test/java/com/joestelmach/natty/grammar/DateTimeGrammarTest.java b/src/test/java/org/natty/grammar/DateTimeGrammarTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/grammar/DateTimeGrammarTest.java rename to src/test/java/org/natty/grammar/DateTimeGrammarTest.java index 49d09f97..734e1571 100644 --- a/src/test/java/com/joestelmach/natty/grammar/DateTimeGrammarTest.java +++ b/src/test/java/org/natty/grammar/DateTimeGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import org.junit.Test; diff --git a/src/test/java/com/joestelmach/natty/grammar/HolidayGrammarTest.java b/src/test/java/org/natty/grammar/HolidayGrammarTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/grammar/HolidayGrammarTest.java rename to src/test/java/org/natty/grammar/HolidayGrammarTest.java index fce221b4..083456ad 100644 --- a/src/test/java/com/joestelmach/natty/grammar/HolidayGrammarTest.java +++ b/src/test/java/org/natty/grammar/HolidayGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import org.junit.Test; diff --git a/src/test/java/com/joestelmach/natty/grammar/NumericGrammarTest.java b/src/test/java/org/natty/grammar/NumericGrammarTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/grammar/NumericGrammarTest.java rename to src/test/java/org/natty/grammar/NumericGrammarTest.java index 606dd15b..c81200bc 100644 --- a/src/test/java/com/joestelmach/natty/grammar/NumericGrammarTest.java +++ b/src/test/java/org/natty/grammar/NumericGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import org.junit.Test; diff --git a/src/test/java/com/joestelmach/natty/grammar/TimeGrammarTest.java b/src/test/java/org/natty/grammar/TimeGrammarTest.java similarity index 99% rename from src/test/java/com/joestelmach/natty/grammar/TimeGrammarTest.java rename to src/test/java/org/natty/grammar/TimeGrammarTest.java index b0eaba2f..12fb8545 100644 --- a/src/test/java/com/joestelmach/natty/grammar/TimeGrammarTest.java +++ b/src/test/java/org/natty/grammar/TimeGrammarTest.java @@ -1,4 +1,4 @@ -package com.joestelmach.natty.grammar; +package org.natty.grammar; import org.junit.Test; From c4a0d04f26aa34a18ffd662006de2bf373328720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Fri, 21 Jan 2022 22:46:38 +0100 Subject: [PATCH 09/43] io.github.natty-parser as the group id --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b7279657..7040e8a0 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - natty-parser + io.github.natty-parser natty jar 0.14-SNAPSHOT From c32e38575bc51713ad026d5de343d9dd2bdf8d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sat, 29 Jan 2022 22:20:26 +0100 Subject: [PATCH 10/43] Release of 1.0.0 --- README.md | 14 +++++++------- pom.xml | 21 +++++++++------------ 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 67c9daac..37be8238 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,13 @@ Started with [a thread in the original project](https://github.com/joestelmach/n Plan / Priorities (as of January 2022): -1. Fix the tests (some are failing?). -2. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. Release version `1.0.0` with (possibly) the same code -as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc. -3. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo]( -https://github.com/joestelmach/natty/issues) -4. Consider switching to Gradle (as this is a build tool which is modern and I am familiar with) -5. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be +1. ~~Release version `1.0.0` with (possibly) the same code as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc.~~ +DONE +2. Fix the tests (some are failing?). +3. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. +4. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo](https://github.com/joestelmach/natty/issues) +5. Consider switching to Gradle (as this is a build tool which is modern and I am familiar with) +6. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be great - i.e. focus on i18n, customization, stability, or what? ## Contibutions diff --git a/pom.xml b/pom.xml index 7040e8a0..764c729a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.github.natty-parser natty jar - 0.14-SNAPSHOT + 1.0.0 Natty Date Parser natural language date parser https://github.com/natty-parser/natty @@ -65,7 +65,7 @@ true ossrh - https://oss.sonatype.org/ + https://s01.oss.sonatype.org/ true @@ -200,29 +200,26 @@ - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 + maven-source-plugin + 2.2.1 - attach-javadocs + attach-sources - jar + jar-no-fork - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 + maven-javadoc-plugin + 2.9.1 - attach-sources + attach-javadocs jar From 721b7b5cc6ec13ddf02a6cf5a6ba0d0ceacfff6b Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Mon, 21 Feb 2022 13:01:03 +0100 Subject: [PATCH 11/43] Commitment --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 37be8238..031875b8 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,10 @@ DONE 6. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be great - i.e. focus on i18n, customization, stability, or what? +## Commitment + +I hope for open collaboration and contributions from others. To me it's totally a side-project, not the core activity. Yet, I can commit to being (fairly) responsive and inclusive. + ## Contibutions Are more then welcome. Feel free to reach out (e.g. by creating an issue in this repo) to offer your support and ideas. I am happy to include more From df54c2985a35d2f172960d43f317d0c85780e1cb Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sun, 6 Mar 2022 21:52:48 +0100 Subject: [PATCH 12/43] January -> March, time flies --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 031875b8..08d63c97 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Originally written by Joel Stelmach at https://github.com/joestelmach/natty and Started with [a thread in the original project](https://github.com/joestelmach/natty/issues/274). The aim is to try providing maintenance for the library. -Plan / Priorities (as of January 2022): +Plan / Priorities (as of March 2022): 1. ~~Release version `1.0.0` with (possibly) the same code as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc.~~ DONE From 057a1b2d7c21d991ae1855017168895a05067b33 Mon Sep 17 00:00:00 2001 From: Andi Date: Sun, 8 May 2022 23:00:24 +0200 Subject: [PATCH 13/43] fix #1: fix broken tests by correcting date format --- src/test/java/org/natty/DateTimeTest.java | 7 ++----- src/test/java/org/natty/RecurrenceTest.java | 4 +--- src/test/java/org/natty/ThreadSafetyTest.java | 4 +--- src/test/java/org/natty/TimeZoneTest.java | 4 +--- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/natty/DateTimeTest.java b/src/test/java/org/natty/DateTimeTest.java index ca747257..678f48f1 100644 --- a/src/test/java/org/natty/DateTimeTest.java +++ b/src/test/java/org/natty/DateTimeTest.java @@ -2,7 +2,6 @@ import org.junit.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; @@ -25,10 +24,9 @@ public static void oneTime() { } @Test - @Ignore("https://github.com/natty-parser/natty/issues/1") public void testSpecific() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("5/19/2012 12:00 am"); + DateFormat.SHORT).parse("5/19/2012, 12:00 am"); calendarSource = new CalendarSource(reference); validateDateTime(reference, "1st oct in the year '89 1300 hours", 10, 1, 1989, 13, 0, 0); @@ -48,10 +46,9 @@ public void testSpecific() throws Exception { } @Test - @Ignore("https://github.com/natty-parser/natty/issues/1") public void testRelative() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("2/24/2011 12:00 am"); + DateFormat.SHORT).parse("2/24/2011, 12:00 am"); calendarSource = new CalendarSource(reference); validateDateTime(reference, "seven years ago at 3pm", 2, 24, 2004, 15, 0, 0); diff --git a/src/test/java/org/natty/RecurrenceTest.java b/src/test/java/org/natty/RecurrenceTest.java index fce7d800..1994ebaa 100644 --- a/src/test/java/org/natty/RecurrenceTest.java +++ b/src/test/java/org/natty/RecurrenceTest.java @@ -8,7 +8,6 @@ import junit.framework.Assert; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; /** @@ -24,10 +23,9 @@ public static void oneTime() { } @Test - @Ignore("https://github.com/natty-parser/natty/issues/1") public void testRelative() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("3/3/2011 12:00 am"); + DateFormat.SHORT).parse("3/3/2011, 12:00 am"); calendarSource = new CalendarSource(reference); DateGroup group = _parser.parse("every friday until two tuesdays from now", reference).get(0); diff --git a/src/test/java/org/natty/ThreadSafetyTest.java b/src/test/java/org/natty/ThreadSafetyTest.java index 1a49847e..5242d64c 100644 --- a/src/test/java/org/natty/ThreadSafetyTest.java +++ b/src/test/java/org/natty/ThreadSafetyTest.java @@ -8,7 +8,6 @@ import org.junit.Assert; -import org.junit.Ignore; import org.junit.Test; import org.junit.BeforeClass; @@ -29,7 +28,6 @@ public static void oneTime() { } @Test - @Ignore("https://github.com/natty-parser/natty/issues/1") public void testManyThreads() throws Exception { Thread[] threads = new Thread[NUM_OF_THREADS]; for (int i = 0; i < NUM_OF_THREADS; i++) { @@ -50,7 +48,7 @@ private class Tester implements Runnable { private int baseMinute; public Tester(int baseMinute) throws Exception { - String date = String.format("3/3/2011 1:%02d am", baseMinute); + String date = String.format("3/3/2011, 1:%02d am", baseMinute); this.referenceDate = dateFormat.parse(date); this.baseMinute = baseMinute; } diff --git a/src/test/java/org/natty/TimeZoneTest.java b/src/test/java/org/natty/TimeZoneTest.java index fb0d2e1f..84050913 100644 --- a/src/test/java/org/natty/TimeZoneTest.java +++ b/src/test/java/org/natty/TimeZoneTest.java @@ -1,7 +1,6 @@ package org.natty; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import java.text.DateFormat; @@ -19,10 +18,9 @@ public static void oneTime() { } @Test - @Ignore("https://github.com/natty-parser/natty/issues/1") public void testSpecific() throws Exception { Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("5/19/2012 12:00 am"); + DateFormat.SHORT).parse("5/19/2012, 12:00 am"); calendarSource = new CalendarSource(reference); validateDateTime(reference, "2011-06-17T07:00:00Z", 6, 17, 2011, 3, 0, 0); From a0096a7baf04e35252700c0c984b3b3406f871c8 Mon Sep 17 00:00:00 2001 From: Andi Pabst Date: Sun, 8 May 2022 23:10:28 +0200 Subject: [PATCH 14/43] Add CI workflow --- .github/workflows/maven.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/maven.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 00000000..43861a68 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,26 @@ +name: Java CI with Maven + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + name: Java ${{ matrix.java_version }} + runs-on: ubuntu-latest + strategy: + matrix: + java_version: ['8', '11', '17'] + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml From 7291e0e5c881cef4f9d4362593d7328f7b723fc5 Mon Sep 17 00:00:00 2001 From: Andi Date: Mon, 9 May 2022 08:36:17 +0200 Subject: [PATCH 15/43] roughly group issues from original repository --- issues.md | 196 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 issues.md diff --git a/issues.md b/issues.md new file mode 100644 index 00000000..bf72ca1e --- /dev/null +++ b/issues.md @@ -0,0 +1,196 @@ +# Issues from original repository +as of 2022-05-08 + +The issues are grouped into rough categories to make it possible to prioritise them a bit. + +## Crashes + +| ID | Title | +|---------------------------------------------------------|-------------------------------------------------------------------------------------------------------------| +| [#278](https://github.com/joestelmach/natty/issues/278) | 'last easter' gives NPE since 2021 | +| [#277](https://github.com/joestelmach/natty/issues/277) | Cant parse this oddly specific string. | +| [#263](https://github.com/joestelmach/natty/issues/263) | "Christma-eve" before 2000 throws NPE | +| [#246](https://github.com/joestelmach/natty/issues/246) | Could not parse input org.antlr.runtime.EarlyExitException: null | +| [#238](https://github.com/joestelmach/natty/issues/238) | natty line 1:23 no viable alternative at input '4' - Just override the emitErrorMessage method @joestelmach | +| [#236](https://github.com/joestelmach/natty/issues/236) | java.lang.NullPointerException | +| [#234](https://github.com/joestelmach/natty/issues/234) | NullPointerException | +| [#193](https://github.com/joestelmach/natty/issues/193) | NumberFormatException | +| [#190](https://github.com/joestelmach/natty/issues/190) | NullPointerExceptions | +| [#162](https://github.com/joestelmach/natty/issues/162) | NPE / NumberFormatExceptions in WalkerState on Seasons and year seaks with miscalculated target year | +| [#147](https://github.com/joestelmach/natty/issues/147) | NumberFormatException for "match-up on Saturday, February 22, 64-44, against Lynwood" | + +## Errors + Incorrect Parsing + +| ID | Title | +|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------| +| [#280](https://github.com/joestelmach/natty/issues/280) | Issues with multiple time points | +| [#279](https://github.com/joestelmach/natty/issues/279) | Incorrectly parsing years as of Jan 1st, 2021 | +| [#275](https://github.com/joestelmach/natty/issues/275) | Can't equate a month with 1 month | +| [#273](https://github.com/joestelmach/natty/issues/273) | Can't parse due to milliseconds | +| [#268](https://github.com/joestelmach/natty/issues/268) | Parser is failing because it doesn't detect date time | +| [#267](https://github.com/joestelmach/natty/issues/267) | In free form text year expression in end is ignored | +| [#266](https://github.com/joestelmach/natty/issues/266) | 19:40 Thursday (May 16, 2019) parsed wrongly | +| [#244](https://github.com/joestelmach/natty/issues/244) | Wrong Date calculated for Days of the week | +| [#243](https://github.com/joestelmach/natty/issues/243) | Can't parse month name on certain locations in text | +| [#227](https://github.com/joestelmach/natty/issues/227) | Date is not identified | +| [#211](https://github.com/joestelmach/natty/issues/211) | Please Correct "this month" result | +| [#210](https://github.com/joestelmach/natty/issues/210) | Dates subsequent to "Weekend" are ignored by parser. | +| [#207](https://github.com/joestelmach/natty/issues/207) | Year boundary condition on "before" | +| [#206](https://github.com/joestelmach/natty/issues/206) | slight date issue | +| [#203](https://github.com/joestelmach/natty/issues/203) | Past year interpretted | +| [#202](https://github.com/joestelmach/natty/issues/202) | Not able to parse if text contains numeric date incorrect subscript | +| [#201](https://github.com/joestelmach/natty/issues/201) | Midnight | +| [#194](https://github.com/joestelmach/natty/issues/194) | Invalid parse of two consecutive dates | +| [#192](https://github.com/joestelmach/natty/issues/192) | Natty parse string with no dates incorrectly | +| [#189](https://github.com/joestelmach/natty/issues/189) | Inconsistent year parsing | +| [#188](https://github.com/joestelmach/natty/issues/188) | Last week vs Last 1 week | +| [#184](https://github.com/joestelmach/natty/issues/184) | yesterday afternoon at 2 | +| [#180](https://github.com/joestelmach/natty/issues/180) | Doesn't seem to parse both times (as a range) | +| [#171](https://github.com/joestelmach/natty/issues/171) | "End of this week", "till this week", "ends this week" are not working | +| [#170](https://github.com/joestelmach/natty/issues/170) | Error with relative dates | +| [#169](https://github.com/joestelmach/natty/issues/169) | Basic parsing is broken | +| [#166](https://github.com/joestelmach/natty/issues/166) | "TEST123" gets parsed as HOURS_OF_DAY 3 | +| [#161](https://github.com/joestelmach/natty/issues/161) | Date is detected in Url | +| [#157](https://github.com/joestelmach/natty/issues/157) | doesnt parse | +| [#155](https://github.com/joestelmach/natty/issues/155) | first monday of next leap year | +| [#152](https://github.com/joestelmach/natty/issues/152) | Improper date format returned | +| [#148](https://github.com/joestelmach/natty/issues/148) | In date ranges, tonight should imply the date (today's date), not just the time (8pm) | +| [#146](https://github.com/joestelmach/natty/issues/146) | "In 2 weeks at 2pm" | +| [#143](https://github.com/joestelmach/natty/issues/143) | Won't parse just the year | +| [#142](https://github.com/joestelmach/natty/issues/142) | A minute ago | +| [#139](https://github.com/joestelmach/natty/issues/139) | the vs. this | +| [#137](https://github.com/joestelmach/natty/issues/137) | "First day of this year" returns current date | +| [#119](https://github.com/joestelmach/natty/issues/119) | "A380 tomorrow" parses as 0 as explicit hour | +| [#96](https://github.com/joestelmach/natty/issues/96) | "an hour ago" and "a minute ago" | +| [#79](https://github.com/joestelmach/natty/issues/79) | "every week" unrecognised | +| [#56](https://github.com/joestelmach/natty/issues/56) | Fails to parse when numbers that are greater than 99 AND divisible by 10 are used | +| [#55](https://github.com/joestelmach/natty/issues/55) | "Before" clause seems not working | +| [#54](https://github.com/joestelmach/natty/issues/54) | Natty parsing failed relative dates | +| [#50](https://github.com/joestelmach/natty/issues/50) | Parsing error | + +## Format issues +| ID | Title | +|---------------------------------------------------------|--------------------------------------------------------------------------------| +| [#271](https://github.com/joestelmach/natty/issues/271) | 9999-12-31 fails to parse | +| [#265](https://github.com/joestelmach/natty/issues/265) | Date parsed wrongly | +| [#260](https://github.com/joestelmach/natty/issues/260) | 04Oct17-31Oct17 | +| [#257](https://github.com/joestelmach/natty/issues/257) | 02sep85 | +| [#254](https://github.com/joestelmach/natty/issues/254) | Problem parsing Oct-07-2018 10:00 | +| [#242](https://github.com/joestelmach/natty/issues/242) | Can't parse ddMMyyyy formate | +| [#241](https://github.com/joestelmach/natty/issues/241) | Question/Issue, dates with no delimiters like 5Jan2018 are parsed in-correctly | +| [#240](https://github.com/joestelmach/natty/issues/240) | Unable to parse "End of the Week" | +| [#237](https://github.com/joestelmach/natty/issues/237) | Wrong parsing in case of % | +| [#229](https://github.com/joestelmach/natty/issues/229) | Not able to parse boundary references | +| [#228](https://github.com/joestelmach/natty/issues/228) | Not able to parse 4MAR17 | +| [#215](https://github.com/joestelmach/natty/issues/215) | The first of the month | +| [#214](https://github.com/joestelmach/natty/issues/214) | Unable to detect date in news article | +| [#212](https://github.com/joestelmach/natty/issues/212) | Can't detect year when spelled out | +| [#208](https://github.com/joestelmach/natty/issues/208) | Placing the year after time causes parsing to change the year | +| [#204](https://github.com/joestelmach/natty/issues/204) | Natty is unable to parse this date | +| [#179](https://github.com/joestelmach/natty/issues/179) | Only date is not being parsed | +| [#167](https://github.com/joestelmach/natty/issues/167) | "2016.06.13 18:42:04" is parsed as "Fri Mar 25 20:16:06 UTC 2016" | +| [#160](https://github.com/joestelmach/natty/issues/160) | @ between date and time | +| [#158](https://github.com/joestelmach/natty/issues/158) | can't parse simple Datetype | +| [#151](https://github.com/joestelmach/natty/issues/151) | no viable alternative at input '' | +| [#144](https://github.com/joestelmach/natty/issues/144) | 15/12/2004 is not parsed correctly. | +| [#118](https://github.com/joestelmach/natty/issues/118) | 29.01.57 is parsed incorrectly | +| [#104](https://github.com/joestelmach/natty/issues/104) | date parsing | +| [#75](https://github.com/joestelmach/natty/issues/75) | 20121028_161105.jpg | + +## Feature requests + +| ID | Title | +|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------| +| [#276](https://github.com/joestelmach/natty/issues/276) | Parsing of quarter not supported | +| [#270](https://github.com/joestelmach/natty/issues/270) | support canonical timezone id (not just abbreviations) | +| [#269](https://github.com/joestelmach/natty/issues/269) | Support for countries which use DD MM YYYY | +| [#259](https://github.com/joestelmach/natty/issues/259) | Can't parse time fields like "60s" | +| [#258](https://github.com/joestelmach/natty/issues/258) | Upgrade to Antlr4 | +| [#256](https://github.com/joestelmach/natty/issues/256) | Year is added to current year 2018 jan 15 gives year 4036-01-01 3pm utc [other format] | +| [#255](https://github.com/joestelmach/natty/issues/255) | Year references would be nice to match | +| [#264](https://github.com/joestelmach/natty/issues/264) | "23rd" not getting parsed. Expected result is current_MM/23/current_YYYY | +| [#249](https://github.com/joestelmach/natty/issues/249) | Is it possible to make natty multilingual? | +| [#248](https://github.com/joestelmach/natty/issues/248) | Feature request | +| [#245](https://github.com/joestelmach/natty/issues/245) | Feature Request: Set date format locale on call | +| [#239](https://github.com/joestelmach/natty/issues/239) | A fortnight happens to be absent from Natty's vocabulary | +| [#235](https://github.com/joestelmach/natty/issues/235) | java.lang.IllegalArgumentException: No enum constant com.joestelmach.natty.Holiday.INAUGURATION_DAY | +| [#233](https://github.com/joestelmach/natty/issues/233) | Parsing week numbers | +| [#231](https://github.com/joestelmach/natty/issues/231) | Couple days from now / next leap year | +| [#226](https://github.com/joestelmach/natty/issues/226) | RFC 2822 Support | +| [#223](https://github.com/joestelmach/natty/issues/223) | Add support for several languages | +| [#222](https://github.com/joestelmach/natty/issues/222) | time period recognition | +| [#221](https://github.com/joestelmach/natty/issues/221) | Add time grain for date parsed | +| [#220](https://github.com/joestelmach/natty/issues/220) | Add support for "1h2m" format? | +| [#216](https://github.com/joestelmach/natty/issues/216) | First Quarter / Q1-Q3 | +| [#205](https://github.com/joestelmach/natty/issues/205) | Unable to distinguish time range | +| [#200](https://github.com/joestelmach/natty/issues/200) | some day in the feature | +| [#198](https://github.com/joestelmach/natty/issues/198) | 21st Oct last year is not supported | +| [#197](https://github.com/joestelmach/natty/issues/197) | Not accepting the week after | +| [#191](https://github.com/joestelmach/natty/issues/191) | "Mid August" parses to Aug. 01 | +| [#187](https://github.com/joestelmach/natty/issues/187) | Unable to determine the following date type | +| [#186](https://github.com/joestelmach/natty/issues/186) | Enhancement: Locale/Internationalization support? | +| [#185](https://github.com/joestelmach/natty/issues/185) | Can't parse date from this :NT INT INST 2005 06 08 Let ECGD du 29 mars.pdf | +| [#183](https://github.com/joestelmach/natty/issues/183) | quarter is not parsed | +| [#182](https://github.com/joestelmach/natty/issues/182) | 25th of every month is not parsed | +| [#181](https://github.com/joestelmach/natty/issues/181) | Can't parse short format: 3h ago | +| [#177](https://github.com/joestelmach/natty/issues/177) | Doesn't recognize "Last quarter" | +| [#172](https://github.com/joestelmach/natty/issues/172) | Does not recognize 'previous' keyword | +| [#168](https://github.com/joestelmach/natty/issues/168) | Natty ignores milliseconds | +| [#159](https://github.com/joestelmach/natty/issues/159) | parsing text with numbers | +| [#153](https://github.com/joestelmach/natty/issues/153) | Date ranges? | +| [#150](https://github.com/joestelmach/natty/issues/150) | "the beginning of (next) year" | +| [#140](https://github.com/joestelmach/natty/issues/140) | recognize before month | +| [#138](https://github.com/joestelmach/natty/issues/138) | Quarters | +| [#134](https://github.com/joestelmach/natty/issues/134) | Incorrect parsing for dd-mm-yyyy and similar | +| [#132](https://github.com/joestelmach/natty/issues/132) | Handle "Next Business Day" and "As Soon As Possible" | +| [#129](https://github.com/joestelmach/natty/issues/129) | How to refer to beginning of (computer) time? | +| [#123](https://github.com/joestelmach/natty/issues/123) | Parsing strings with only year information | +| [#122](https://github.com/joestelmach/natty/issues/122) | How to translate natty recognition in other languages | +| [#121](https://github.com/joestelmach/natty/issues/121) | prefixes "3 days from " doesn't seem to work | +| [#120](https://github.com/joestelmach/natty/issues/120) | Date range doesn't take into account day of week | +| [#114](https://github.com/joestelmach/natty/issues/114) | Relative dates with respect to another date rather than now | +| [#110](https://github.com/joestelmach/natty/issues/110) | "JUNE 9TH - JUNE 23RD, 2014" is parsed as 06/09/201*5* - 06/23/2014 | +| [#106](https://github.com/joestelmach/natty/issues/106) | how to parse twelve to ten? | +| [#105](https://github.com/joestelmach/natty/issues/105) | java time zoneddatetime to string should be supported | +| [#93](https://github.com/joestelmach/natty/issues/93) | need week end and work day aliases as we have for holidays | +| [#80](https://github.com/joestelmach/natty/issues/80) | Four score and ten years ago | +| [#77](https://github.com/joestelmach/natty/issues/77) | Recalculate a time- inferred date | +| [#69](https://github.com/joestelmach/natty/issues/69) | Year bias... | +| [#64](https://github.com/joestelmach/natty/issues/64) | How to parse dates of format DD/MM/YYYY? | +| [#57](https://github.com/joestelmach/natty/issues/57) | Fails to parse day of month (eg: "the 21st") | +| [#53](https://github.com/joestelmach/natty/issues/53) | Include possible date/time range ? | +| [#48](https://github.com/joestelmach/natty/issues/48) | I18n support - different languages/countries | +| [#47](https://github.com/joestelmach/natty/issues/47) | Make CalendarSource.setBaseDate an instance method | +| [#44](https://github.com/joestelmach/natty/issues/44) | friendlier time rules | +| [#41](https://github.com/joestelmach/natty/issues/41) | Feature: Future dates only option | +| [#26](https://github.com/joestelmach/natty/issues/26) | Not Parsing "March 9-13, 2012" properly | +| [#25](https://github.com/joestelmach/natty/issues/25) | can not parse "2011-09-12T13:55:00.004+02:00" | +| [#23](https://github.com/joestelmach/natty/issues/23) | "each sunday in march" did not parse | +| [#21](https://github.com/joestelmach/natty/issues/21) | French Dates Like 07-10-2011 | +| [#20](https://github.com/joestelmach/natty/issues/20) | German Dates Like 07.10.2011 | +| [#17](https://github.com/joestelmach/natty/issues/17) | Feature requests: More date ranges, custom event support | +| [#16](https://github.com/joestelmach/natty/issues/16) | Cannot parse Sat., Sept. 24, 10:30 a.m.-9 p.m. format | +| [#6](https://github.com/joestelmach/natty/issues/6) | Add time precision option | +| [#3](https://github.com/joestelmach/natty/issues/3) | UK-formatted dates won't parse | + +## Misc + +| ID | Title | +|---------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------| +| [#281](https://github.com/joestelmach/natty/issues/281) | Documentation - 500 internal server error - http://natty.joestelmach.com/ | +| [#274](https://github.com/joestelmach/natty/issues/274) | abandonware and forks diverge wildly | +| [#253](https://github.com/joestelmach/natty/issues/253) | Runtime VerifyError: Verifier rejected class with Android <= 21 | +| [#251](https://github.com/joestelmach/natty/issues/251) | Strange Memory Issue (leak) | +| [#230](https://github.com/joestelmach/natty/issues/230) | Can't import project into android studio | +| [#219](https://github.com/joestelmach/natty/issues/219) | How can I add a needed format? | +| [#218](https://github.com/joestelmach/natty/issues/218) | Inferences could be more specific | +| [#217](https://github.com/joestelmach/natty/issues/217) | Upgrade to ical4j 2.0 | +| [#199](https://github.com/joestelmach/natty/issues/199) | how to get rid of: [main] INFO com.joestelmach.natty.Parser - STREAM | +| [#195](https://github.com/joestelmach/natty/issues/195) | Getting date format from parser | +| [#165](https://github.com/joestelmach/natty/issues/165) | Parser logs are too verbose at INFO | +| [#156](https://github.com/joestelmach/natty/issues/156) | How do I mute console output? | +| [#149](https://github.com/joestelmach/natty/issues/149) | Daylight savings logic? | +| [#135](https://github.com/joestelmach/natty/issues/135) | SLF4J for class DateParser_NumericRules | +| [#95](https://github.com/joestelmach/natty/issues/95) | Usage questions related to multiple groups/dates returned by parser | +| [#84](https://github.com/joestelmach/natty/issues/84) | Javascript version? | +| [#52](https://github.com/joestelmach/natty/issues/52) | Can i change in the java source code and create it's new jar without using maven and if no how can i do that using maven ? | \ No newline at end of file From b582edcdc1f208358348e75054c08577db2fc3d2 Mon Sep 17 00:00:00 2001 From: Andi Date: Sun, 15 May 2022 22:37:16 +0200 Subject: [PATCH 16/43] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 08d63c97..2733d67b 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Plan / Priorities (as of March 2022): 1. ~~Release version `1.0.0` with (possibly) the same code as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc.~~ DONE -2. Fix the tests (some are failing?). +2. ~~Fix the tests (some are failing?).~~ DONE 3. Set up basic technicalities of the fork - Maven release process, CI (Continuous Integration), etc. 4. Start accepting contributions (PRs), encourage the community to solve [issues reported in the original repo](https://github.com/joestelmach/natty/issues) 5. Consider switching to Gradle (as this is a build tool which is modern and I am familiar with) From 38f8947fdf49ca45c8bf8e344f3ed2d9299821ef Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sat, 5 Nov 2022 18:55:18 +0100 Subject: [PATCH 17/43] Mentioning issues.md --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 08d63c97..32de902c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Originally written by Joel Stelmach at https://github.com/joestelmach/natty and Started with [a thread in the original project](https://github.com/joestelmach/natty/issues/274). The aim is to try providing maintenance for the library. -Plan / Priorities (as of March 2022): +Plan / Priorities (as of November 2022): 1. ~~Release version `1.0.0` with (possibly) the same code as the fork root, but under new name, consider renaming packages and artifacts to use `natty-parser` as the moniker, etc.~~ DONE @@ -24,6 +24,10 @@ DONE 6. Decide on the overall vision of the project - at this point it's hard to tell, but I think a conscious decision on what is gonna be supported would be great - i.e. focus on i18n, customization, stability, or what? +## Known issues from the parent project + +See [issues](issues.md) + ## Commitment I hope for open collaboration and contributions from others. To me it's totally a side-project, not the core activity. Yet, I can commit to being (fairly) responsive and inclusive. @@ -31,6 +35,6 @@ I hope for open collaboration and contributions from others. To me it's totally ## Contibutions Are more then welcome. Feel free to reach out (e.g. by creating an issue in this repo) to offer your support and ideas. I am happy to include more -maintainers. +maintainers. Tag @mccartney if no response for 2-3 days (I might have missed that). I see this project potentially being welcoming to many, incl. quite junior and inexperienced developers, who would like to learn and contribute. From 5c9af6235ba822e1e8a043404c6fd7d3f5878c3b Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sat, 5 Nov 2022 23:07:11 +0100 Subject: [PATCH 18/43] adding Dependabot --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..ee4fc95f --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + - package-ecosystem: maven + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 + labels: + - "dependencies" From 16a537bcfe4385f28af6c622834c3dea5a3dde36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:29 +0000 Subject: [PATCH 19/43] Bump junit from 4.1 to 4.13.2 Bumps [junit](https://github.com/junit-team/junit4) from 4.1 to 4.13.2. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/ReleaseNotes4.10.md) - [Commits](https://github.com/junit-team/junit4/commits/r4.13.2) --- updated-dependencies: - dependency-name: junit:junit dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..c3438cba 100644 --- a/pom.xml +++ b/pom.xml @@ -261,7 +261,7 @@ junit junit - 4.1 + 4.13.2 test From 9a9becf0216676252cfa2f597b18a470935b38d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:32 +0000 Subject: [PATCH 20/43] Bump antlr3-maven-plugin from 3.5.2 to 3.5.3 Bumps [antlr3-maven-plugin](https://github.com/antlr/antlr3) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/antlr/antlr3/releases) - [Commits](https://github.com/antlr/antlr3/compare/3.5.2...3.5.3) --- updated-dependencies: - dependency-name: org.antlr:antlr3-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..6a37bb72 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ org.antlr antlr3-maven-plugin - 3.5.2 + 3.5.3 From 3f1b04efb041868224f50063c755599c1cab6e62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:34 +0000 Subject: [PATCH 21/43] Bump maven-gunit-plugin from 3.5.2 to 3.5.3 Bumps maven-gunit-plugin from 3.5.2 to 3.5.3. --- updated-dependencies: - dependency-name: org.antlr:maven-gunit-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..dc8d787f 100644 --- a/pom.xml +++ b/pom.xml @@ -157,7 +157,7 @@ org.antlr maven-gunit-plugin - 3.5.2 + 3.5.3 maven-gunit-plugin From 947af02df554e94f510b9caf942b75f3b27ca518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:36 +0000 Subject: [PATCH 22/43] Bump maven-compiler-plugin from 2.3.2 to 3.10.1 Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 2.3.2 to 3.10.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-2.3.2...maven-compiler-plugin-3.10.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..4cb49abd 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ maven-compiler-plugin - 2.3.2 + 3.10.1 1.6 1.6 From 79fd50fb7516f2a4371e5d5c1588f1cfd8711ac3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:39 +0000 Subject: [PATCH 23/43] Bump maven-javadoc-plugin from 2.9.1 to 3.4.1 Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 2.9.1 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-2.9.1...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..2669ade4 100644 --- a/pom.xml +++ b/pom.xml @@ -216,7 +216,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 2.9.1 + 3.4.1 attach-javadocs From eabc2a386bffc767c2bdc547c830c3dc195d6b72 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:40 +0000 Subject: [PATCH 24/43] Bump nexus-staging-maven-plugin from 1.6.7 to 1.6.13 Bumps nexus-staging-maven-plugin from 1.6.7 to 1.6.13. --- updated-dependencies: - dependency-name: org.sonatype.plugins:nexus-staging-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..d6da4641 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ org.sonatype.plugins nexus-staging-maven-plugin - 1.6.7 + 1.6.13 true ossrh From fc038ddac7334dafd520f603e8b90bf93f0e9aa6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:07:44 +0000 Subject: [PATCH 25/43] Bump gunit from 3.5.2 to 3.5.3 Bumps [gunit](https://github.com/antlr/antlr3) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/antlr/antlr3/releases) - [Commits](https://github.com/antlr/antlr3/compare/3.5.2...3.5.3) --- updated-dependencies: - dependency-name: org.antlr:gunit dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..d3bff858 100644 --- a/pom.xml +++ b/pom.xml @@ -268,7 +268,7 @@ org.antlr gunit - 3.5.2 + 3.5.3 test From 42839be4e3b42730520c58171f77ac14d867f8aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:08:45 +0000 Subject: [PATCH 26/43] Bump maven-release-plugin from 2.0 to 2.5.3 Bumps maven-release-plugin from 2.0 to 2.5.3. --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..82a6694b 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ org.apache.maven.plugins maven-release-plugin - 2.0 + 2.5.3 forked-path From deb0cfb9ad5b6c6f2b5693acc1f7942d8cdb50f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:08:48 +0000 Subject: [PATCH 27/43] Bump antlr-runtime from 3.5.2 to 3.5.3 Bumps [antlr-runtime](https://github.com/antlr/antlr3) from 3.5.2 to 3.5.3. - [Release notes](https://github.com/antlr/antlr3/releases) - [Commits](https://github.com/antlr/antlr3/compare/3.5.2...3.5.3) --- updated-dependencies: - dependency-name: org.antlr:antlr-runtime dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..e51e8ecd 100644 --- a/pom.xml +++ b/pom.xml @@ -236,7 +236,7 @@ org.antlr antlr-runtime - 3.5.2 + 3.5.3 From 79783972c351e57b46852cb03bde92cc89fdebc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:08:51 +0000 Subject: [PATCH 28/43] Bump slf4j-log4j12 from 1.7.10 to 1.7.33 Bumps [slf4j-log4j12](https://github.com/qos-ch/slf4j) from 1.7.10 to 1.7.33. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.10...v_1.7.33) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-log4j12 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..4b25aeca 100644 --- a/pom.xml +++ b/pom.xml @@ -254,7 +254,7 @@ org.slf4j slf4j-log4j12 - 1.7.10 + 1.7.33 test From f228b084f0379590a3ff9503988fa9d71e2536c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 5 Nov 2022 22:09:39 +0000 Subject: [PATCH 29/43] Bump maven-gpg-plugin from 1.6 to 3.0.1 Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 1.6 to 3.0.1. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-1.6...maven-gpg-plugin-3.0.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 764c729a..2c926dba 100644 --- a/pom.xml +++ b/pom.xml @@ -188,7 +188,7 @@ org.apache.maven.plugins maven-gpg-plugin - 1.6 + 3.0.1 sign-artifacts From 433e716bb068fbc65d4c4c152402e640d12ff9d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 15:11:15 +0000 Subject: [PATCH 30/43] Bump ical4j from 1.0.2 to 3.2.7 Bumps [ical4j](https://github.com/ical4j/ical4j) from 1.0.2 to 3.2.7. - [Release notes](https://github.com/ical4j/ical4j/releases) - [Changelog](https://github.com/ical4j/ical4j/blob/develop/CHANGELOG.md) - [Commits](https://github.com/ical4j/ical4j/compare/ical4j-1.0.2...ical4j-3.2.7) --- updated-dependencies: - dependency-name: org.mnode.ical4j:ical4j dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 496c4000..20f1d871 100644 --- a/pom.xml +++ b/pom.xml @@ -242,7 +242,7 @@ org.mnode.ical4j ical4j - 1.0.2 + 3.2.7 From 2527d7771241ff99bc34ea7b7ffdeb2d2a39719e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 15:11:17 +0000 Subject: [PATCH 31/43] Bump maven-clean-plugin from 2.4.1 to 3.2.0 Bumps [maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 2.4.1 to 3.2.0. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-2.4.1...maven-clean-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 496c4000..26647d95 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ maven-clean-plugin - 2.4.1 + 3.2.0 From dd670fa34a826363b6cd0472a105cd03bfb28bdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 15:11:20 +0000 Subject: [PATCH 32/43] Bump slf4j-api from 1.7.10 to 2.0.3 Bumps [slf4j-api](https://github.com/qos-ch/slf4j) from 1.7.10 to 2.0.3. - [Release notes](https://github.com/qos-ch/slf4j/releases) - [Commits](https://github.com/qos-ch/slf4j/compare/v_1.7.10...v_2.0.3) --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 496c4000..87865dca 100644 --- a/pom.xml +++ b/pom.xml @@ -248,7 +248,7 @@ org.slf4j slf4j-api - 1.7.10 + 2.0.3 From 8d881e75dd445857132864b9301383d9b9bf36f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 6 Nov 2022 15:11:24 +0000 Subject: [PATCH 33/43] Bump maven-source-plugin from 2.2.1 to 3.2.1 Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 2.2.1 to 3.2.1. - [Release notes](https://github.com/apache/maven-source-plugin/releases) - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-2.2.1...maven-source-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 496c4000..7ead2437 100644 --- a/pom.xml +++ b/pom.xml @@ -203,7 +203,7 @@ org.apache.maven.plugins maven-source-plugin - 2.2.1 + 3.2.1 attach-sources From 7659b3fb7f24672bf020cc4e54547b288d0af1ba Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sun, 6 Nov 2022 19:43:52 +0100 Subject: [PATCH 34/43] maven usage added --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 4fac7216..f910e94f 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,18 @@ syntax information. Originally written by Joel Stelmach at https://github.com/joestelmach/natty and developed between 2010 and 2017. Abandoned since then. +## Usage +Maven: +``` + + io.github.natty-parser + natty + 1.0.0 + +``` + +or [consult maven.org](https://search.maven.org/artifact/io.github.natty-parser/natty) for other build systems. + ## Idea behind the fork Started with [a thread in the original project](https://github.com/joestelmach/natty/issues/274). The aim is to try providing maintenance for the library. From 1c041f5cb8338ff24fdd27bc1b486ec822515d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Grzegorz=20Ol=C4=99dzki?= Date: Sun, 6 Nov 2022 20:48:08 +0100 Subject: [PATCH 35/43] Release 1.0.1 --- pom.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3bef031d..213cbeec 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ io.github.natty-parser natty jar - 1.0.0 + 1.0.1 Natty Date Parser natural language date parser https://github.com/natty-parser/natty @@ -217,6 +217,9 @@ org.apache.maven.plugins maven-javadoc-plugin 3.4.1 + + none + attach-javadocs From 62d107e133d9a684b65055b55c069d39ca6e84c1 Mon Sep 17 00:00:00 2001 From: Greg Oledzki Date: Sun, 6 Nov 2022 21:25:39 +0100 Subject: [PATCH 36/43] Release 1.0.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f910e94f..0dc917bc 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Maven: io.github.natty-parser natty - 1.0.0 + 1.0.1 ``` From 89de0c5f46d71c5e84220c10219b1dbd85535519 Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Mon, 7 Nov 2022 10:11:07 +0100 Subject: [PATCH 37/43] #26 Fix javadoc building --- pom.xml | 8 +++-- src/main/java/org/natty/DateGroup.java | 4 +-- src/main/java/org/natty/Parser.java | 15 +++++----- src/main/java/org/natty/WalkerState.java | 37 ++++++++++-------------- 4 files changed, 30 insertions(+), 34 deletions(-) diff --git a/pom.xml b/pom.xml index 213cbeec..3eb4ec92 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,8 @@ UTF-8 UTF-8 -Xdoclint:none + 1.8 + 1.8 @@ -217,9 +219,9 @@ org.apache.maven.plugins maven-javadoc-plugin 3.4.1 - - none - + + + attach-javadocs diff --git a/src/main/java/org/natty/DateGroup.java b/src/main/java/org/natty/DateGroup.java index 243a7495..87c8f90f 100644 --- a/src/main/java/org/natty/DateGroup.java +++ b/src/main/java/org/natty/DateGroup.java @@ -31,7 +31,7 @@ public DateGroup() { /** * Adds a date to this group - * @param date + * @param date the date */ public void addDate(Date date) { _dates.add(date); @@ -77,7 +77,7 @@ public String getFullText() { /** * The line within the fullText this date group is found on - * @return + * @return line number */ public int getLine() { return _line; diff --git a/src/main/java/org/natty/Parser.java b/src/main/java/org/natty/Parser.java index 608c0f6c..a43127e2 100644 --- a/src/main/java/org/natty/Parser.java +++ b/src/main/java/org/natty/Parser.java @@ -43,7 +43,7 @@ public class Parser { /** * Creates a new parser using the given time zone as the default - * @param defaultTimeZone + * @param defaultTimeZone the timezone */ public Parser(TimeZone defaultTimeZone) { _defaultTimeZone = defaultTimeZone; @@ -57,11 +57,10 @@ public Parser() { } /** - * Parses the given input value for one or more groups of - * date alternatives + * Parses the given input value for one or more groups of date alternatives * - * @param value - * @return + * @param value the date tor parse + * @return list of date alternatives */ public List parse(String value) { return parse(value, new Date()); @@ -72,9 +71,9 @@ public List parse(String value) { * date alternatives with relative dates resolved according * to referenceDate * - * @param value - * @param referenceDate - * @return + * @param value the date string to parse + * @param referenceDate the reference date for relative dates + * @return list of date alternatives */ public List parse(String value, Date referenceDate) { diff --git a/src/main/java/org/natty/WalkerState.java b/src/main/java/org/natty/WalkerState.java index 36834f96..f69a6736 100644 --- a/src/main/java/org/natty/WalkerState.java +++ b/src/main/java/org/natty/WalkerState.java @@ -63,8 +63,8 @@ public void setDefaultTimeZone(final TimeZone zone) { * seeks to a specified day of the week in the past or future. * * @param direction the direction to seek: two possibilities - * '<' go backward - * '>' go forward + * '<' go backward + * '>' go forward * * @param seekType the type of seek to perform (by_day or by_week) * by_day means we seek to the very next occurrence of the given day @@ -142,8 +142,8 @@ public void seekToDayOfYear(String dayOfYear) { } /** - * - * @param year + * Seek to the given year + * @param year the year to seek to. */ public void seekToYear(String year) { int yearInt = Integer.parseInt(year); @@ -158,8 +158,8 @@ public void seekToYear(String year) { * seeks to a particular month * * @param direction the direction to seek: two possibilities - * '<' go backward - * '>' go forward + * '<' go backward + * '>' go forward * * @param seekAmount the amount to seek. Must be guaranteed to parse as an integer * @@ -197,12 +197,12 @@ public void seekToMonth(String direction, String seekAmount, String month) { * seeks by a span of time (weeks, months, etc) * * @param direction the direction to seek: two possibilities - * '<' go backward - * '>' go forward + * '<' go backward + * '>' go forward * * @param seekAmount the amount to seek. Must be guaranteed to parse as an integer * - * @param span + * @param span the span to seek by, one of DAY, WEEK, MONTH, YEAR, HOUR, MINUTE, SECOND */ public void seekBySpan(String direction, String seekAmount, String span) { if(span.startsWith(SEEK_PREFIX)) span = span.substring(3); @@ -234,12 +234,7 @@ public void seekBySpan(String direction, String seekAmount, String span) { null; if(field > 0) _calendar.add(field, seekAmountInt * sign); } - - /** - * - * @param index - * @param dayOfWeek - */ + public void setDayOfWeekIndex(String index, String dayOfWeek) { int indexInt = Integer.parseInt(index); assert(indexInt > 0 && indexInt < 6); @@ -314,7 +309,7 @@ else if(dayOfWeek != null) { } /** - * Sets the the time of day + * Sets the time of day * * @param hours the hours to set. Must be guaranteed to parse as an * integer between 0 and 23 @@ -395,9 +390,9 @@ public void seekToHoliday(String holidayString, String direction, String seekAmo /** * Seeks to the given holiday within the given year - * - * @param holidayString - * @param yearString + * @see Holiday + * @param holidayString the name of the holiday as per Holiday enum + * @param yearString the year */ public void seekToHolidayYear(String holidayString, String yearString) { Holiday holiday = Holiday.valueOf(holidayString); @@ -423,8 +418,8 @@ public void seekToSeason(String seasonString, String direction, String seekAmoun /** * Seeks to the given season within the given year * - * @param seasonString - * @param yearString + * @param seasonString The season to seek to + * @param yearString The year */ public void seekToSeasonYear(String seasonString, String yearString) { Season season = Season.valueOf(seasonString); From 9610b4f68367c69f81c9f83db9a4ce1075d83fb5 Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Mon, 7 Nov 2022 10:58:00 +0100 Subject: [PATCH 38/43] #1 Fix unit tests on JDK 8 - directly create date instead of relying on parsing --- pom.xml | 6 ++++++ src/test/java/org/natty/DateTimeTest.java | 14 ++++++++------ src/test/java/org/natty/RecurrenceTest.java | 7 +++++-- src/test/java/org/natty/ThreadSafetyTest.java | 8 +++++--- src/test/java/org/natty/TimeZoneTest.java | 6 ++++-- src/test/resources/logback-test.xml | 17 +++++++++++++++++ 6 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 src/test/resources/logback-test.xml diff --git a/pom.xml b/pom.xml index 213cbeec..cd49a626 100644 --- a/pom.xml +++ b/pom.xml @@ -260,6 +260,12 @@ 1.7.33 test + + + ch.qos.logback + logback-classic + 1.4.4 + junit diff --git a/src/test/java/org/natty/DateTimeTest.java b/src/test/java/org/natty/DateTimeTest.java index 678f48f1..a775fa3a 100644 --- a/src/test/java/org/natty/DateTimeTest.java +++ b/src/test/java/org/natty/DateTimeTest.java @@ -4,7 +4,9 @@ import org.junit.BeforeClass; import org.junit.Test; +import java.sql.Timestamp; import java.text.DateFormat; +import java.time.LocalDateTime; import java.util.Date; import java.util.List; import java.util.Locale; @@ -24,9 +26,9 @@ public static void oneTime() { } @Test - public void testSpecific() throws Exception { - Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("5/19/2012, 12:00 am"); + public void testSpecific() { + final LocalDateTime refDateTime = LocalDateTime.of(2012, 5, 19, 12, 00, 00); + Date reference = Timestamp.valueOf(refDateTime); calendarSource = new CalendarSource(reference); validateDateTime(reference, "1st oct in the year '89 1300 hours", 10, 1, 1989, 13, 0, 0); @@ -46,9 +48,9 @@ public void testSpecific() throws Exception { } @Test - public void testRelative() throws Exception { - Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("2/24/2011, 12:00 am"); + public void testRelative() { + final LocalDateTime refDateTime = LocalDateTime.of(2011, 2, 24, 0, 0, 0); + Date reference = Timestamp.valueOf(refDateTime); calendarSource = new CalendarSource(reference); validateDateTime(reference, "seven years ago at 3pm", 2, 24, 2004, 15, 0, 0); diff --git a/src/test/java/org/natty/RecurrenceTest.java b/src/test/java/org/natty/RecurrenceTest.java index 1994ebaa..87783026 100644 --- a/src/test/java/org/natty/RecurrenceTest.java +++ b/src/test/java/org/natty/RecurrenceTest.java @@ -1,6 +1,8 @@ package org.natty; +import java.sql.Timestamp; import java.text.DateFormat; +import java.time.LocalDateTime; import java.util.Date; import java.util.Locale; import java.util.TimeZone; @@ -24,8 +26,9 @@ public static void oneTime() { @Test public void testRelative() throws Exception { - Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("3/3/2011, 12:00 am"); + + final LocalDateTime refDateTime = LocalDateTime.of(2011, 3, 3, 12, 00, 00); + Date reference = Timestamp.valueOf(refDateTime); calendarSource = new CalendarSource(reference); DateGroup group = _parser.parse("every friday until two tuesdays from now", reference).get(0); diff --git a/src/test/java/org/natty/ThreadSafetyTest.java b/src/test/java/org/natty/ThreadSafetyTest.java index 5242d64c..4179e897 100644 --- a/src/test/java/org/natty/ThreadSafetyTest.java +++ b/src/test/java/org/natty/ThreadSafetyTest.java @@ -1,6 +1,8 @@ package org.natty; +import java.sql.Timestamp; import java.text.DateFormat; +import java.time.LocalDateTime; import java.util.Date; import java.util.Locale; import java.util.concurrent.atomic.AtomicInteger; @@ -48,14 +50,14 @@ private class Tester implements Runnable { private int baseMinute; public Tester(int baseMinute) throws Exception { - String date = String.format("3/3/2011, 1:%02d am", baseMinute); - this.referenceDate = dateFormat.parse(date); + final LocalDateTime refDateTime = LocalDateTime.of(2011, 3, 3, 1, baseMinute, 0); + this.referenceDate = Timestamp.valueOf(refDateTime); this.baseMinute = baseMinute; } public void run() { try { - // Immitate some long running task. + // Imitate some long running task. Thread.sleep(100); } catch (Exception e) { } String newDate = "4/4/2012"; diff --git a/src/test/java/org/natty/TimeZoneTest.java b/src/test/java/org/natty/TimeZoneTest.java index 84050913..33881f03 100644 --- a/src/test/java/org/natty/TimeZoneTest.java +++ b/src/test/java/org/natty/TimeZoneTest.java @@ -3,7 +3,9 @@ import org.junit.BeforeClass; import org.junit.Test; +import java.sql.Timestamp; import java.text.DateFormat; +import java.time.LocalDateTime; import java.util.Date; import java.util.Locale; import java.util.TimeZone; @@ -19,8 +21,8 @@ public static void oneTime() { @Test public void testSpecific() throws Exception { - Date reference = DateFormat.getDateTimeInstance(DateFormat.SHORT, - DateFormat.SHORT).parse("5/19/2012, 12:00 am"); + final LocalDateTime refDateTime = LocalDateTime.of(2012, 5, 19, 12, 00, 00); + Date reference = Timestamp.valueOf(refDateTime); calendarSource = new CalendarSource(reference); validateDateTime(reference, "2011-06-17T07:00:00Z", 6, 17, 2011, 3, 0, 0); diff --git a/src/test/resources/logback-test.xml b/src/test/resources/logback-test.xml new file mode 100644 index 00000000..6779d7da --- /dev/null +++ b/src/test/resources/logback-test.xml @@ -0,0 +1,17 @@ + + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + \ No newline at end of file From f04f06c6e9075bb4e2ce0f9c268dd0a40ca09b95 Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Mon, 7 Nov 2022 11:05:17 +0100 Subject: [PATCH 39/43] #26 use matrix java version in build --- .github/workflows/maven.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 43861a68..82fe857e 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -15,12 +15,12 @@ jobs: java_version: ['8', '11', '17'] steps: - - uses: actions/checkout@v3 - - name: Set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: '11' - distribution: 'temurin' - cache: maven - - name: Build with Maven - run: mvn -B package --file pom.xml + - uses: actions/checkout@v3 + - name: Set up JDK ${{ matrix.java_version }} + uses: actions/setup-java@v3 + with: + java-version: ${{ matrix.java_version }} + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: mvn -B package --file pom.xml From d01038b085e67562140b9140cebe4a211243a9ec Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Mon, 7 Nov 2022 11:11:23 +0100 Subject: [PATCH 40/43] #26 remove explicit setting of java version in compiler plugin - it is taken from project properties --- pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pom.xml b/pom.xml index 3eb4ec92..ff7ab05f 100644 --- a/pom.xml +++ b/pom.xml @@ -86,10 +86,6 @@ maven-compiler-plugin 3.10.1 - - 1.6 - 1.6 - From 660e7d10d69ea6f25cc16456d673b186b55c0b32 Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Mon, 7 Nov 2022 11:19:11 +0100 Subject: [PATCH 41/43] #26 github build - do not cancel other JDK builds if it fails on one JDK --- .github/workflows/maven.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 82fe857e..1f73297c 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -11,6 +11,7 @@ jobs: name: Java ${{ matrix.java_version }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: java_version: ['8', '11', '17'] From 49a7bcc67160df6c8cb44bffde0e459ef17bc3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Sch=C3=BCbl?= Date: Mon, 7 Nov 2022 12:00:14 +0100 Subject: [PATCH 42/43] Update src/main/java/org/natty/Parser.java Co-authored-by: Andi Pabst --- src/main/java/org/natty/Parser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/natty/Parser.java b/src/main/java/org/natty/Parser.java index a43127e2..a4f7a300 100644 --- a/src/main/java/org/natty/Parser.java +++ b/src/main/java/org/natty/Parser.java @@ -59,7 +59,7 @@ public Parser() { /** * Parses the given input value for one or more groups of date alternatives * - * @param value the date tor parse + * @param value the date to parse * @return list of date alternatives */ public List parse(String value) { From 79c1910769f7ae5c5cf0da5d8241c7ac14d7d5e2 Mon Sep 17 00:00:00 2001 From: Peter Schuebl Date: Tue, 8 Nov 2022 09:05:54 +0100 Subject: [PATCH 43/43] #26 downgrade logback to 1.3.4 - for Java 8 compatibility See https://logback.qos.ch/dependencies.html --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 805d5ce1..6c58d020 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ ch.qos.logback logback-classic - 1.4.4 + 1.3.4