Author: hadrian
Date: Fri Dec 14 21:10:00 2012
New Revision: 1422089

URL: http://svn.apache.org/viewvc?rev=1422089&view=rev
Log:
Remove tabs from source

Modified:
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/soup/Comm.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobMessages.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
    ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ProxyConstructor.java
    
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/vpu/ProxyConstructorTimingTest.java

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/soup/Comm.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/soup/Comm.java?rev=1422089&r1=1422088&r2=1422089&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/soup/Comm.java (original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/soup/Comm.java Fri Dec 
14 21:10:00 2012
@@ -59,7 +59,7 @@ public abstract class Comm extends Execu
     }
 
     public String toString() {
-       // TODO: maybe find a better way to do a toString and replace 
ObjectPrinter
+        // TODO: maybe find a better way to do a toString and replace 
ObjectPrinter
         return new StringBuilder("{")
             .append(this.getClass().getSimpleName())
             .append(" chnl=").append(_channel)

Modified: 
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobMessages.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobMessages.java?rev=1422089&r1=1422088&r2=1422089&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobMessages.java 
(original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobMessages.java 
Fri Dec 14 21:10:00 2012
@@ -45,7 +45,7 @@ public class JacobMessages { // extends 
         methodName, className);
   }
 
-       // TODO
+  // TODO
   public String msgContDeHydrationErr(String channel, String name) {
     throw new UnsupportedOperationException();
   }

Modified: ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java?rev=1422089&r1=1422088&r2=1422089&view=diff
==============================================================================
--- ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java 
(original)
+++ ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/JacobVPU.java Fri 
Dec 14 21:10:00 2012
@@ -116,7 +116,7 @@ public final class JacobVPU {
      */
     public boolean execute() {
         if (__log.isTraceEnabled()) {
-               // TODO: make this look nicer with slf4j
+            // TODO: make this look nicer with slf4j
             // __log.trace(ObjectPrinter.stringifyMethodEnter("execute", new 
Class[]{}));
             __log.trace(">> execute ()");
         }
@@ -177,7 +177,7 @@ public final class JacobVPU {
     public void registerExtension(Class extensionClass, Object obj) {
         if (__log.isTraceEnabled()) {
             // TODO: __log.trace(ObjectPrinter.stringifyMethodEnter(
-               // "registerExtension", new Object[] {"extensionClass", 
extensionClass, "obj", obj }));
+            // "registerExtension", new Object[] {"extensionClass", 
extensionClass, "obj", obj }));
             __log.trace(">> setContext (extensionClass=" +  extensionClass + 
", obj=" + obj + ")");
         }
         _extensions.put(extensionClass, obj);
