Skip to content

Commit

Permalink
Merge bc38d58 into a6f527e
Browse files Browse the repository at this point in the history
  • Loading branch information
leerho committed Mar 2, 2021
2 parents a6f527e + bc38d58 commit 51d5e8c
Show file tree
Hide file tree
Showing 19 changed files with 88 additions and 193 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @author Praveenkumar Venkatesan
* @author Roman Leventov
*/
@SuppressWarnings({"restriction"})
final class AccessByteBuffer {

static final ByteBuffer ZERO_READ_ONLY_DIRECT_BYTE_BUFFER =
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/apache/datasketches/memory/AllocateDirect.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @author Roman Leventov
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction","synthetic-access"})
final class AllocateDirect implements AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(AllocateDirect.class);

Expand Down Expand Up @@ -83,9 +84,9 @@ boolean doClose() {
// because the valid state is already changed.
cleaner.clean();
return true;
} else {
return false;
}
return false;

} finally {
BaseState.reachabilityFence(this);
}
Expand Down Expand Up @@ -135,9 +136,8 @@ boolean deallocate(final boolean calledFromCleaner) {
BaseState.currentDirectMemoryAllocations_.decrementAndGet();
BaseState.currentDirectMemoryAllocated_.addAndGet(-capacity);
return true;
} else {
return false;
}
}
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
* @author Lee Rhodes
* @author Praveenkumar Venkatesan
*/
@SuppressWarnings({"restriction","synthetic-access"})
class AllocateDirectMap implements Map {
private static final Logger LOG = LoggerFactory.getLogger(AllocateDirectMap.class);

Expand Down Expand Up @@ -162,9 +163,8 @@ boolean doClose() {
// because the valid state is already changed.
cleaner.clean();
return true;
} else {
return false;
}
}
return false;
} finally {
BaseState.reachabilityFence(this);
}
Expand Down Expand Up @@ -294,9 +294,8 @@ boolean deallocate(final boolean calledFromCleaner) {
BaseState.currentDirectMemoryMapAllocated_.addAndGet(-myCapacity);
}
return true;
} else {
return false;
}
}
return false;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
abstract class BaseState {

//Byte Order related
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* Common base of native-ordered and non-native-ordered {@link WritableBuffer} implementations.
* Contains methods which are agnostic to the byte order.
*/
@SuppressWarnings({"restriction"})
abstract class BaseWritableBufferImpl extends WritableBuffer {
final BaseWritableMemoryImpl originMemory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
* Common base of native-ordered and non-native-ordered {@link WritableMemory} implementations.
* Contains methods which are agnostic to the byte order.
*/
@SuppressWarnings({"restriction"})
abstract class BaseWritableMemoryImpl extends WritableMemory {


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/**
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
final class CompareAndCopy {

/**
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/apache/datasketches/memory/Ints.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ static int checkedCast(final long v) {
final int result = (int) v;
if (result != v) {
throw new IllegalArgumentException("Out of range: " + v);
} else {
return result;
}
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package org.apache.datasketches.memory;

@SuppressWarnings({"restriction"})
final class JDK7Compatible {

private JDK7Compatible() {}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/apache/datasketches/memory/NioBits.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
*
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
final class NioBits {
private static final Class<?> VM_CLASS;
private static final Method VM_MAX_DIRECT_MEMORY_METHOD;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* @author Roman Leventov
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
abstract class NonNativeWritableBufferImpl extends BaseWritableBufferImpl {

//Pass-through ctor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
* @author Roman Leventov
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
abstract class NonNativeWritableMemoryImpl extends BaseWritableMemoryImpl {

//Pass-through ctor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*
* @author Lee Rhodes
*/
@SuppressWarnings("javadoc")
@SuppressWarnings({"javadoc","restriction"})
public final class UnsafeUtil {
public static final Unsafe unsafe;
public static final String JDK; //must be at least "1.8"
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/apache/datasketches/memory/Utf8.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
* @author Lee Rhodes
* @author Roman Leventov
*/
@SuppressWarnings({"restriction","synthetic-access"})
final class Utf8 {

private Utf8() { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @author Roman Leventov
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
abstract class WritableBufferImpl extends BaseWritableBufferImpl {

//Pass-through ctor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* @author Roman Leventov
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
abstract class WritableMemoryImpl extends BaseWritableMemoryImpl {

//Pass-through ctor
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/apache/datasketches/memory/XxHash64.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
*
* @author Lee Rhodes
*/
@SuppressWarnings({"restriction"})
public class XxHash64 {
// Unsigned, 64-bit primes
private static final long P1 = -7046029288634856825L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
/**
* @author Lee Rhodes
*/
@SuppressWarnings("javadoc")
@SuppressWarnings({"javadoc","restriction"})
public class UnsafeUtilTest {
long testField = 1; //Do not remove & cannot be static. Used in reflection check.

Expand Down

0 comments on commit 51d5e8c

Please sign in to comment.