Author: meerajk
Date: Sun Feb 18 10:34:10 2007
New Revision: 508936

URL: http://svn.apache.org/viewvc?view=rev&rev=508936
Log:
Returns the exit status instead of the results.

Modified:
    
incubator/tuscany/java/sca/core-samples/standalone/calculator/src/main/java/calculator/CalculatorClient.java

Modified: 
incubator/tuscany/java/sca/core-samples/standalone/calculator/src/main/java/calculator/CalculatorClient.java
URL: 
http://svn.apache.org/viewvc/incubator/tuscany/java/sca/core-samples/standalone/calculator/src/main/java/calculator/CalculatorClient.java?view=diff&rev=508936&r1=508935&r2=508936
==============================================================================
--- 
incubator/tuscany/java/sca/core-samples/standalone/calculator/src/main/java/calculator/CalculatorClient.java
 (original)
+++ 
incubator/tuscany/java/sca/core-samples/standalone/calculator/src/main/java/calculator/CalculatorClient.java
 Sun Feb 18 10:34:10 2007
@@ -33,23 +33,25 @@
         this.calculatorService = calculatorService;
     }
     
-    public Object main(String[] args) throws Exception {
+    public int main(String[] args) throws Exception {
         
         if(args.length != 3) {
             throw new IllegalArgumentException("Usage 
<add|substract|multiply|divide> <operand1> <operand2>");
         }
         
         if("add".equals(args[0])) {
-            return calculatorService.add(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
+            calculatorService.add(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
         } else if("substract".equals(args[0])) {
-            return 
calculatorService.subtract(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
+            calculatorService.subtract(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
         } else if("multiply".equals(args[0])) {
-            return 
calculatorService.multiply(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
+            calculatorService.multiply(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
         } else if("divide".equals(args[0])) {
-            return 
calculatorService.divide(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
+            calculatorService.divide(Double.parseDouble((String)args[1]), 
Double.parseDouble((String)args[2]));
+        } else {
+            throw new IllegalArgumentException("Usage 
<add|substract|multiply|divide> <operand1> <operand2>");
         }
-
-        throw new IllegalArgumentException("Usage 
<add|substract|multiply|divide> <operand1> <operand2>");
+        
+        return 0;
     }
     
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to