jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [05/11] jena git commit: Simplified the checking of the input timezone.
Date Fri, 10 Jun 2016 12:52:58 GMT


Simplified the checking of the input timezone.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/77ddf087
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/77ddf087
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/77ddf087

Branch: refs/heads/master
Commit: 77ddf08758c37efc15410e938b65e3d379f83dd8
Parents: d786344
Author: ales004 <cicerone54@hotmail.com>
Authored: Fri Jun 3 20:53:02 2016 +0200
Committer: ales004 <cicerone54@hotmail.com>
Committed: Fri Jun 3 20:53:02 2016 +0200

----------------------------------------------------------------------
 .../org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java     | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/77ddf087/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java b/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java
index 037b160..861b388 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/expr/nodevalue/XSDFuncOp.java
@@ -1565,14 +1565,12 @@ public class XSDFuncOp
         if(!nv1.isDateTime() && !nv1.isDate()){
             throw new ExprEvalException("Not a valid date or datetime:"+nv1);
         }
-        DateTimeStruct dts = parseAnyDT(nv1);
-        NodeValue inputTimezone = fromTimezoneToDuration(dts);
-        Boolean hasTz = inputTimezone == null ? false : true;
+
         XMLGregorianCalendar calValue = nv1.getDateTime();
+        Boolean hasTz = calValue.getTimezone() != DatatypeConstants.FIELD_UNDEFINED;
         int inputOffset = 0;
         if(hasTz){
-            Duration inputDuration = inputTimezone.getDuration();
-            inputOffset = inputDuration.getSign()*(inputDuration.getMinutes() + 60*inputDuration.getHours());
+            inputOffset = calValue.getTimezone();
         }
 
         int tzOffset = TimeZone.getDefault().getRawOffset() / (1000*60);


Mime
View raw message