@@ -32,11 +32,7 @@ public class Updaters {
32
32
public static <U > IntegerFieldUpdater <U > newIntegerFieldUpdater (final Class <? super U > tClass ,
33
33
final String fieldName ) {
34
34
try {
35
- if (UnsafeUtil .hasUnsafe ()) {
36
- return new UnsafeIntegerFieldUpdater <>(UnsafeUtil .getUnsafeAccessor ().getUnsafe (), tClass , fieldName );
37
- } else {
38
- return new ReflectionIntegerFieldUpdater <>(tClass , fieldName );
39
- }
35
+ return new ReflectionIntegerFieldUpdater <>(tClass , fieldName );
40
36
} catch (final Throwable t ) {
41
37
throw new RuntimeException (t );
42
38
}
@@ -50,11 +46,7 @@ public static <U> IntegerFieldUpdater<U> newIntegerFieldUpdater(final Class<? su
50
46
*/
51
47
public static <U > LongFieldUpdater <U > newLongFieldUpdater (final Class <? super U > tClass , final String fieldName ) {
52
48
try {
53
- if (UnsafeUtil .hasUnsafe ()) {
54
- return new UnsafeLongFieldUpdater <>(UnsafeUtil .getUnsafeAccessor ().getUnsafe (), tClass , fieldName );
55
- } else {
56
- return new ReflectionLongFieldUpdater <>(tClass , fieldName );
57
- }
49
+ return new ReflectionLongFieldUpdater <>(tClass , fieldName );
58
50
} catch (final Throwable t ) {
59
51
throw new RuntimeException (t );
60
52
}
@@ -69,11 +61,7 @@ public static <U> LongFieldUpdater<U> newLongFieldUpdater(final Class<? super U>
69
61
public static <U , W > ReferenceFieldUpdater <U , W > newReferenceFieldUpdater (final Class <? super U > tClass ,
70
62
final String fieldName ) {
71
63
try {
72
- if (UnsafeUtil .hasUnsafe ()) {
73
- return new UnsafeReferenceFieldUpdater <>(UnsafeUtil .getUnsafeAccessor ().getUnsafe (), tClass , fieldName );
74
- } else {
75
- return new ReflectionReferenceFieldUpdater <>(tClass , fieldName );
76
- }
64
+ return new ReflectionReferenceFieldUpdater <>(tClass , fieldName );
77
65
} catch (final Throwable t ) {
78
66
throw new RuntimeException (t );
79
67
}
0 commit comments