incubator-vxquery-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prest...@apache.org
Subject svn commit: r1390796 - in /incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions: comparison/ comparison/general/ util/
Date Thu, 27 Sep 2012 00:57:00 GMT
Author: prestonc
Date: Thu Sep 27 00:56:59 2012
New Revision: 1390796

URL: http://svn.apache.org/viewvc?rev=1390796&view=rev
Log:
A few tweaks to comparisons to allow for correct errors when bad pairs of types are passes.
Also updated String and AnyURI comparisons to pass.

Modified:
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/AbstractValueComparisonScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/general/AbstractGeneralComparisonScalarEvaluatorFactory.java
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/AbstractValueComparisonScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/AbstractValueComparisonScalarEvaluatorFactory.java?rev=1390796&r1=1390795&r2=1390796&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/AbstractValueComparisonScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/AbstractValueComparisonScalarEvaluatorFactory.java
Thu Sep 27 00:56:59 2012
@@ -19,8 +19,10 @@ package org.apache.vxquery.runtime.funct
 import java.io.DataOutput;
 
 import org.apache.vxquery.context.DynamicContext;
+import org.apache.vxquery.datamodel.accessors.SequencePointable;
 import org.apache.vxquery.datamodel.accessors.TaggedValuePointable;
 import org.apache.vxquery.datamodel.values.ValueTag;
+import org.apache.vxquery.datamodel.values.XDMConstants;
 import org.apache.vxquery.exceptions.ErrorCode;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.runtime.functions.base.AbstractTaggedValueArgumentScalarEvaluator;
@@ -50,7 +52,8 @@ public abstract class AbstractValueCompa
         final DataOutput dOut = abvs.getDataOutput();
         final AbstractValueComparisonOperation aOp = createValueComparisonOperation();
         final DynamicContext dCtx = (DynamicContext) ctx.getJobletContext().getGlobalJobData();
-
+        final SequencePointable seqp = (SequencePointable) SequencePointable.FACTORY.createPointable();
+        
         final ArrayBackedValueStorage abvsInteger1 = new ArrayBackedValueStorage();
         final DataOutput dOutInteger1 = abvsInteger1.getDataOutput();
         final ArrayBackedValueStorage abvsInteger2 = new ArrayBackedValueStorage();
@@ -61,8 +64,25 @@ public abstract class AbstractValueCompa
             protected void evaluate(TaggedValuePointable[] args, IPointable result) throws
