You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ode.apache.org by va...@apache.org on 2010/07/09 00:39:15 UTC

svn commit: r961967 - in /ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler: ThrowGenerator.java ThrowGeneratorMessages.java

Author: vanto
Date: Thu Jul  8 22:39:15 2010
New Revision: 961967

URL: http://svn.apache.org/viewvc?rev=961967&view=rev
Log:
fixing ODE-869.

Added:
    ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java   (with props)
Modified:
    ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java

Modified: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java?rev=961967&r1=961966&r2=961967&view=diff
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java (original)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGenerator.java Thu Jul  8 22:39:15 2010
@@ -18,17 +18,20 @@
  */
 package org.apache.ode.bpel.compiler;
 
+import org.apache.ode.bpel.compiler.api.CompilationException;
 import org.apache.ode.bpel.compiler.bom.Activity;
 import org.apache.ode.bpel.compiler.bom.ThrowActivity;
 import org.apache.ode.bpel.o.OActivity;
 import org.apache.ode.bpel.o.OThrow;
+import org.apache.ode.utils.msg.MessageBundle;
 
 
 /**
  * Generates code for <code>&lt;throw&gt;</code> activities.
  */
 class ThrowGenerator extends DefaultActivityGenerator {
-
+    private static final ThrowGeneratorMessages __cmsgs = MessageBundle.getMessages(ThrowGeneratorMessages.class);
+    
     public OActivity newInstance(Activity src) {
         return new OThrow(_context.getOProcess(), _context.getCurrent());
     }
@@ -36,6 +39,10 @@ class ThrowGenerator extends DefaultActi
     public void compile(OActivity output, Activity src) {
         ThrowActivity throwDef = (ThrowActivity)src;
         OThrow othrow = (OThrow) output;
+
+        if (throwDef.getFaultName() == null)
+            throw new CompilationException(__cmsgs.errThrowMustDefineFaultName()); 
+
         othrow.faultName = throwDef.getFaultName();
         if(throwDef.getFaultVariable() != null)
             othrow.faultVariable = _context.resolveVariable(throwDef.getFaultVariable());

Added: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java
URL: http://svn.apache.org/viewvc/ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java?rev=961967&view=auto
==============================================================================
--- ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java (added)
+++ ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java Thu Jul  8 22:39:15 2010
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.ode.bpel.compiler;
+
+import org.apache.ode.bpel.compiler.api.CompilationMessage;
+import org.apache.ode.bpel.compiler.api.CompilationMessageBundle;
+
+public class ThrowGeneratorMessages extends CompilationMessageBundle {
+
+    /** Must specify a faultName */
+    public CompilationMessage errThrowMustDefineFaultName() {
+        return this.formatCompilationMessage("<throw> must specify a faultName.");
+    }
+
+}

Propchange: ode/trunk/bpel-compiler/src/main/java/org/apache/ode/bpel/compiler/ThrowGeneratorMessages.java
------------------------------------------------------------------------------
    svn:eol-style = native