You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2010/08/29 04:46:22 UTC

svn commit: r990478 - in /tuscany/sca-java-2.x/trunk/modules: implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/ implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/pr...

Author: jsdelfino
Date: Sun Aug 29 02:46:21 2010
New Revision: 990478

URL: http://svn.apache.org/viewvc?rev=990478&view=rev
Log:
Minor change. Code format and cleanup.

Modified:
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java
    tuscany/sca-java-2.x/trunk/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProvider.java Sun Aug 29 02:46:21 2010
@@ -43,7 +43,7 @@ import org.python.util.PythonInterpreter
 
 /**
  * Implementation provider for Python component implementations.
- *
+ * 
  * @version $Rev$ $Date$
  */
 class PythonImplementationProvider implements ImplementationProvider {
@@ -52,7 +52,7 @@ class PythonImplementationProvider imple
     PythonInterpreter python;
     PyObject callable;
     ProxyFactory pxFactory;
-    
+
     PythonImplementationProvider(final RuntimeComponent comp, final PythonImplementation impl, ProxyFactory pxf) {
         component = comp;
         implementation = impl;
@@ -60,40 +60,40 @@ class PythonImplementationProvider imple
     }
 
     public void start() {
-    	final PySystemState pss = new PySystemState();
-    	pss.path.insert(0, new PyString(implementation.getLocation()));
-    	pss.path.insert(0, new PyString(getClass().getProtectionDomain().getCodeSource().getLocation().getFile()));
-    	python = new PythonInterpreter(null, pss);
-    	python.exec("from invoker import *");
-    	
-    	final List<PyObject> px = new ArrayList<PyObject>();
-    	for (final ComponentReference r: component.getReferences()) {
-    		final PythonEval pe = pxFactory.createProxy(PythonEval.class, (RuntimeEndpointReference)r.getEndpointReferences().get(0));
+        final PySystemState pss = new PySystemState();
+        pss.path.insert(0, new PyString(implementation.getLocation()));
+        pss.path.insert(0, new PyString(getClass().getProtectionDomain().getCodeSource().getLocation().getFile()));
+        python = new PythonInterpreter(null, pss);
+        python.exec("from invoker import *");
+
+        final List<PyObject> px = new ArrayList<PyObject>();
+        for(final ComponentReference r: component.getReferences()) {
+            final PythonEval pe = pxFactory.createProxy(PythonEval.class, (RuntimeEndpointReference)r.getEndpointReferences().get(0));
             px.add(Py.java2py(new PythonEval() {
-            	@Override
-            	public String eval(final String args) throws Exception {
-            		final String v = pe.eval(args); 
-            		return v;
-            	}
+                @Override
+                public String eval(final String args) throws Exception {
+                    final String v = pe.eval(args);
+                    return v;
+                }
             }));
-    	}
-    	final List<PyObject> pr = new ArrayList<PyObject>();
-    	for (final ComponentProperty p: component.getProperties()) {
-    		final String v = String.valueOf(p.getValue()); 
+        }
+        final List<PyObject> pr = new ArrayList<PyObject>();
+        for(final ComponentProperty p: component.getProperties()) {
+            final String v = String.valueOf(p.getValue());
             pr.add(Py.java2py(new PythonProperty() {
-				@Override
-				public String eval() {
-            		return v;
-				}
-			}));
-    	}
+                @Override
+                public String eval() {
+                    return v;
+                }
+            }));
+        }
 
