changeset 88:899fa0979e1d

Yak shaving: rearrange some code formatting.
author shade
date Thu, 13 Mar 2014 01:23:56 +0400
parents 78069b93a3e4
children 42ee2ebed153
files jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java
diffstat 5 files changed, 24 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java	Thu Mar 13 00:58:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor1_Runner.java	Thu Mar 13 01:23:56 2014 +0400
@@ -71,10 +71,6 @@
         @SuppressWarnings("unchecked")
         final S[] poison = (S[]) new Object[0];
 
-        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
-
-        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
-
         @SuppressWarnings("unchecked")
         final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
 
@@ -91,10 +87,14 @@
         }
 
         StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 1);
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
         version.set(holder);
 
         AtomicInteger epoch = new AtomicInteger();
 
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
         tasks.add(pool.submit(
                 new ActorBase<Actor1_Test<S, R>, S, R>(1, test, version, epoch, counter, control, poison) {
                     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java	Thu Mar 13 00:58:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Arbiter1_Runner.java	Thu Mar 13 01:23:56 2014 +0400
@@ -72,10 +72,6 @@
         @SuppressWarnings("unchecked")
         final S[] poison = (S[]) new Object[0];
 
-        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
-
-        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
-
         @SuppressWarnings("unchecked")
         final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
 
@@ -92,11 +88,15 @@
         }
 
         StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 2);
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
         version.set(holder);
 
         AtomicInteger epoch = new AtomicInteger();
 
-        Future<?> a1 = pool.submit(
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
+        tasks.add(pool.submit(
                 new ActorBase<Actor2_Arbiter1_Test<S, R>, S, R>(1, test, version, epoch, counter, control, poison) {
                     @Override
                     protected void work1(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
@@ -108,10 +108,9 @@
                         test.arbiter1(state, result);
                     }
                 }
-        );
-        tasks.add(a1);
+        ));
 
-        Future<?> a2 = pool.submit(
+        tasks.add(pool.submit(
                 new ActorBase<Actor2_Arbiter1_Test<S, R>, S, R>(2, test, version, epoch, counter, control, poison) {
                     @Override
                     protected void work2(Actor2_Arbiter1_Test<S, R> test, S state, R result) {
@@ -123,8 +122,7 @@
                         test.arbiter1(state, result);
                     }
                 }
-        );
-        tasks.add(a2);
+        ));
 
         try {
             TimeUnit.MILLISECONDS.sleep(control.time);
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java	Thu Mar 13 00:58:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor2_Runner.java	Thu Mar 13 01:23:56 2014 +0400
@@ -70,14 +70,9 @@
 
     @Override
     public Counter<R> internalRun() {
-
         @SuppressWarnings("unchecked")
         final S[] poison = (S[]) new Object[0];
 
-        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
-
-        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
-
         @SuppressWarnings("unchecked")
         final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
 
@@ -94,10 +89,14 @@
         }
 
         StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 2);
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
         version.set(holder);
 
         AtomicInteger epoch = new AtomicInteger();
 
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
         tasks.add(pool.submit(
                 new ActorBase<Actor2_Test<S, R>, S, R>(1, test, version, epoch, counter, control, poison) {
                     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java	Thu Mar 13 00:58:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor3_Runner.java	Thu Mar 13 01:23:56 2014 +0400
@@ -72,14 +72,9 @@
 
     @Override
     public Counter<R> internalRun() {
-
         @SuppressWarnings("unchecked")
         final S[] poison = (S[]) new Object[0];
 
-        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
-
-        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
-
         @SuppressWarnings("unchecked")
         final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
 
@@ -96,10 +91,14 @@
         }
 
         StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 3);
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
         version.set(holder);
 
         AtomicInteger epoch = new AtomicInteger();
 
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
         tasks.add(pool.submit(
                 new ActorBase<Actor3_Test<S, R>, S, R>(1, test, version, epoch, counter, control, poison) {
                     @Override
--- a/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java	Thu Mar 13 00:58:52 2014 +0400
+++ b/jcstress-core/src/main/java/org/openjdk/jcstress/infra/runners/Actor4_Runner.java	Thu Mar 13 01:23:56 2014 +0400
@@ -74,14 +74,9 @@
 
     @Override
     public Counter<R> internalRun() {
-
         @SuppressWarnings("unchecked")
         final S[] poison = (S[]) new Object[0];
 
-        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
-
-        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
-
         @SuppressWarnings("unchecked")
         final Counter<R> counter = Counters.newCounter((Class<R>) test.newResult().getClass());
 
@@ -98,10 +93,14 @@
         }
 
         StateHolder<S, R> holder = new StateHolder<S, R>(newStride, newResult, 4);
+
+        final AtomicReference<StateHolder<S, R>> version = new AtomicReference<StateHolder<S, R>>();
         version.set(holder);
 
         AtomicInteger epoch = new AtomicInteger();
 
+        Collection<Future<?>> tasks = new ArrayList<Future<?>>();
+
         tasks.add(pool.submit(
                 new ActorBase<Actor4_Test<S, R>, S, R>(1, test, version, epoch, counter, control, poison) {
                     @Override