ode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mi...@apache.org
Subject svn commit: r786312 - in /ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang: xpath10/compiler/XPathMessages.java xpath20/compiler/XPath20ExpressionCompilerImpl.java xquery10/compiler/XQuery10ExpressionCompilerImpl.java
Date Thu, 18 Jun 2009 22:04:08 GMT
Author: midon
Date: Thu Jun 18 22:04:08 2009
New Revision: 786312

URL: http://svn.apache.org/viewvc?rev=786312&view=rev
Log:
throw a CompilationException and provide a more meaningful message

Modified:
    ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPathMessages.java
    ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
    ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java

Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPathMessages.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPathMessages.java?rev=786312&r1=786311&r2=786312&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPathMessages.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath10/compiler/XPathMessages.java
Thu Jun 18 22:04:08 2009
@@ -22,6 +22,9 @@
 import org.apache.ode.bpel.compiler.api.CompilationMessage;
 import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
 
+import javax.xml.namespace.QName;
+import java.net.URI;
+
 /**
  * Compilation messages related to XPath 1.0 expressions.
  * @author mriou <mriou at apache dot org>
@@ -107,5 +110,9 @@
         return super.formatCompilationMessage("Attempt to use the messageType variable {0}
in an expression " +
                 " even though the associated message is undefined or has no part.", message);
     }
+    /** Empty query */
+    public CompilationMessage errExpressionEmpty(URI docUri, QName elementName) {
+        return super.formatCompilationMessage("XPath elementName and xpath node are both
empty in file: {0}, element: {1}", docUri, elementName.toString());
+    }
 
 }

Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java?rev=786312&r1=786311&r2=786312&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xpath20/compiler/XPath20ExpressionCompilerImpl.java
Thu Jun 18 22:04:08 2009
@@ -126,7 +126,7 @@
         String xpathStr;
         Node node = source.getExpression();
         if (node == null) {
-            throw new IllegalStateException("XPath string and xpath node are both null");
+            throw new CompilationException(__msgs.errExpressionEmpty(source.getURI(), new
QName(source.getElement().getNamespaceURI(), source.getElement().getNodeName())));
         }
         if (node.getNodeType() != Node.TEXT_NODE) {
             throw new CompilationException(__msgs.errUnexpectedNodeTypeForXPath(DOMUtils.domToString(node)));

Modified: ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
URL: http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java?rev=786312&r1=786311&r2=786312&view=diff
==============================================================================
--- ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
(original)
+++ ode/branches/APACHE_ODE_1.X/bpel-compiler/src/main/java/org/apache/ode/bpel/elang/xquery10/compiler/XQuery10ExpressionCompilerImpl.java
Thu Jun 18 22:04:08 2009
@@ -29,7 +29,6 @@
 import javax.xml.namespace.QName;
 import javax.xml.transform.Source;
 import javax.xml.transform.TransformerFactory;
-import javax.xml.xpath.XPathExpressionException;
 import javax.xml.xquery.XQConnection;
 import javax.xml.xquery.XQConstants;
 import javax.xml.xquery.XQDataSource;
@@ -147,7 +146,7 @@
         String xqueryStr;
         Node node = source.getExpression();
         if (node == null) {
-            throw new IllegalStateException("XQuery string and xpath node are both null");
+            throw new CompilationException(__msgs.errExpressionEmpty(source.getURI(), new
QName(source.getElement().getNamespaceURI(), source.getElement().getNodeName())));
         }
         if (node.getNodeType() != Node.TEXT_NODE && 
         		node.getNodeType() != Node.ELEMENT_NODE && 



Mime
View raw message