@@ -458,7 +458,7 @@ public final class JacobVPU {
             } catch (IllegalAccessException iae) {
                 // TODO: String msg = 
__msgs.msgMethodNotAccessible(_method.getName(),
                 //        _method.getDeclaringClass().getName());
-               String msg = "MethodNotAccessible: " + _method.getName() + " in 
" + _method.getDeclaringClass().getName();
+                String msg = "MethodNotAccessible: " + _method.getName() + " 
in " + _method.getDeclaringClass().getName();
                 __log.error(msg, iae);
                 throw new RuntimeException(msg, iae);
             } catch (InvocationTargetException e) {
@@ -467,7 +467,7 @@ public final class JacobVPU {
                 } else {
                     // TODO: String msg = 
__msgs.msgClientMethodException(_method.getName(),
                     //        _methodBody.getClass().getName());
-                       String msg = "ClientMethodException: " + 
_method.getName() + " in " + _methodBody.getClass().getName();
+                    String msg = "ClientMethodException: " + _method.getName() 
+ " in " + _methodBody.getClass().getName();
                     __log.error(msg, e.getTargetException());
                     throw new RuntimeException(e.getTargetException());
                 }

Modified: 
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ProxyConstructor.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ProxyConstructor.java?rev=1422089&r1=1422088&r2=1422089&view=diff
==============================================================================
--- 
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ProxyConstructor.java 
(original)
+++ 
ode/trunk/jacob/src/main/java/org/apache/ode/jacob/vpu/ProxyConstructor.java 
Fri Dec 14 21:10:00 2012
@@ -27,23 +27,23 @@ import java.lang.reflect.Proxy;
  * Interface implemented by channel proxies.
  */
 public class ProxyConstructor<T> {
-       private Constructor<T> constructor;
-       @SuppressWarnings("unchecked")
-       public ProxyConstructor(Class<T> clazz) {
-           try {
-                   Class<?> proxyClass = 
Proxy.getProxyClass(clazz.getClassLoader(), new Class[] {clazz});
-                       constructor = (Constructor<T>) 
proxyClass.getConstructor(new Class[] { InvocationHandler.class });
-               } catch (Exception e) {
-                       // TODO: ignore? LOG?
-               }
-       }
-       
-       public T newInstance(InvocationHandler handler) {
-               try {
-                       return constructor != null ? 
(T)constructor.newInstance(handler) : null;
-               } catch (Exception e) {
-                       // TODO: really ignore?
-               }
-               return null;
-       }
+    private Constructor<T> constructor;
+    @SuppressWarnings("unchecked")
+    public ProxyConstructor(Class<T> clazz) {
+        try {
+            Class<?> proxyClass = Proxy.getProxyClass(clazz.getClassLoader(), 
new Class[] {clazz});
+            constructor = (Constructor<T>) proxyClass.getConstructor(new 
Class[] { InvocationHandler.class });
+        } catch (Exception e) {
+            // TODO: ignore? LOG?
+        }
+    }
+    
+    public T newInstance(InvocationHandler handler) {
+        try {
+            return constructor != null ? (T)constructor.newInstance(handler) : 
null;
+        } catch (Exception e) {
+            // TODO: really ignore?
+        }
+        return null;
+    }
 }

Modified: 
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/vpu/ProxyConstructorTimingTest.java
URL: 
http://svn.apache.org/viewvc/ode/trunk/jacob/src/test/java/org/apache/ode/jacob/vpu/ProxyConstructorTimingTest.java?rev=1422089&r1=1422088&r2=1422089&view=diff
==============================================================================
--- 
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/vpu/ProxyConstructorTimingTest.java
 (original)
+++ 
ode/trunk/jacob/src/test/java/org/apache/ode/jacob/vpu/ProxyConstructorTimingTest.java
 Fri Dec 14 21:10:00 2012
@@ -26,7 +26,7 @@ import junit.framework.TestCase;
 
 
 public class ProxyConstructorTimingTest extends TestCase {
-       private static final long COUNT = 1000000L;
+    private static final long COUNT = 1000000L;
     public ProxyConstructorTimingTest(String testName) {
         super(testName);
     }
@@ -35,133 +35,133 @@ public class ProxyConstructorTimingTest 
     }
 
     public interface TestExecution {
-        public void execute() throws Exception;        
+        public void execute() throws Exception;
     }
 
     public class RepeatExecution implements TestExecution {
-       private final long count;
-       private final TestExecution test;
-       public RepeatExecution(long count, TestExecution test) {
-               this.count = count;
-               this.test = test;
-       }
+        private final long count;
+        private final TestExecution test;
+        public RepeatExecution(long count, TestExecution test) {
+            this.count = count;
+            this.test = test;
+        }
         public void execute() throws Exception {
-               for (long i = 0; i < count; i++) {
-                       test.execute();
-               }
+            for (long i = 0; i < count; i++) {
+                test.execute();
+            }
         }
     }
 
     public class TimedExecution implements TestExecution {
-       private final String name;
-       private final TestExecution test;
-       public TimedExecution(String name, TestExecution test) {
-               this.name = name;
-               this.test = test;
-       }
+        private final String name;
+        private final TestExecution test;
+        public TimedExecution(String name, TestExecution test) {
+            this.name = name;
+            this.test = test;
+        }
         public void execute() throws Exception {
-               NanoTimer timer = new NanoTimer().start();
-               test.execute();
-               System.out.println("TimedExecution(" + name + "): " + 
timer.stop() + "[ns]");
+            NanoTimer timer = new NanoTimer().start();
+            test.execute();
+            System.out.println("TimedExecution(" + name + "): " + timer.stop() 
+ "[ns]");
         }
     }
 
     public void timedRepeatedExecution(String name, TestExecution test) throws 
Exception {
-       new TimedExecution(name, new RepeatExecution(COUNT, test)).execute();
+        new TimedExecution(name, new RepeatExecution(COUNT, test)).execute();
     }
 
     public void manualTestProxyTiming() throws Exception {
-       timedRepeatedExecution("direct invocation", new TestExecution() {
-                       @Override
-                       public void execute() throws Exception {
-                               // Create new instance every time
-                   new GreeterImpl2().hello("World");
-                       }
-       });
-
-       timedRepeatedExecution("newProxyInstance", new TestExecution() {
-                       @Override
-                       public void execute() throws Exception {
-                   Greeter gp = (Greeter) 
Proxy.newProxyInstance(Greeter.class.getClassLoader(),
-                   new Class<?>[] {Greeter.class}, new 
GreeterInvocationHandler(new GreeterImpl2()));
-                       gp.hello("World");
-                       }
-       });
-
-           final ProxyConstructor<Greeter> helper = new 
ProxyConstructor<Greeter>(Greeter.class);
-       timedRepeatedExecution("ProxyConstructor", new TestExecution() {
-                       @Override
-                       public void execute() throws Exception {
-                   Greeter gp = (Greeter) helper.newInstance(new 
GreeterInvocationHandler(new GreeterImpl2()));
-                   gp.hello("World");
-                       }
-       });
+        timedRepeatedExecution("direct invocation", new TestExecution() {
+            @Override
+            public void execute() throws Exception {
+                // Create new instance every time
+                new GreeterImpl2().hello("World");
+            }
+        });
+
+        timedRepeatedExecution("newProxyInstance", new TestExecution() {
+            @Override
+            public void execute() throws Exception {
+                Greeter gp = (Greeter) 
Proxy.newProxyInstance(Greeter.class.getClassLoader(),
+                    new Class<?>[] {Greeter.class}, new 
GreeterInvocationHandler(new GreeterImpl2()));
+                gp.hello("World");
+            }
+        });
+
+        final ProxyConstructor<Greeter> helper = new 
ProxyConstructor<Greeter>(Greeter.class);
+        timedRepeatedExecution("ProxyConstructor", new TestExecution() {
+            @Override
+            public void execute() throws Exception {
+                Greeter gp = (Greeter) helper.newInstance(new 
GreeterInvocationHandler(new GreeterImpl2()));
+                gp.hello("World");
+            }
+        });
     }
     
     public interface Greeter {
-       String hello(String name);
+        String hello(String name);
     }
     
     public class GreeterImpl implements Greeter {
-               public String hello(String name) {
-                       return "Hello " + name;
-               }
+        public String hello(String name) {
+            return "Hello " + name;
+        }
     }
 
     public class GreeterImpl2 implements Greeter {
-               public String hello(String name) {
-                       return "";
-               }
+        public String hello(String name) {
+            return "";
+        }
     }
 
     public class GreeterInvocationHandler implements InvocationHandler {
-       private Object greeter;
-       GreeterInvocationHandler(Object o) {
-               greeter = o;
-       }
-
-       public Object invoke(Object proxy, Method method, Object[] args) throws 
Throwable {
-                  if(Object.class  == method.getDeclaringClass()) {
-                      String name = method.getName();
-                      if("equals".equals(name)) {
-                          return proxy == args[0];
-                      } else if("hashCode".equals(name)) {
-                          return System.identityHashCode(proxy);
-                      } else if("toString".equals(name)) {
-                          return proxy.getClass().getName() + "@" +
-                              
Integer.toHexString(System.identityHashCode(proxy)) +
-                              ", with InvocationHandler " + this;
-                      } else {
-                          throw new 
IllegalStateException(String.valueOf(method));
-                      }
-                  }
-                  return method.invoke(greeter, args);
-               }       
+        private Object greeter;
+        GreeterInvocationHandler(Object o) {
+            greeter = o;
+        }
+
+        public Object invoke(Object proxy, Method method, Object[] args) 
throws Throwable {
+           if(Object.class  == method.getDeclaringClass()) {
+               String name = method.getName();
+               if("equals".equals(name)) {
+                   return proxy == args[0];
+               } else if("hashCode".equals(name)) {
+                   return System.identityHashCode(proxy);
+               } else if("toString".equals(name)) {
+                   return proxy.getClass().getName() + "@" +
+                       Integer.toHexString(System.identityHashCode(proxy)) +
+                       ", with InvocationHandler " + this;
+               } else {
+                   throw new IllegalStateException(String.valueOf(method));
+               }
+           }
+           return method.invoke(greeter, args);
+        }    
     }
 
     // TODO: may be useful for other things? move it somewhere else?
     public class NanoTimer {
-       private long start;
-       private long lap;
-       // TODO: we could also count laps...
-       public NanoTimer() {
-               // don't start by default, easy to just call .start();
-       }
-       public NanoTimer start() {
-               start = System.nanoTime();
-               lap = start;
-               return this;
-       }
-       public long stop() {
-               long span = System.nanoTime() - start;
-               start = 0;
-               lap = 0;
-               return span;
-       }
-       public long lap() {
-               long prev = lap;
-               lap = (start != 0) ? System.nanoTime() : 0;
-               return lap - prev;
-       }
+        private long start;
+        private long lap;
+        // TODO: we could also count laps...
+        public NanoTimer() {
+            // don't start by default, easy to just call .start();
+        }
+        public NanoTimer start() {
+            start = System.nanoTime();
+            lap = start;
+            return this;
+        }
+        public long stop() {
+            long span = System.nanoTime() - start;
+            start = 0;
+            lap = 0;
+            return span;
+        }
+        public long lap() {
+            long prev = lap;
+            lap = (start != 0) ? System.nanoTime() : 0;
+            return lap - prev;
+        }
     }
 }


Reply via email to