SystemException {
                 TaggedValuePointable tvp1 = args[0];
                 TaggedValuePointable tvp2 = args[1];
+                
+                if (tvp1.getTag() == ValueTag.SEQUENCE_TAG) {
+                    tvp1.getValue(seqp);
+                    if (seqp.getEntryCount() == 0) {
+                        XDMConstants.setEmptySequence(result);
+                        return;
+                    }
+                    throw new SystemException(ErrorCode.XPTY0004);
+                }
+                if (tvp2.getTag() == ValueTag.SEQUENCE_TAG) {
+                    tvp2.getValue(seqp);
+                    if (seqp.getEntryCount() == 0) {
+                        XDMConstants.setEmptySequence(result);
+                        return;
+                    }
+                    throw new SystemException(ErrorCode.XPTY0004);
+                }
+                
                 boolean booleanResult = transformThenCompareTaggedValues(aOp, tvp1, tvp2,
dCtx);
-
                 try {
                     abvs.reset();
                     dOut.write(ValueTag.XS_BOOLEAN_TAG);
@@ -79,7 +99,11 @@ public abstract class AbstractValueCompa
                 TaggedValuePointable tvp2new = (TaggedValuePointable) TaggedValuePointable.FACTORY.createPointable();
 
                 try {
-                    if (FunctionHelper.isDerivedFromInteger(tvp1.getTag())) {
+                    if (tvp1.getTag() == ValueTag.XS_UNTYPED_ATOMIC_TAG) {
+                        // Only need to change tag since the storage is the same for untyped
atomic and string.
+                        tvp1.getByteArray()[0] = ValueTag.XS_STRING_TAG;
+                        tvp1new = tvp1;
+                    } else if (FunctionHelper.isDerivedFromInteger(tvp1.getTag())) {
                         abvsInteger1.reset();
                         FunctionHelper.getIntegerPointable(tvp1, dOutInteger1);
                         tvp1new.set(abvsInteger1.getByteArray(), abvsInteger1.getStartOffset(),
@@ -87,7 +111,11 @@ public abstract class AbstractValueCompa
                     } else {
                         tvp1new = tvp1;
                     }
-                    if (FunctionHelper.isDerivedFromInteger(tvp2.getTag())) {
+                    if (tvp2.getTag() == ValueTag.XS_UNTYPED_ATOMIC_TAG) {
+                        // Only need to change tag since the storage is the same for untyped
atomic and string.
+                        tvp2.getByteArray()[0] = ValueTag.XS_STRING_TAG;
+                        tvp2new = tvp2;
+                    } else if (FunctionHelper.isDerivedFromInteger(tvp2.getTag())) {
                         abvsInteger2.reset();
                         FunctionHelper.getIntegerPointable(tvp2, dOutInteger2);
                         tvp2new.set(abvsInteger2.getByteArray(), abvsInteger2.getStartOffset(),

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/general/AbstractGeneralComparisonScalarEvaluatorFactory.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/general/AbstractGeneralComparisonScalarEvaluatorFactory.java?rev=1390796&r1=1390795&r2=1390796&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/general/AbstractGeneralComparisonScalarEvaluatorFactory.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/comparison/general/AbstractGeneralComparisonScalarEvaluatorFactory.java
Thu Sep 27 00:56:59 2012
@@ -195,8 +195,8 @@ public abstract class AbstractGeneralCom
                     // Set up value comparison tagged value pointables.
                     if (tid1 == ValueTag.XS_UNTYPED_ATOMIC_TAG && tid2 == ValueTag.XS_UNTYPED_ATOMIC_TAG)
{
                         // Only need to change tag since the storage is the same for untyped
atomic and string.
-                        tid1 = ValueTag.XS_STRING_TAG;
-                        tid2 = ValueTag.XS_STRING_TAG;
+                        tvp1.getByteArray()[0] = ValueTag.XS_STRING_TAG;
+                        tvp2.getByteArray()[0] = ValueTag.XS_STRING_TAG;
                     } else if (tid1 == ValueTag.XS_UNTYPED_ATOMIC_TAG) {
                         tid1 = tid2;
                         getCastToOperator(tid2);

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java?rev=1390796&r1=1390795&r2=1390796&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
(original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/runtime/functions/util/FunctionHelper.java
Thu Sep 27 00:56:59 2012
@@ -86,9 +86,9 @@ public class FunctionHelper {
         final TypedPointables tp1 = new TypedPointables();
         final TypedPointables tp2 = new TypedPointables();
 
-        boolean booleanResult = false;
         int tid1 = getBaseTypeForComparisons(tvp1.getTag());
         int tid2 = getBaseTypeForComparisons(tvp2.getTag());
+
         try {
             switch (tid1) {
                 case ValueTag.XS_DECIMAL_TAG:
@@ -96,23 +96,19 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DECIMAL_TAG:
                             tvp2.getValue(tp2.decp);
-                            booleanResult = aOp.operateDecimalDecimal(tp1.decp, tp2.decp);
-                            break;
+                            return aOp.operateDecimalDecimal(tp1.decp, tp2.decp);
 
                         case ValueTag.XS_INTEGER_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateDecimalInteger(tp1.decp, tp2.longp);
-                            break;
+                            return aOp.operateDecimalInteger(tp1.decp, tp2.longp);
 
                         case ValueTag.XS_FLOAT_TAG:
                             tvp2.getValue(tp2.floatp);
-                            booleanResult = aOp.operateDecimalFloat(tp1.decp, tp2.floatp);
-                            break;
+                            return aOp.operateDecimalFloat(tp1.decp, tp2.floatp);
 
                         case ValueTag.XS_DOUBLE_TAG:
                             tvp2.getValue(tp2.doublep);
-                            booleanResult = aOp.operateDecimalDouble(tp1.decp, tp2.doublep);
-                            break;
+                            return aOp.operateDecimalDouble(tp1.decp, tp2.doublep);
                     }
                     break;
 
@@ -121,23 +117,19 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DECIMAL_TAG:
                             tvp2.getValue(tp2.decp);
-                            booleanResult = aOp.operateIntegerDecimal(tp1.longp, tp2.decp);
-                            break;
+                            return aOp.operateIntegerDecimal(tp1.longp, tp2.decp);
 
                         case ValueTag.XS_INTEGER_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateIntegerInteger(tp1.longp, tp2.longp);
-                            break;
+                            return aOp.operateIntegerInteger(tp1.longp, tp2.longp);
 
                         case ValueTag.XS_FLOAT_TAG:
                             tvp2.getValue(tp2.floatp);
-                            booleanResult = aOp.operateIntegerFloat(tp1.longp, tp2.floatp);
-                            break;
+                            return aOp.operateIntegerFloat(tp1.longp, tp2.floatp);
 
                         case ValueTag.XS_DOUBLE_TAG:
                             tvp2.getValue(tp2.doublep);
-                            booleanResult = aOp.operateIntegerDouble(tp1.longp, tp2.doublep);
-                            break;
+                            return aOp.operateIntegerDouble(tp1.longp, tp2.doublep);
                     }
                     break;
 
@@ -146,23 +138,19 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DECIMAL_TAG:
                             tvp2.getValue(tp2.decp);
-                            booleanResult = aOp.operateFloatDecimal(tp1.floatp, tp2.decp);
-                            break;
+                            return aOp.operateFloatDecimal(tp1.floatp, tp2.decp);
 
                         case ValueTag.XS_INTEGER_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateFloatInteger(tp1.floatp, tp2.longp);
-                            break;
+                            return aOp.operateFloatInteger(tp1.floatp, tp2.longp);
 
                         case ValueTag.XS_FLOAT_TAG:
                             tvp2.getValue(tp2.floatp);
-                            booleanResult = aOp.operateFloatFloat(tp1.floatp, tp2.floatp);
-                            break;
+                            return aOp.operateFloatFloat(tp1.floatp, tp2.floatp);
 
                         case ValueTag.XS_DOUBLE_TAG:
                             tvp2.getValue(tp2.doublep);
-                            booleanResult = aOp.operateFloatDouble(tp1.floatp, tp2.doublep);
-                            break;
+                            return aOp.operateFloatDouble(tp1.floatp, tp2.doublep);
                     }
                     break;
 
@@ -171,23 +159,19 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DECIMAL_TAG:
                             tvp2.getValue(tp2.decp);
-                            booleanResult = aOp.operateDoubleDecimal(tp1.doublep, tp2.decp);
-                            break;
+                            return aOp.operateDoubleDecimal(tp1.doublep, tp2.decp);
 
                         case ValueTag.XS_INTEGER_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateDoubleInteger(tp1.doublep, tp2.longp);
-                            break;
+                            return aOp.operateDoubleInteger(tp1.doublep, tp2.longp);
 
                         case ValueTag.XS_FLOAT_TAG:
                             tvp2.getValue(tp2.floatp);
-                            booleanResult = aOp.operateDoubleFloat(tp1.doublep, tp2.floatp);
-                            break;
+                            return aOp.operateDoubleFloat(tp1.doublep, tp2.floatp);
 
                         case ValueTag.XS_DOUBLE_TAG:
                             tvp2.getValue(tp2.doublep);
-                            booleanResult = aOp.operateDoubleDouble(tp1.doublep, tp2.doublep);
-                            break;
+                            return aOp.operateDoubleDouble(tp1.doublep, tp2.doublep);
                     }
                     break;
 
@@ -196,8 +180,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_BOOLEAN_TAG:
                             tvp2.getValue(tp2.boolp);
-                            booleanResult = aOp.operateBooleanBoolean(tp1.boolp, tp2.boolp);
-                            break;
+                            return aOp.operateBooleanBoolean(tp1.boolp, tp2.boolp);
                     }
                     break;
 
@@ -225,9 +208,9 @@ public class FunctionHelper {
                         case ValueTag.XS_IDREF_TAG:
                         case ValueTag.XS_ENTITY_TAG:
                         case ValueTag.XS_UNTYPED_ATOMIC_TAG:
+                        case ValueTag.XS_ANY_URI_TAG:
                             tvp2.getValue(tp2.utf8sp);
-                            booleanResult = aOp.operateStringString(tp1.utf8sp, tp2.utf8sp);
-                            break;
+                            return aOp.operateStringString(tp1.utf8sp, tp2.utf8sp);
                     }
                     break;
 
@@ -236,11 +219,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DATE_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateDateDate(tp1.datep, tp2.datep, dCtx);
-                            break;
-                        default:
-                            // Cross comparisons between DateTime, Date and Time are not
supported.
-                            throw new SystemException(ErrorCode.XPTY0004);
+                            return aOp.operateDateDate(tp1.datep, tp2.datep, dCtx);
                     }
                     break;
 
@@ -249,11 +228,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DATETIME_TAG:
                             tvp2.getValue(tp2.datetimep);
-                            booleanResult = aOp.operateDatetimeDatetime(tp1.datetimep, tp2.datetimep,
dCtx);
-                            break;
-                        default:
-                            // Cross comparisons between DateTime, Date and Time are not
supported.
-                            throw new SystemException(ErrorCode.XPTY0004);
+                            return aOp.operateDatetimeDatetime(tp1.datetimep, tp2.datetimep,
dCtx);
                     }
                     break;
 
@@ -262,11 +237,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_TIME_TAG:
                             tvp2.getValue(tp2.timep);
-                            booleanResult = aOp.operateTimeTime(tp1.timep, tp2.timep, dCtx);
-                            break;
-                        default:
-                            // Cross comparisons between DateTime, Date and Time are not
supported.
-                            throw new SystemException(ErrorCode.XPTY0004);
+                            return aOp.operateTimeTime(tp1.timep, tp2.timep, dCtx);
                     }
                     break;
 
@@ -275,16 +246,15 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DAY_TIME_DURATION_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateDurationDTDuration(tp1.durationp,
tp2.longp);
-                            break;
+                            return aOp.operateDurationDTDuration(tp1.durationp, tp2.longp);
+
                         case ValueTag.XS_DURATION_TAG:
                             tvp2.getValue(tp2.durationp);
-                            booleanResult = aOp.operateDurationDuration(tp1.durationp, tp2.durationp);
-                            break;
+                            return aOp.operateDurationDuration(tp1.durationp, tp2.durationp);
+
                         case ValueTag.XS_YEAR_MONTH_DURATION_TAG:
                             tvp2.getValue(tp2.intp);
-                            booleanResult = aOp.operateDurationYMDuration(tp1.durationp,
tp2.intp);
-                            break;
+                            return aOp.operateDurationYMDuration(tp1.durationp, tp2.intp);
                     }
                     break;
 
@@ -293,16 +263,15 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DAY_TIME_DURATION_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateDTDurationDTDuration(tp1.longp, tp2.longp);
-                            break;
+                            return aOp.operateDTDurationDTDuration(tp1.longp, tp2.longp);
+
                         case ValueTag.XS_DURATION_TAG:
                             tvp2.getValue(tp2.durationp);
-                            booleanResult = aOp.operateDTDurationDuration(tp1.longp, tp2.durationp);
-                            break;
+                            return aOp.operateDTDurationDuration(tp1.longp, tp2.durationp);
+
                         case ValueTag.XS_YEAR_MONTH_DURATION_TAG:
                             tvp2.getValue(tp2.intp);
-                            booleanResult = aOp.operateDTDurationYMDuration(tp1.longp, tp2.intp);
-                            break;
+                            return aOp.operateDTDurationYMDuration(tp1.longp, tp2.intp);
                     }
                     break;
 
@@ -311,16 +280,15 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_DAY_TIME_DURATION_TAG:
                             tvp2.getValue(tp2.longp);
-                            booleanResult = aOp.operateYMDurationDTDuration(tp1.intp, tp2.longp);
-                            break;
+                            return aOp.operateYMDurationDTDuration(tp1.intp, tp2.longp);
+
                         case ValueTag.XS_DURATION_TAG:
                             tvp2.getValue(tp2.durationp);
-                            booleanResult = aOp.operateYMDurationDuration(tp1.intp, tp2.durationp);
-                            break;
+                            return aOp.operateYMDurationDuration(tp1.intp, tp2.durationp);
+
                         case ValueTag.XS_YEAR_MONTH_DURATION_TAG:
                             tvp2.getValue(tp2.intp);
-                            booleanResult = aOp.operateYMDurationYMDuration(tp1.intp, tp2.intp);
-                            break;
+                            return aOp.operateYMDurationYMDuration(tp1.intp, tp2.intp);
                     }
                     break;
 
@@ -329,8 +297,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_G_DAY_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateGDayGDay(tp1.datep, tp2.datep, dCtx);
-                            break;
+                            return aOp.operateGDayGDay(tp1.datep, tp2.datep, dCtx);
                     }
                     break;
 
@@ -339,8 +306,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_G_MONTH_DAY_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateGMonthDayGMonthDay(tp1.datep, tp2.datep,
dCtx);
-                            break;
+                            return aOp.operateGMonthDayGMonthDay(tp1.datep, tp2.datep, dCtx);
                     }
                     break;
 
