You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fesod.apache.org by "nkuprins (via GitHub)" <gi...@apache.org> on 2026/09/07 15:12:05 UTC
[PR] refactor: extract format-string date detection out of DateUtils [fesod]
nkuprins opened a new pull request, #1077:
URL: https://github.com/apache/fesod/pull/1077
Closed: #1062
## Purpose of the pull request
As title
## What's changed?
- Extracted date format detection: moved detection logic out of `DateUtils` into a dedicated `ExcelDateFormatDetector` package-private class.
- Updated test references: adjusted `DateUtilsTest` to test date format detection via the newly extracted `ExcelDateFormatDetector`.
## Checklist
- [x] I have read the [Contributor Guide](https://fesod.apache.org/community/contribution/).
- [x] I have written the necessary doc or comment.
- [x] I have added the necessary unit tests and all cases have passed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] refactor: extract format-string date detection out of DateUtils [fesod]
Posted by "nkuprins (via GitHub)" <gi...@apache.org>.
nkuprins commented on code in PR #1077:
URL: https://github.com/apache/fesod/pull/1077#discussion_r3957732956
##########
fesod-sheet/src/main/java/org/apache/fesod/sheet/util/ExcelDateFormatDetector.java:
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.sheet.util;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+import org.apache.fesod.common.util.MapUtils;
+import org.apache.fesod.common.util.StringUtils;
+
+/**
+ * Extracted from {@link DateUtils}.
+ * <p>
+ * Package-private: to keep {@link DateUtils} the sole public entry point.
+ * </p>
+ */
Review Comment:
Yes, but I wanted to highlight *package-private* to avoid an accidental change to `public` by some other contributor in the future. Well, probably, *internal helper* is indeed sufficient to make it clear.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] refactor: extract format-string date detection out of DateUtils [fesod]
Posted by "bengbengbalabalabeng (via GitHub)" <gi...@apache.org>.
bengbengbalabalabeng commented on code in PR #1077:
URL: https://github.com/apache/fesod/pull/1077#discussion_r3958144296
##########
fesod-sheet/src/main/java/org/apache/fesod/sheet/util/ExcelDateFormatDetector.java:
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.sheet.util;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+import org.apache.fesod.common.util.MapUtils;
+import org.apache.fesod.common.util.StringUtils;
+
+/**
+ * Extracted from {@link DateUtils}.
+ * <p>
+ * Package-private: to keep {@link DateUtils} the sole public entry point.
+ * </p>
+ */
Review Comment:
How about something like this?
```
Internal helper used by {@link DateUtils} for detecting date-related spreadsheet format strings.
<p>
Not intended for direct use; use {@link DateUtils} as the primary entry point instead.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] refactor: extract format-string date detection out of DateUtils [fesod]
Posted by "bengbengbalabalabeng (via GitHub)" <gi...@apache.org>.
bengbengbalabalabeng commented on code in PR #1077:
URL: https://github.com/apache/fesod/pull/1077#discussion_r3957585463
##########
fesod-sheet/src/main/java/org/apache/fesod/sheet/util/ExcelDateFormatDetector.java:
##########
@@ -0,0 +1,196 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fesod.sheet.util;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+import org.apache.fesod.common.util.MapUtils;
+import org.apache.fesod.common.util.StringUtils;
+
+/**
+ * Extracted from {@link DateUtils}.
+ * <p>
+ * Package-private: to keep {@link DateUtils} the sole public entry point.
+ * </p>
+ */
Review Comment:
Could we make the class comment focus a bit more on its responsibility? For example:
```
Internal helper used by {@link DateUtils} for detecting date-related spreadsheet format strings.
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org
Re: [PR] refactor: extract format-string date detection out of DateUtils [fesod]
Posted by "delei (via GitHub)" <gi...@apache.org>.
delei merged PR #1077:
URL: https://github.com/apache/fesod/pull/1077
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fesod.apache.org
For additional commands, e-mail: commits-help@fesod.apache.org