private static void addReceiverObjectType ( WarningPropertySet < WarningProperty > propertySet , ClassContext classContext , Method method , Location location ) { try { Instruction ins = location . getHandle ( ) . getInstruction ( ) ; if ( ! receiverObjectInstructionSet . get ( ins . getOpcode ( ) ) ) { return ; } TypeDataflow typeDataflow = classContext . getTypeDataflow ( method ) ; TypeFrame frame = typeDataflow . getFactAtLocation ( location ) ; if ( frame . isValid ( ) ) { Type type = frame . getInstance ( ins , classContext . getConstantPoolGen ( ) ) ; if ( type instanceof ReferenceType ) { propertySet . setProperty ( GeneralWarningProperty . RECEIVER_OBJECT_TYPE , type . toString ( ) ) ; } } } catch ( DataflowAnalysisException e ) { // Ignore } catch ( CFGBuilderException e ) { // Ignore } }
Add a RECEIVER_OBJECT_TYPE warning property for a particular location in a method to given warning property set .