continue;
}
// Check if field type is a reference type
FieldInstruction fins = (FieldInstruction) ins;
Type fieldType = fins.getType(cpg);
if (!(fieldType instanceof ReferenceType)) {
continue;
}
// Find the exact field being stored into
XField xfield = Hierarchy.findXField(fins, cpg);
if (xfield == null) {
continue;
}
// Skip public and protected fields, since it is reasonable to
// assume
// we won't see every store to those fields
if (xfield.isPublic() || xfield.isProtected()) {
continue;
}
// The top value on the stack is the one which will be stored
// into the field
TypeFrame frame = typeDataflow.getFactAtLocation(location);
if (!frame.isValid()) {
continue;
}
Type storeType = frame.getTopValue();
if (!(storeType instanceof ReferenceType)) {
continue;
}
// Get or create the field store type set
FieldStoreType property = database.getProperty(xfield.getFieldDescriptor());
if (property == null) {
property = new FieldStoreType();
database.setProperty(xfield.getFieldDescriptor(), property);
}
// Add the store type to the set
property.addTypeSignature(storeType.getSignature());
}
}