/** ensure all fields are of valid type. */ private void validateFields() { List<Field> fields = getFieldList(); for (Field f : fields) { validateField(f.getName(), f.getType()); } }
/** * Initialize any null-valued fields that should have a non-null default * value. */ @SuppressWarnings("UseSpecificCatch") private void initializeFields() { // Get the full field list, don't care about sorting List<Field> flist = getFieldList(); for (Field f : flist) { try { Object o = f.get(this); if (o == null) { initializeField(f, f.getType()); } } catch (Exception e) { throw new Error("Exception reading field '" + f.getName() + "' in " + getClass(), e); } } }
List<Field> flist = getFieldList(); Set<String> names = new HashSet<String>(); for (Field f : flist) {
@Override protected List<Field> getFieldList() { List<Field> fields = new ArrayList<Field>(super.getFieldList()); if (PADDING_SIZE == 0) { Iterator<Field> fieldIterator = fields.iterator(); while (fieldIterator.hasNext()) { Field field = fieldIterator.next(); if ("_f".equals(field.getName())) { fieldIterator.remove(); } } } return fields; }
@Override protected List<Field> getFieldList() { List<Field> fields = new ArrayList<Field>(super.getFieldList()); if (NativeLong.SIZE > 4) { Iterator<Field> fieldIterator = fields.iterator(); while (fieldIterator.hasNext()) { Field field = fieldIterator.next(); if ("_f_unused".equals(field.getName())) { fieldIterator.remove(); } } } return fields; }
/** ensure all fields are of valid type. */ private void validateFields() { List<Field> fields = getFieldList(); for (Field f : fields) { validateField(f.getName(), f.getType()); } }
/** * Initialize any null-valued fields that should have a non-null default * value. */ private void initializeFields() { // Get the full field list, don't care about sorting List<Field> flist = getFieldList(); for (Field f : flist) { try { Object o = f.get(this); if (o == null) { initializeField(f, f.getType()); } } catch (Exception e) { throw new Error("Exception reading field '" + f.getName() + "' in " + getClass(), e); } } }
List<Field> flist = getFieldList(); Set<String> names = new HashSet<String>(); for (Field f : flist) {