Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove unsafe filed updater #1177

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@ public class Updaters {
public static <U> IntegerFieldUpdater<U> newIntegerFieldUpdater(final Class<? super U> tClass,
final String fieldName) {
try {
if (UnsafeUtil.hasUnsafe()) {
return new UnsafeIntegerFieldUpdater<>(UnsafeUtil.getUnsafeAccessor().getUnsafe(), tClass, fieldName);
} else {
return new ReflectionIntegerFieldUpdater<>(tClass, fieldName);
}
return new ReflectionIntegerFieldUpdater<>(tClass, fieldName);
} catch (final Throwable t) {
throw new RuntimeException(t);
}
Expand All @@ -50,11 +46,7 @@ public static <U> IntegerFieldUpdater<U> newIntegerFieldUpdater(final Class<? su
*/
public static <U> LongFieldUpdater<U> newLongFieldUpdater(final Class<? super U> tClass, final String fieldName) {
try {
if (UnsafeUtil.hasUnsafe()) {
return new UnsafeLongFieldUpdater<>(UnsafeUtil.getUnsafeAccessor().getUnsafe(), tClass, fieldName);
} else {
return new ReflectionLongFieldUpdater<>(tClass, fieldName);
}
return new ReflectionLongFieldUpdater<>(tClass, fieldName);
} catch (final Throwable t) {
throw new RuntimeException(t);
}
Expand All @@ -69,11 +61,7 @@ public static <U> LongFieldUpdater<U> newLongFieldUpdater(final Class<? super U>
public static <U, W> ReferenceFieldUpdater<U, W> newReferenceFieldUpdater(final Class<? super U> tClass,
final String fieldName) {
try {
if (UnsafeUtil.hasUnsafe()) {
return new UnsafeReferenceFieldUpdater<>(UnsafeUtil.getUnsafeAccessor().getUnsafe(), tClass, fieldName);
} else {
return new ReflectionReferenceFieldUpdater<>(tClass, fieldName);
}
return new ReflectionReferenceFieldUpdater<>(tClass, fieldName);
fengjiachun marked this conversation as resolved.
Show resolved Hide resolved
} catch (final Throwable t) {
throw new RuntimeException(t);
}
Expand Down
Loading