本文整理汇总了Java中com.squareup.haha.perflib.Type.OBJECT属性的典型用法代码示例。如果您正苦于以下问题:Java Type.OBJECT属性的具体用法?Java Type.OBJECT怎么用?Java Type.OBJECT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.squareup.haha.perflib.Type
的用法示例。
在下文中一共展示了Type.OBJECT属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitClassObj
private void visitClassObj(LeakNode node) {
ClassObj classObj = (ClassObj) node.instance;
Map<String, Exclusion> ignoredStaticFields =
excludedRefs.staticFieldNameByClassName.get(classObj.getClassName());
for (Map.Entry<Field, Object> entry : classObj.getStaticFieldValues().entrySet()) {
Field field = entry.getKey();
if (field.getType() != Type.OBJECT) {
continue;
}
String fieldName = field.getName();
if (fieldName.equals("$staticOverhead")) {
continue;
}
Instance child = (Instance) entry.getValue();
boolean visit = true;
if (ignoredStaticFields != null) {
Exclusion params = ignoredStaticFields.get(fieldName);
if (params != null) {
visit = false;
if (!params.alwaysExclude) {
enqueue(params, node, child, fieldName, STATIC_FIELD);
}
}
}
if (visit) {
enqueue(null, node, child, fieldName, STATIC_FIELD);
}
}
}
示例2: visitArrayInstance
private void visitArrayInstance(LeakNode node) {
ArrayInstance arrayInstance = (ArrayInstance) node.instance;
Type arrayType = arrayInstance.getArrayType();
if (arrayType == Type.OBJECT) {
Object[] values = arrayInstance.getValues();
for (int i = 0; i < values.length; i++) {
Instance child = (Instance) values[i];
enqueue(null, node, child, "[" + i + "]", ARRAY_ENTRY);
}
}
}
示例3: isPrimitiveOrWrapperArray
public static boolean isPrimitiveOrWrapperArray(Object value) {
if (!(value instanceof ArrayInstance)) {
return false;
}
ArrayInstance arrayInstance = (ArrayInstance) value;
if (arrayInstance.getArrayType() != Type.OBJECT) {
return true;
}
return WRAPPER_TYPES.contains(arrayInstance.getClassObj().getClassName());
}