You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2018/02/22 12:27:53 UTC
[03/10] commons-rng git commit: Use field for constant.
Use field for constant.
Project: http://git-wip-us.apache.org/repos/asf/commons-rng/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-rng/commit/f8814d02
Tree: http://git-wip-us.apache.org/repos/asf/commons-rng/tree/f8814d02
Diff: http://git-wip-us.apache.org/repos/asf/commons-rng/diff/f8814d02
Branch: refs/heads/master
Commit: f8814d02c3388eeab1ce0453172b26a4f0607df7
Parents: 5f579ff
Author: Gilles <er...@apache.org>
Authored: Thu Feb 22 11:52:01 2018 +0100
Committer: Gilles <er...@apache.org>
Committed: Thu Feb 22 11:52:01 2018 +0100
----------------------------------------------------------------------
.../org/apache/commons/rng/core/source64/TwoCmres.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-rng/blob/f8814d02/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
----------------------------------------------------------------------
diff --git a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
index ce95264..b542d0b 100644
--- a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
+++ b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source64/TwoCmres.java
@@ -168,6 +168,10 @@ public class TwoCmres extends LongProvider {
* Class is immutable.
*/
static class Cmres {
+ /** Separator. */
+ private static final String SEP = ", ";
+ /** Hexadecimal format. */
+ private static final String HEX_FORMAT = "0x%016xL";
/** Cycle start. */
private final int start;
/** Multiplier. */
@@ -191,10 +195,8 @@ public class TwoCmres extends LongProvider {
/** {@inheritDoc} */
@Override
public String toString() {
- final String sep = ", ";
- // Use hexadecimal for "multiplier" field.
- final String m = String.format((java.util.Locale) null, "0x%016xL", multiply);
- return "Cmres: [" + m + sep + rotate + sep + start + "]";
+ final String m = String.format((java.util.Locale) null, HEX_FORMAT, multiply);
+ return "Cmres: [" + m + SEP + rotate + SEP + start + "]";
}
/**