Skip to content

Commit

Permalink
Suppress deprecation warnings for Java 18 for Unsafe usage.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Dec 28, 2021
1 parent 9e3de5a commit 3ef17a7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions agrona/src/main/java/org/agrona/BufferUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public final class BufferUtil
/**
* Byte array base offset.
*/
@SuppressWarnings("deprecation")
public static final long ARRAY_BASE_OFFSET = UNSAFE.arrayBaseOffset(byte[].class);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ abstract class AbstractConcurrentArrayQueuePadding3 extends AbstractConcurrentAr
/**
* Left over immutable queue fields.
*/
@SuppressWarnings("deprecation")
public abstract class AbstractConcurrentArrayQueue<E>
extends AbstractConcurrentArrayQueuePadding3
implements QueuedPipe<E>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/**
* Pad out a cache line to the left of a tail to prevent false sharing.
*/
@SuppressWarnings("deprecation")
abstract class ManyToOneConcurrentLinkedQueuePadding1
{
/**
Expand Down
4 changes: 1 addition & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ subprojects {
options.forkOptions.javaHome = javaHome.toFile()
}

if (buildJavaVersion < 18) {
options.compilerArgs.addAll(['-Xlint:all', '-Werror']) // Enable all warnings and treat them as errors
}
options.compilerArgs.addAll(['-Xlint:all', '-Werror']) // Enable all warnings and treat them as errors
options.compilerArgs.add('-XDignore.symbol.file') // Suppress warnings about using Unsafe
options.encoding = 'UTF-8'
options.deprecation = true
Expand Down

0 comments on commit 3ef17a7

Please sign in to comment.