[spring-extensions] branch maint-5 updated: Guard deprecation warning if value is negative.

Scott Cantor cantor.2 at osu.edu
Wed Jan 17 11:52:34 EST 2018


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch maint-5
in repository spring-extensions.

View the commit online:
http://git.shibboleth.net/view/?p=spring-extensions.git;a=commit;h=c06f04f835968a387dc14ab843a3b7ae7a7ac77e

The following commit(s) were added to refs/heads/maint-5 by this push:
       new  c06f04f   Guard deprecation warning if value is negative.
c06f04f is described below

commit c06f04f835968a387dc14ab843a3b7ae7a7ac77e
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Jan 17 11:52:31 2018 -0500

    Guard deprecation warning if value is negative.
---
 .../net/shibboleth/ext/spring/config/DurationToLongConverter.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/net/shibboleth/ext/spring/config/DurationToLongConverter.java b/src/main/java/net/shibboleth/ext/spring/config/DurationToLongConverter.java
index d67c5e5..69e30c8 100644
--- a/src/main/java/net/shibboleth/ext/spring/config/DurationToLongConverter.java
+++ b/src/main/java/net/shibboleth/ext/spring/config/DurationToLongConverter.java
@@ -41,12 +41,14 @@ public class DurationToLongConverter implements Converter<String,Long>, Conditio
         if (source.startsWith("P")) {
             return DOMTypeSupport.durationToLong(source.trim());
         } else if (source.startsWith("-P")) {
-            throw new IllegalArgumentException("Negative durations are not supported");
+            throw new IllegalArgumentException("Negative duration syntax is not supported");
         } else {
             // Treat as a milliseconds.  But note this
             final long duration = Long.valueOf(source);
-            log.info("Deprecated duration of {} was specified. Use XML duration of {}", source,
-                    DOMTypeSupport.longToDuration(duration));
+            if (duration > 0) {
+                log.info("Deprecated duration of {} was specified. Use XML duration of {}", source,
+                        DOMTypeSupport.longToDuration(duration));
+            }
             return duration;
         }
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list