HugeGraph-254: improve utils class perf with final(inline)

Change-Id: I625be2f4691a7821dbf3107d0f28ce079d46dfee
This commit is contained in:
Zhangmei Li 2017-07-13 18:02:55 +08:00 committed by liningrui
parent 36959044a1
commit d592690cf7
7 changed files with 9 additions and 8 deletions

View File

@ -29,7 +29,7 @@ import java.net.Socket;
* to keep the JanusGraph distribution self-contained insofar as is
* reasonable.
*/
public class CheckSocket {
public final class CheckSocket {
public static final int E_USAGE = 1;
public static final int E_FAILED = 2;

View File

@ -5,7 +5,7 @@ import java.util.Collection;
/**
* Created by liningrui on 2017/3/30.
*/
public class CollectionUtil {
public final class CollectionUtil {
@SuppressWarnings({ "unchecked", "rawtypes" })
public static boolean containsAll(Collection a, Collection b) {

View File

@ -9,14 +9,15 @@ import com.google.common.base.Preconditions;
/**
* Created by liningrui on 2017/5/26.
*/
public class E {
public final class E {
public static void checkNotNull(Object object, String elem) {
Preconditions.checkNotNull(object, "The '%s' can't be null", elem);
}
public static void checkNotNull(Object object, String elem, String owner) {
Preconditions.checkNotNull(object, "The '%s' of '%s' can't be null",
Preconditions.checkNotNull(object,
"The '%s' of '%s' can't be null",
elem, owner);
}

View File

@ -7,7 +7,7 @@ import com.google.common.hash.Hashing;
/**
* Created by jishilei on 2017/3/26.
*/
public class HashUtil {
public final class HashUtil {
public static byte[] hash(byte[] bytes) {
return Hashing.murmur3_32().hashBytes(bytes).asBytes();

View File

@ -24,7 +24,7 @@ import com.google.common.base.Preconditions;
* {@linktourl http://stackoverflow.com/questions/2938482/encode-decode-a-long-to-a-string-using-a-fixed-set-of-letters-in-java}
*
*/
public class LongEncoding {
public final class LongEncoding {
private static final String BASE_SYMBOLS = "0123456789abcdefghijklmnopqrstuvwxyz";

View File

@ -17,7 +17,7 @@ import javassist.CtClass;
import javassist.CtMethod;
import javassist.NotFoundException;
public class ReflectionUtil {
public final class ReflectionUtil {
public static List<Method> getMethodsAnnotatedWith(
Class<?> type,

View File

@ -2,7 +2,7 @@ package com.baidu.hugegraph.util;
import java.util.Date;
public class TimeUtil {
public final class TimeUtil {
public static long twepoch = 1288834974657L;