MCPcopy Index your code
hub / github.com/java-native-access/jna / initializeFields

Method initializeFields

src/com/sun/jna/Structure.java:1480–1495  ·  view source on GitHub ↗

Initialize any null-valued fields that should have a non-null default value.

()

Source from the content-addressed store, hash-verified

1478 * value.
1479 */
1480 @SuppressWarnings("UseSpecificCatch")
1481 private void initializeFields() {
1482 // Get the full field list, don't care about sorting
1483 List<Field> flist = getFieldList();
1484 for (Field f : flist) {
1485 try {
1486 Object o = f.get(this);
1487 if (o == null) {
1488 initializeField(f, f.getType());
1489 }
1490 }
1491 catch (Exception e) {
1492 throw new Error("Exception reading field '" + f.getName() + "' in " + getClass(), e);
1493 }
1494 }
1495 }
1496
1497 private Object initializeField(Field field, Class<?> type) {
1498 Object value = null;

Callers 1

StructureMethod · 0.95

Calls 5

getFieldListMethod · 0.95
initializeFieldMethod · 0.95
getNameMethod · 0.65
getMethod · 0.45
getTypeMethod · 0.45

Tested by

no test coverage detected