public final List fields()

in core/src/main/java/com/jetbrains/sa/jdi/ReferenceTypeImpl.java [216:240]


    public final List<FieldImpl> fields() throws ClassNotPreparedException {
        List<FieldImpl> fields = (fieldsCache != null)? fieldsCache.get() : null;
        if (fields == null) {
            checkPrepared();
            if (saKlass instanceof ArrayKlass) {
                fields = Collections.emptyList();
            } else {
                // Get a list of the sa Field types
                List saFields = ((InstanceKlass)saKlass).getImmediateFields();

                // Create a list of our Field types
                int len = saFields.size();
                fields = new ArrayList<FieldImpl>(len);
                for (Object saField : saFields) {
                    sun.jvm.hotspot.oops.Field curField = (sun.jvm.hotspot.oops.Field) saField;
                    if (!isThrowableBacktraceField(curField)) {
                        fields.add(new FieldImpl(this, curField));
                    }
                }
            }
            fields = Collections.unmodifiableList(fields);
            fieldsCache = new SoftReference<List<FieldImpl>>(fields);
        }
        return fields;
    }