Cleanup PlatformDependent* code
Motivation: PlatformDependent* contains some methods that are not used and some other things that can be cleaned-up. Modifications: - Remove unused methods - cleanup Result: Code cleanup.
This commit is contained in:
parent
876818a7d2
commit
01d747ab83
@ -50,10 +50,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.ConcurrentLinkedDeque;
|
import java.util.concurrent.ConcurrentLinkedDeque;
|
||||||
import java.util.concurrent.ConcurrentMap;
|
import java.util.concurrent.ConcurrentMap;
|
||||||
import java.util.concurrent.LinkedBlockingDeque;
|
import java.util.concurrent.LinkedBlockingDeque;
|
||||||
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
|
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
|
|
||||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@ -418,10 +415,6 @@ public final class PlatformDependent {
|
|||||||
return PlatformDependent0.getLong(data, index);
|
return PlatformDependent0.getLong(data, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void putOrderedObject(Object object, long address, Object value) {
|
|
||||||
PlatformDependent0.putOrderedObject(object, address, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void putByte(long address, byte value) {
|
public static void putByte(long address, byte value) {
|
||||||
PlatformDependent0.putByte(address, value);
|
PlatformDependent0.putByte(address, value);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ final class PlatformDependent0 {
|
|||||||
addressField = (Field) maybeAddressField;
|
addressField = (Field) maybeAddressField;
|
||||||
logger.debug("java.nio.Buffer.address: available");
|
logger.debug("java.nio.Buffer.address: available");
|
||||||
} else {
|
} else {
|
||||||
logger.debug("java.nio.Buffer.address: unavailable", (Exception) maybeAddressField);
|
logger.debug("java.nio.Buffer.address: unavailable", (Throwable) maybeAddressField);
|
||||||
addressField = null;
|
addressField = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ final class PlatformDependent0 {
|
|||||||
} else {
|
} else {
|
||||||
// Unsafe.copyMemory(Object, long, Object, long, long) unavailable.
|
// Unsafe.copyMemory(Object, long, Object, long, long) unavailable.
|
||||||
unsafe = null;
|
unsafe = null;
|
||||||
logger.debug("sun.misc.Unsafe.copyMemory: unavailable", (Exception) maybeException);
|
logger.debug("sun.misc.Unsafe.copyMemory: unavailable", (Throwable) maybeException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -172,7 +172,7 @@ final class PlatformDependent0 {
|
|||||||
@Override
|
@Override
|
||||||
public Object run() {
|
public Object run() {
|
||||||
try {
|
try {
|
||||||
final Constructor constructor =
|
final Constructor<?> constructor =
|
||||||
direct.getClass().getDeclaredConstructor(long.class, int.class);
|
direct.getClass().getDeclaredConstructor(long.class, int.class);
|
||||||
constructor.setAccessible(true);
|
constructor.setAccessible(true);
|
||||||
return constructor;
|
return constructor;
|
||||||
@ -188,7 +188,7 @@ final class PlatformDependent0 {
|
|||||||
address = UNSAFE.allocateMemory(1);
|
address = UNSAFE.allocateMemory(1);
|
||||||
// try to use the constructor now
|
// try to use the constructor now
|
||||||
try {
|
try {
|
||||||
((Constructor) maybeDirectBufferConstructor).newInstance(address, 1);
|
((Constructor<?>) maybeDirectBufferConstructor).newInstance(address, 1);
|
||||||
directBufferConstructor = (Constructor<?>) maybeDirectBufferConstructor;
|
directBufferConstructor = (Constructor<?>) maybeDirectBufferConstructor;
|
||||||
logger.debug("direct buffer constructor: available");
|
logger.debug("direct buffer constructor: available");
|
||||||
} catch (InstantiationException e) {
|
} catch (InstantiationException e) {
|
||||||
@ -201,7 +201,7 @@ final class PlatformDependent0 {
|
|||||||
} else {
|
} else {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
"direct buffer constructor: unavailable",
|
"direct buffer constructor: unavailable",
|
||||||
(Exception) maybeDirectBufferConstructor);
|
(Throwable) maybeDirectBufferConstructor);
|
||||||
directBufferConstructor = null;
|
directBufferConstructor = null;
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@ -357,10 +357,6 @@ final class PlatformDependent0 {
|
|||||||
return UNSAFE.getLong(data, BYTE_ARRAY_BASE_OFFSET + index);
|
return UNSAFE.getLong(data, BYTE_ARRAY_BASE_OFFSET + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void putOrderedObject(Object object, long address, Object value) {
|
|
||||||
UNSAFE.putOrderedObject(object, address, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void putByte(long address, byte value) {
|
static void putByte(long address, byte value) {
|
||||||
UNSAFE.putByte(address, value);
|
UNSAFE.putByte(address, value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user