@@ -349,8 +315,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_G_MONTH_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateGMonthGMonth(tp1.datep, tp2.datep,
dCtx);
-                            break;
+                            return aOp.operateGMonthGMonth(tp1.datep, tp2.datep, dCtx);
                     }
                     break;
 
@@ -359,8 +324,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_G_YEAR_MONTH_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateGYearMonthGYearMonth(tp1.datep, tp2.datep,
dCtx);
-                            break;
+                            return aOp.operateGYearMonthGYearMonth(tp1.datep, tp2.datep,
dCtx);
                     }
                     break;
 
@@ -369,8 +333,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_G_YEAR_TAG:
                             tvp2.getValue(tp2.datep);
-                            booleanResult = aOp.operateGYearGYear(tp1.datep, tp2.datep, dCtx);
-                            break;
+                            return aOp.operateGYearGYear(tp1.datep, tp2.datep, dCtx);
                     }
                     break;
 
@@ -379,8 +342,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_HEX_BINARY_TAG:
                             tvp2.getValue(tp2.binaryp);
-                            booleanResult = aOp.operateHexBinaryHexBinary(tp1.binaryp, tp2.binaryp);
-                            break;
+                            return aOp.operateHexBinaryHexBinary(tp1.binaryp, tp2.binaryp);
                     }
                     break;
 
