Flag @Overrides & suppress warnings about those pad members.
I know it's changing code copy & pasted from elsewhere, but warnings aren't fun. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2907 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -283,6 +283,7 @@ public class Randoms
|
|||||||
|
|
||||||
/** A ThreadLocal for accessing a thread-local version of Randoms. */
|
/** A ThreadLocal for accessing a thread-local version of Randoms. */
|
||||||
protected static final ThreadLocal<Randoms> _localRandoms = new ThreadLocal<Randoms>() {
|
protected static final ThreadLocal<Randoms> _localRandoms = new ThreadLocal<Randoms>() {
|
||||||
|
@Override
|
||||||
public Randoms initialValue () {
|
public Randoms initialValue () {
|
||||||
return with(new ThreadLocalRandom());
|
return with(new ThreadLocalRandom());
|
||||||
}
|
}
|
||||||
@@ -342,6 +343,7 @@ public class Randoms
|
|||||||
// Padding to help avoid memory contention among seed updates in
|
// Padding to help avoid memory contention among seed updates in
|
||||||
// different TLRs in the common case that they are located near
|
// different TLRs in the common case that they are located near
|
||||||
// each other.
|
// each other.
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private long pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7;
|
private long pad0, pad1, pad2, pad3, pad4, pad5, pad6, pad7;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -358,12 +360,14 @@ public class Randoms
|
|||||||
*
|
*
|
||||||
* @throws UnsupportedOperationException always
|
* @throws UnsupportedOperationException always
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setSeed(long seed) {
|
public void setSeed(long seed) {
|
||||||
if (initialized)
|
if (initialized)
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
rnd = (seed ^ multiplier) & mask;
|
rnd = (seed ^ multiplier) & mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected int next(int bits) {
|
protected int next(int bits) {
|
||||||
rnd = (rnd * multiplier + addend) & mask;
|
rnd = (rnd * multiplier + addend) & mask;
|
||||||
return (int) (rnd >>> (48-bits));
|
return (int) (rnd >>> (48-bits));
|
||||||
|
|||||||
Reference in New Issue
Block a user