MATH-1383

Modifications required following RNG-10.


Project: http://git-wip-us.apache.org/repos/asf/commons-math/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-math/commit/af6bbeef
Tree: http://git-wip-us.apache.org/repos/asf/commons-math/tree/af6bbeef
Diff: http://git-wip-us.apache.org/repos/asf/commons-math/diff/af6bbeef

Branch: refs/heads/master
Commit: af6bbeefbf197f50d194c7f20419c2a4590ad630
Parents: d14573f
Author: Gilles <gil...@harfang.homelinux.org>
Authored: Tue Aug 23 02:11:34 2016 +0200
Committer: Gilles <gil...@harfang.homelinux.org>
Committed: Tue Aug 23 02:11:34 2016 +0200

----------------------------------------------------------------------
 src/main/java/org/apache/commons/math4/random/RngAdaptor.java    | 4 ++--
 .../org/apache/commons/math4/util/RandomPivotingStrategy.java    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/commons-math/blob/af6bbeef/src/main/java/org/apache/commons/math4/random/RngAdaptor.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/math4/random/RngAdaptor.java 
b/src/main/java/org/apache/commons/math4/random/RngAdaptor.java
index 5a24fec..4603f4e 100644
--- a/src/main/java/org/apache/commons/math4/random/RngAdaptor.java
+++ b/src/main/java/org/apache/commons/math4/random/RngAdaptor.java
@@ -206,7 +206,7 @@ public final class RngAdaptor
         out.defaultWriteObject();
 
         // Save current state.
-        out.writeObject(RandomSource.saveState(delegate));
+        out.writeObject(RandomSource.saveState(delegate).getState());
    }
 
     /**
@@ -223,7 +223,7 @@ public final class RngAdaptor
         // Recreate the "delegate" from serialized info.
         delegate = RandomSource.create(source);
         // And restore its state.
-        final RandomSource.State state = (RandomSource.State) in.readObject();
+        final RandomSource.State state = new RandomSource.State((byte[]) 
in.readObject());
         RandomSource.restoreState(delegate, state);
     }
 }

http://git-wip-us.apache.org/repos/asf/commons-math/blob/af6bbeef/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
----------------------------------------------------------------------
diff --git 
a/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java 
b/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
index 8161ccd..af0f5e1 100644
--- a/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
+++ b/src/main/java/org/apache/commons/math4/util/RandomPivotingStrategy.java
@@ -77,7 +77,7 @@ public class RandomPivotingStrategy implements 
PivotingStrategyInterface, Serial
         out.defaultWriteObject();
 
         // Save current state.
-        out.writeObject(RandomSource.saveState(random));
+        out.writeObject(RandomSource.saveState(random).getState());
    }
 
     /**
@@ -94,7 +94,7 @@ public class RandomPivotingStrategy implements 
PivotingStrategyInterface, Serial
         // Recreate the "delegate" from serialized info.
         random = RandomSource.create(randomSource);
         // And restore its state.
-        final RandomSource.State state = (RandomSource.State) in.readObject();
+        final RandomSource.State state = new RandomSource.State((byte[]) 
in.readObject());
         RandomSource.restoreState(random, state);
     }
 }

Reply via email to