@@ -389,8 +351,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_BASE64_BINARY_TAG:
                             tvp2.getValue(tp2.binaryp);
-                            booleanResult = aOp.operateBase64BinaryBase64Binary(tp1.binaryp,
tp2.binaryp);
-                            break;
+                            return aOp.operateBase64BinaryBase64Binary(tp1.binaryp, tp2.binaryp);
                     }
                     break;
 
@@ -399,8 +360,21 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_ANY_URI_TAG:
                             tvp2.getValue(tp2.utf8sp);
-                            booleanResult = aOp.operateAnyURIAnyURI(tp1.utf8sp, tp2.utf8sp);
-                            break;
+                            return aOp.operateAnyURIAnyURI(tp1.utf8sp, tp2.utf8sp);
+
+                        case ValueTag.XS_STRING_TAG:
+                        case ValueTag.XS_NORMALIZED_STRING_TAG:
+                        case ValueTag.XS_TOKEN_TAG:
+                        case ValueTag.XS_LANGUAGE_TAG:
+                        case ValueTag.XS_NMTOKEN_TAG:
+                        case ValueTag.XS_NAME_TAG:
+                        case ValueTag.XS_NCNAME_TAG:
+                        case ValueTag.XS_ID_TAG:
+                        case ValueTag.XS_IDREF_TAG:
+                        case ValueTag.XS_ENTITY_TAG:
+                        case ValueTag.XS_UNTYPED_ATOMIC_TAG:
+                            tvp2.getValue(tp2.utf8sp);
+                            return aOp.operateStringString(tp1.utf8sp, tp2.utf8sp);
                     }
                     break;
 
