You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by kw...@apache.org on 2025/07/04 10:50:23 UTC

(jackrabbit-filevault) branch bugfix/lower-log-level-for-invalid-dates-in-package-properties created (now 5903b664)

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a change to branch bugfix/lower-log-level-for-invalid-dates-in-package-properties
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git


      at 5903b664 JCRVLT-807 Lower log level for invalid dates in package properties

This branch includes the following new commits:

     new 5903b664 JCRVLT-807 Lower log level for invalid dates in package properties

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(jackrabbit-filevault) 01/01: JCRVLT-807 Lower log level for invalid dates in package properties

Posted by kw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch bugfix/lower-log-level-for-invalid-dates-in-package-properties
in repository https://gitbox.apache.org/repos/asf/jackrabbit-filevault.git

commit 5903b66458f8180fd00b5ee1f72b88c6949f8d19
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Jul 4 12:50:14 2025 +0200

    JCRVLT-807 Lower log level for invalid dates in package properties
---
 .../vault/packaging/impl/PackagePropertiesImpl.java          | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/PackagePropertiesImpl.java b/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/PackagePropertiesImpl.java
index 4c309a87..faadd1bd 100644
--- a/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/PackagePropertiesImpl.java
+++ b/vault-core/src/main/java/org/apache/jackrabbit/vault/packaging/impl/PackagePropertiesImpl.java
@@ -17,6 +17,7 @@
 
 package org.apache.jackrabbit.vault.packaging.impl;
 
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.time.ZonedDateTime;
@@ -239,9 +240,9 @@ public abstract class PackagePropertiesImpl implements PackageProperties {
     @Override
     public Calendar getDateProperty(String name) {
         Calendar result = null;
-        try {
-            String p = getProperty(name);
-            if (p != null) {
+        String p = getProperty(name);
+        if (p != null) {
+            try {
                 ZonedDateTime zonedDateTime;
                 try {
                     zonedDateTime = ZonedDateTime.parse(p, DATE_TIME_FORMATTER_ISO_8601);
@@ -250,9 +251,10 @@ public abstract class PackagePropertiesImpl implements PackageProperties {
                     zonedDateTime = ZonedDateTime.parse(p, DATE_TIME_FORMATTER_LEGACY);
                 }
                 result = GregorianCalendar.from(zonedDateTime);
+            } catch (DateTimeParseException|IllegalArgumentException e) {
+                log.warn("Error while parsing date property {}: {}, falling back to null!", p, e.getMessage());
+                log.debug("Exception while parsing date property {}", p, e);
             }
-        } catch (Exception e) {
-            log.error("Error while converting date property", e);
         }
         return result;
     }