psiprobe.tools.Instruments Maven / Gradle / Ivy
/**
* Licensed under the GPL License. You may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
* WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
package psiprobe.tools;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
/**
* The Class Instruments.
*/
public class Instruments {
/** The Constant SIZE_VOID. */
public static final long SIZE_VOID = 0;
/** The Constant SIZE_BOOLEAN. */
public static final long SIZE_BOOLEAN = 1;
/** The Constant SIZE_BYTE. */
public static final long SIZE_BYTE = 1;
/** The Constant SIZE_CHAR. */
public static final long SIZE_CHAR = 2;
/** The Constant SIZE_SHORT. */
public static final long SIZE_SHORT = 2;
/** The Constant SIZE_INT. */
public static final long SIZE_INT = 4;
/** The Constant SIZE_LONG. */
public static final long SIZE_LONG = 8;
/** The Constant SIZE_FLOAT. */
public static final long SIZE_FLOAT = 4;
/** The Constant SIZE_DOUBLE. */
public static final long SIZE_DOUBLE = 8;
/** The Constant SIZE_OBJECT. */
public static final long SIZE_OBJECT = 8;
/** The Constant SIZE_REFERENCE. */
public static final long SIZE_REFERENCE;
/** The Constant ACCESSOR. */
private static final Accessor ACCESSOR = AccessorFactory.getInstance();
/** The Constant IGNORE_NIO. */
private static final boolean IGNORE_NIO;
static {
String ignoreNioProp = System.getProperty("psiprobe.intruments.ignoreNIO");
String os64bitProp = System.getProperty("sun.arch.data.model");
IGNORE_NIO = ignoreNioProp == null || "true".equalsIgnoreCase(ignoreNioProp);
SIZE_REFERENCE = "64".equals(os64bitProp) ? 8 : 4;
}
/** The processed objects. */
private Set