Examples of XField


Examples of edu.umd.cs.findbugs.ba.XField

    public void addFieldAnnotation(String cName, String mName, String mSig, boolean isStatic, NullnessAnnotation annotation) {
        if (DEBUG) {
            System.out.println("addFieldAnnotation: annotate " + cName + "." + mName + " with " + annotation);
        }

        XField xfield = XFactory.createXField(cName, mName, mSig, isStatic);
        if (!(xfield instanceof FieldInfo)) {
            if (DEBUG) {
                System.out.println("  Field not found! " + cName + "." + mName + ":" + mSig + " " + isStatic + " " + annotation);
            }
            return;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

        }
    }

    private void modelFieldStore(Location location) throws DataflowAnalysisException {
        // Model field stores
        XField writtenField = XFactory.createXField((FieldInstruction) location.getHandle().getInstruction(), cpg);
        TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(writtenField,
                typeQualifierValue);
        When when = (tqa != null) ? tqa.when : When.UNKNOWN;

        // The ValueNumberFrame *before* the FieldInstruction should
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

            throws DataflowAnalysisException {
        INullnessAnnotationDatabase database = AnalysisContext.currentAnalysisContext().getNullnessAnnotationDatabase();

        FieldInstruction fieldIns = (FieldInstruction) location.getHandle().getInstruction();

        XField field = XFactory.createXField(fieldIns, methodGen.getConstantPool());
        char firstChar = field.getSignature().charAt(0);
        if (firstChar != 'L' && firstChar != '[') {
            return;
        }
        NullnessAnnotation resolvedAnnotation = database.getResolvedAnnotation(field, true);
        if (resolvedAnnotation == NullnessAnnotation.NONNULL) {
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

    private void handleInstruction(InstructionHandle handle, BasicBlock basicBlock, FieldSet fact)
    {
        Instruction ins = handle.getInstruction();
        short opcode = ins.getOpcode();
        XField field;

        switch (opcode) {
        case Constants.GETFIELD:
        case Constants.GETSTATIC:
            field = lookupField(handle, (FieldInstruction) ins);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

            break;
        }
    }

    private @CheckForNull XField lookupField(InstructionHandle handle, FieldInstruction fins) {
        XField field = instructionToFieldMap.get(handle);
        if (field == null) {
            field = Hierarchy.findXField(fins, getCPG());
            instructionToFieldMap.put(handle, field);
        }
        return field;
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

            return;
        }
        FieldSummary fieldSummary = AnalysisContext.currentAnalysisContext().getFieldSummary();
        HashSet<AvailableLoad> killMe = new HashSet<AvailableLoad>();
        for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
            XField field = availableLoad.getField();
            if (field.isVolatile() || !field.isFinal()
                    && (!USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR || fieldSummary.isWrittenOutsideOfConstructor(field))) {
                if (RLE_DEBUG) {
                    System.out.println("KILLING load of " + availableLoad + " in " + this);
                }
                killMe.add(availableLoad);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

        HashSet<AvailableLoad> killMe = new HashSet<AvailableLoad>();
        for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {
            if (availableLoad.getReference() != v) {
                continue;
            }
            XField field = availableLoad.getField();
            if (!field.isFinal() && (!USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR || fieldSummary.isWrittenOutsideOfConstructor(field))) {
                if (RLE_DEBUG) {
                    System.out.println("Killing load of " + availableLoad + " in " + this);
                }
                killMe.add(availableLoad);
            }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

        String packageName = extractPackageName(className);

        HashSet<AvailableLoad> killMe = new HashSet<AvailableLoad>();
        for (AvailableLoad availableLoad : getAvailableLoadMap().keySet()) {

            XField field = availableLoad.getField();
            String fieldPackageName = extractPackageName(field.getClassName());
            if (packageName.equals(fieldPackageName) && field.isStatic()
                    && methodName.toLowerCase().indexOf(field.getName().toLowerCase()) >= 0) {
                killMe.add(availableLoad);
            }

        }
        killAvailableLoads(killMe);
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

            registerTopOfStackSource(SourceSinkType.RETURN_VALUE_OF_CALLED_METHOD, location, when, interproc, null);
        }
    }

    private void registerFieldLoadSource(Location location) throws DataflowAnalysisException {
        XField loadedField = XFactory.createXField((FieldInstruction) location.getHandle().getInstruction(), cpg);
        if (loadedField.isResolved()) {
            TypeQualifierAnnotation tqa = TypeQualifierApplications.getEffectiveTypeQualifierAnnotation(loadedField,
                    typeQualifierValue);
            When when = (tqa != null) ? tqa.when : When.UNKNOWN;
            registerTopOfStackSource(SourceSinkType.FIELD_LOAD, location, when, false, null);
        }
View Full Code Here

Examples of edu.umd.cs.findbugs.ba.XField

    private boolean doRedundantLoadElimination() {
        if (!REDUNDANT_LOAD_ELIMINATION) {
            return false;
        }

        XField xfield = loadedFieldSet.getField(handle);
        if (xfield == null) {
            return false;
        }

        if (!xfield.isReferenceType()) {
            return false;
        }

        // Don't do redundant load elimination for fields that
        // are loaded in only one place.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.