-    	PyObject mkc = python.get("mkcomponent");
-    	callable = mkc.__call__(new PyString(component.getName()), new PyString(implementation.getScript()), new PyTuple(px.toArray(new PyObject[0])), new PyTuple(pr.toArray(new PyObject[0])));
+        PyObject mkc = python.get("mkcomponent");
+        callable = mkc.__call__(new PyString(component.getName()), new PyString(implementation.getScript()), new PyTuple(px.toArray(new PyObject[0])), new PyTuple(pr.toArray(new PyObject[0])));
     }
 
     public void stop() {
-    	python.cleanup();
+        python.cleanup();
     }
 
     public boolean supportsOneWayInvocation() {

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonImplementationProviderFactory.java Sun Aug 29 02:46:21 2010
@@ -29,20 +29,20 @@ import org.apache.tuscany.sca.runtime.Ru
 
 /**
  * A factory for Python implementation providers.
- *
+ * 
  * @version $Rev$ $Date$
  */
 public class PythonImplementationProviderFactory implements ImplementationProviderFactory<PythonImplementation> {
-	final ProxyFactory pxFactory;
-    
+    final ProxyFactory pxFactory;
+
     public PythonImplementationProviderFactory(final ExtensionPointRegistry ep) {
-    	pxFactory = ExtensibleProxyFactory.getInstance(ep);
+        pxFactory = ExtensibleProxyFactory.getInstance(ep);
     }
 
     public ImplementationProvider createImplementationProvider(final RuntimeComponent comp, final PythonImplementation impl) {
         return new PythonImplementationProvider(comp, impl, pxFactory);
     }
-    
+
     public Class<PythonImplementation> getModelType() {
         return PythonImplementation.class;
     }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/main/java/org/apache/tuscany/sca/implementation/python/provider/PythonInvoker.java Sun Aug 29 02:46:21 2010
@@ -28,7 +28,7 @@ import org.python.util.PythonInterpreter
 
 /**
  * An invoker for Python components.
- *
+ * 
  * @version $Rev$ $Date$
  */
 class PythonInvoker implements Invoker {
@@ -43,15 +43,15 @@ class PythonInvoker implements Invoker {
     }
 
     String apply(final String req) {
-    	PyObject r = callable.__call__(new PyString(req));
-    	return r.toString();
+        PyObject r = callable.__call__(new PyString(req));
+        return r.toString();
     }
 
     public Message invoke(final Message msg) {
         try {
             msg.setBody(apply((String)((Object[])msg.getBody())[0]));
-        } catch (Exception e) {
-        	e.printStackTrace();
+        } catch(Exception e) {
+            e.printStackTrace();
             msg.setFaultBody(e.getCause());
         }
         return msg;

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ClientTest.java Sun Aug 29 02:46:21 2010
@@ -20,18 +20,17 @@ package org.apache.tuscany.sca.implement
 
 import org.oasisopen.sca.annotation.Reference;
 
-
 /**
  * Test Java component.
  * 
  * @version $Rev$ $Date$
  */
 public class ClientTest implements EchoTest {
-	
-	@Reference
-	public EchoTest ref;
 
-	public String echo(final String s1, final String s2) {
-		return ref.echo(s1, s2);
-	}
+    @Reference
+    public EchoTest ref;
+
+    public String echo(final String s1, final String s2) {
+        return ref.echo(s1, s2);
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/EchoTest.java Sun Aug 29 02:46:21 2010
@@ -20,7 +20,6 @@ package org.apache.tuscany.sca.implement
 
 import org.oasisopen.sca.annotation.Remotable;
 
-
 /**
  * Test client interface.
  * 
@@ -29,5 +28,5 @@ import org.oasisopen.sca.annotation.Remo
 @Remotable
 public interface EchoTest {
 
-	public String echo(String s1, String s2);
+    public String echo(String s1, String s2);
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/InvokeTestCase.java Sun Aug 29 02:46:21 2010
@@ -38,23 +38,23 @@ import org.junit.Test;
  * @version $Rev$ $Date$
  */
 public class InvokeTestCase {
-	static Node node;
-    
+    static Node node;
+
     @BeforeClass
     public static void setUp() throws Exception {
-    	try {
-	    	final String loc = getContributionLocation("domain-test.composite");
-			node = NodeFactory.newInstance().createNode("domain-test.composite", new Contribution("c", loc));
-	        node.start();
-    	} catch (Exception e) {
-    		e.printStackTrace();
-    		throw e;
-    	}
+        try {
+            final String loc = getContributionLocation("domain-test.composite");
+            node = NodeFactory.newInstance().createNode("domain-test.composite", new Contribution("c", loc));
+            node.start();
+        } catch(Exception e) {
+            e.printStackTrace();
+            throw e;
+        }
     }
 
     @AfterClass
     public static void tearDown() throws Exception {
-    	node.stop();
+        node.stop();
     }
 
     @Test
@@ -62,7 +62,7 @@ public class InvokeTestCase {
         final Session s = TransportRegistry.i().createSession("http://localhost:8080/python");
         final Client c = new Client(s);
         final Object px = c.openProxy("", EchoTest.class);
-        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[]{"Hey", "There"});
+        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
         c.closeProxy(px);
         s.close();
         assertEquals("Hey There", r);
@@ -73,7 +73,7 @@ public class InvokeTestCase {
         final Session s = TransportRegistry.i().createSession("http://localhost:8080/client");
         final Client c = new Client(s);
         final Object px = c.openProxy("", EchoTest.class);
-        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[]{"Hey", "There"});
+        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
         c.closeProxy(px);
         s.close();
         assertEquals("Hey There", r);
@@ -84,7 +84,7 @@ public class InvokeTestCase {
         final Session s = TransportRegistry.i().createSession("http://localhost:8080/java-client");
         final Client c = new Client(s);
         final Object px = c.openProxy("", EchoTest.class);
-        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[]{"Hey", "There"});
+        final Object r = c.invoke(px, EchoTest.class.getMethod("echo", String.class, String.class), new Object[] {"Hey", "There"});
         c.closeProxy(px);
         s.close();
         assertEquals("Hey There", r);

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python-runtime/src/test/java/org/apache/tuscany/sca/implementation/python/provider/ServerTest.java Sun Aug 29 02:46:21 2010
@@ -18,7 +18,6 @@
  */
 package org.apache.tuscany.sca.implementation.python.provider;
 
-
 /**
  * Test Java component.
  * 
@@ -26,7 +25,7 @@ package org.apache.tuscany.sca.implement
  */
 public class ServerTest implements EchoTest {
 
-	public String echo(final String s1, final String s2) {
-		return s1 + " " + s2;
-	}
+    public String echo(final String s1, final String s2) {
+        return s1 + " " + s2;
+    }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonEval.java Sun Aug 29 02:46:21 2010
@@ -20,7 +20,6 @@ package org.apache.tuscany.sca.implement
 
 import org.oasisopen.sca.annotation.Remotable;
 
-
 /**
  * Python component generic evaluation interface.
  * 
@@ -29,5 +28,5 @@ import org.oasisopen.sca.annotation.Remo
 @Remotable
 public interface PythonEval {
 
-	public String eval(String args) throws Exception;
+    public String eval(String args) throws Exception;
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementation.java Sun Aug 29 02:46:21 2010
@@ -49,11 +49,12 @@ public class PythonImplementation extend
         contract = c;
 
         class DynService extends ServiceImpl {
-        	public DynService() {
-        		setName("default");
-        		setInterfaceContract(contract);
-			}
-        };
+            public DynService() {
+                setName("default");
+                setInterfaceContract(contract);
+            }
+        }
+        ;
         service = new DynService();
         getServices().add(service);
     }
@@ -61,43 +62,43 @@ public class PythonImplementation extend
     public String getScript() {
         return script;
     }
-    
+
     public String getLocation() {
-		return location;
-	}
+        return location;
+    }
 
     public Service getService(final String n) {
-    	return service;
-    }  
+        return service;
+    }
 
     public Reference getReference(final String n) {
-    	final Reference r = super.getReference(n);
-    	if (r != null)
-    		return r;
-    	class DynReference extends ReferenceImpl {
-    		public DynReference() {
-    	    	setName(n);
-    	    	setInterfaceContract(contract);
-			}
-    	}
-    	final Reference nr = new DynReference();
-    	getReferences().add(nr);
-    	return nr;
+        final Reference r = super.getReference(n);
+        if(r != null)
+            return r;
+        class DynReference extends ReferenceImpl {
+            public DynReference() {
+                setName(n);
+                setInterfaceContract(contract);
+            }
+        }
+        final Reference nr = new DynReference();
+        getReferences().add(nr);
+        return nr;
     }
-    
+
     public Property getProperty(final String n) {
-    	final Property p = super.getProperty(n);
-    	if (p != null)
-    		return p;
-    	class DynProperty extends PropertyImpl {
-    		public DynProperty() {
-    	    	setName(n);
-    	    	setDataType(new DataTypeImpl<XMLType>(null, String.class, String.class, XMLType.UNKNOWN));
-    	    	setXSDType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
-			}
-    	}
-    	final Property np = new DynProperty();
-    	getProperties().add(np);
-    	return np;
+        final Property p = super.getProperty(n);
+        if(p != null)
+            return p;
+        class DynProperty extends PropertyImpl {
+            public DynProperty() {
+                setName(n);
+                setDataType(new DataTypeImpl<XMLType>(null, String.class, String.class, XMLType.UNKNOWN));
+                setXSDType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
+            }
+        }
+        final Property np = new DynProperty();
+        getProperties().add(np);
+        return np;
     }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonImplementationProcessor.java Sun Aug 29 02:46:21 2010
@@ -55,29 +55,29 @@ public class PythonImplementationProcess
 
     final InterfaceContract contract;
 
-    public PythonImplementationProcessor(final ExtensionPointRegistry ep) throws InvalidInterfaceException, NoSuchMethodException {
+    public PythonImplementationProcessor(final ExtensionPointRegistry ep) throws InvalidInterfaceException {
         final FactoryExtensionPoint fep = ep.getExtensionPoint(FactoryExtensionPoint.class);
         final JavaInterfaceFactory jf = fep.getFactory(JavaInterfaceFactory.class);
         final JavaInterface eval = jf.createJavaInterface(PythonEval.class);
-        
+
         class DynamicInterface extends JavaInterfaceImpl {
-        	DynamicInterface() throws NoSuchMethodException {
-        		setJavaClass(eval.getJavaClass());
-        		setName(eval.getName());
-        		setRemotable(eval.isRemotable());
-        		Operation op = eval.getOperations().get(0);
-        		op.setDynamic(true);
-        		getOperations().add(op);
+            DynamicInterface() {
+                setJavaClass(eval.getJavaClass());
+                setName(eval.getName());
+                setRemotable(eval.isRemotable());
+                Operation op = eval.getOperations().get(0);
+                op.setDynamic(true);
+                getOperations().add(op);
                 resetDataBinding(JSONDataBinding.NAME);
                 setUnresolved(false);
-			}
-        	
-        	@Override
-        	public boolean isDynamic() {
-        		return true;
-        	}
+            }
+
+            @Override
+            public boolean isDynamic() {
+                return true;
+            }
         }
-        
+
         contract = jf.createJavaInterfaceContract();
         contract.setInterface(new DynamicInterface());
     }
@@ -92,7 +92,8 @@ public class PythonImplementationProcess
 
     public PythonImplementation read(final XMLStreamReader r, final ProcessorContext ctx) throws ContributionReadException, XMLStreamException {
         final String scr = r.getAttributeValue(null, "script");
-        while (r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName())));
+        while(r.hasNext() && !(r.next() == END_ELEMENT && QN.equals(r.getName())))
+            ;
         return new PythonImplementation(QN, scr, URI.create(ctx.getContribution().getLocation()).getPath(), contract);
     }
 
@@ -100,10 +101,7 @@ public class PythonImplementationProcess
     }
 
     public void write(final PythonImplementation impl, final XMLStreamWriter w, final ProcessorContext ctx) throws ContributionWriteException, XMLStreamException {
-        writeStart(w,
-                   QN.getNamespaceURI(),
-                   QN.getLocalPart(),
-                   new XAttr("script", impl.getScript()));
+        writeStart(w, QN.getNamespaceURI(), QN.getLocalPart(), new XAttr("script", impl.getScript()));
         writeEnd(w);
     }
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python/src/main/java/org/apache/tuscany/sca/implementation/python/PythonProperty.java Sun Aug 29 02:46:21 2010
@@ -20,7 +20,6 @@ package org.apache.tuscany.sca.implement
 
 import org.oasisopen.sca.annotation.Remotable;
 
-
 /**
  * Python component property evaluation interface.
  * 
@@ -29,5 +28,5 @@ import org.oasisopen.sca.annotation.Remo
 @Remotable
 public interface PythonProperty {
 
-	public String eval();
+    public String eval();
 }

Modified: tuscany/sca-java-2.x/trunk/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java?rev=990478&r1=990477&r2=990478&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/implementation-python/src/test/java/org/apache/tuscany/sca/implementation/python/ReadWriteTestCase.java Sun Aug 29 02:46:21 2010
@@ -43,7 +43,6 @@ import org.apache.tuscany.sca.monitor.Mo
 import org.junit.BeforeClass;
 import org.junit.Test;
 
-
 /**
  * Test reading/writing Python implementations.
  * 
@@ -71,7 +70,7 @@ public class ReadWriteTestCase {
     @Test
     public void testRead() throws Exception {
         final InputStream is = getClass().getClassLoader().getResourceAsStream("domain-test.composite");
-        final Composite c = (Composite) xproc.read(xif.createXMLStreamReader(is), ctx);
+        final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
         assertNotNull(c);
         assertEquals("server_test.py", ((PythonImplementation)c.getComponents().get(0).getImplementation()).getScript());
     }
@@ -79,7 +78,7 @@ public class ReadWriteTestCase {
     @Test
     public void testReadWrite() throws Exception {
         final InputStream is = getClass().getClassLoader().getResourceAsStream("domain-test.composite");
-        final Composite c = (Composite) xproc.read(xif.createXMLStreamReader(is), ctx);
+        final Composite c = (Composite)xproc.read(xif.createXMLStreamReader(is), ctx);
         final ByteArrayOutputStream bos = new ByteArrayOutputStream();
         xproc.write(c, xof.createXMLStreamWriter(bos), ctx);
         assertTrue(bos.toString().contains("script=\"server_test.py\""));