@@ -409,8 +383,7 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_QNAME_TAG:
                             tvp2.getValue(tp2.qnamep);
-                            booleanResult = aOp.operateQNameQName(tp1.qnamep, tp2.qnamep);
-                            break;
+                            return aOp.operateQNameQName(tp1.qnamep, tp2.qnamep);
                     }
                     break;
 
@@ -419,18 +392,16 @@ public class FunctionHelper {
                     switch (tid2) {
                         case ValueTag.XS_NOTATION_TAG:
                             tvp2.getValue(tp2.utf8sp);
-                            booleanResult = aOp.operateNotationNotation(tp1.utf8sp, tp2.utf8sp);
-                            break;
+                            return aOp.operateNotationNotation(tp1.utf8sp, tp2.utf8sp);
                     }
                     break;
             }
-            return booleanResult;
-
         } catch (SystemException se) {
             throw se;
         } catch (Exception e) {
             throw new SystemException(ErrorCode.SYSE0001, e);
         }
+        throw new SystemException(ErrorCode.XPTY0004);
     }
 
     public static int getBaseTypeForArithmetics(int tid) throws SystemException {
@@ -528,6 +499,7 @@ public class FunctionHelper {
                     return ValueTag.XS_INTEGER_TAG;
 
                 case ValueTag.XS_ANY_ATOMIC_TAG:
+                case ValueTag.SEQUENCE_TAG:
                     throw new SystemException(ErrorCode.XPTY0004);
 
                 default:



Mime
View raw message