Package edu.umd.cs.findbugs

Examples of edu.umd.cs.findbugs.FieldAnnotation


    }

    @Override
    public void visit(Field obj) {
        super.visit(obj);
        FieldAnnotation f = FieldAnnotation.fromVisitedField(this);
        declaredFields.add(f);

    }
View Full Code Here


        if (seen == PUTFIELD && getClassConstantOperand().equals(getClassName())) {
            initializedFields.add(FieldAnnotation.fromReferencedField(this));
        } else if (thisOnTOS && seen == GETFIELD && getClassConstantOperand().equals(getClassName())) {
            UnreadFieldsData unreadFields = AnalysisContext.currentAnalysisContext().getUnreadFieldsData();
            XField xField = XFactory.createReferencedXField(this);
            FieldAnnotation f = FieldAnnotation.fromReferencedField(this);
            int nextOpcode = 0xff & codeBytes[getPC() + 3];
            if (nextOpcode != POP && !initializedFields.contains(f) && declaredFields.contains(f) && !containerFields.contains(f)
                    && !unreadFields.isContainerField(xField)) {
                // System.out.println("Next opcode: " +
                // OPCODE_NAMES[nextOpcode]);
View Full Code Here

                knownNull.set(startLine);
                knownNullLocations.add(sourceLineAnnotation);
            }
        }

        FieldAnnotation storedField = null;
        MethodAnnotation invokedMethod = null;
        XMethod invokedXMethod = null;
        int parameterNumber = -1;
        if (derefLocationSet.size() == 1) {
View Full Code Here

    @Override
    public void visitField(Field obj) {
        if (obj.isProtected()) {
            bugReporter.reportBug(new BugInstance(this, "CI_CONFUSED_INHERITANCE", LOW_PRIORITY).addClass(cls).addField(
                    new FieldAnnotation(cls.getClassName(), obj.getName(), obj.getSignature(), obj.isStatic())));
        }
    }
View Full Code Here

  @SuppressWarnings("HardcodedLineSeparator")
  @SuppressFBWarnings({"HardcodedLineSeparator"})
  private static ProblemDescriptor createProblemDescriptor(final PsiFile psiFile, final BugInstance bugInstance) {
    final int[] lines = BugInstanceUtil.getSourceLines(bugInstance);
    final MethodAnnotation methodAnnotation = BugInstanceUtil.getPrimaryMethod(bugInstance);
    final FieldAnnotation fieldAnnotation = BugInstanceUtil.getPrimaryField(bugInstance);
    final StringBuilder description = new StringBuilder();

    if (lines[0] == -1) {
      description.append(BugInstanceUtil.getAbridgedMessage(bugInstance));
      description.append("\r\n");
View Full Code Here

  public void setBugsDetails(final BugInstanceNode bugInstanceNode, final TreePath treePath) {
    _currentTreePath = treePath;
    final BugInstance bugInstance = bugInstanceNode.getBugInstance();
    final int[] lines = BugInstanceUtil.getSourceLines(bugInstanceNode);
    final MethodAnnotation methodAnnotation = BugInstanceUtil.getPrimaryMethod(bugInstance);
    final FieldAnnotation fieldAnnotation = BugInstanceUtil.getPrimaryField(bugInstance);

    final StringBuilder html = new StringBuilder();
    html.append("<html><body>");
    html.append("<h2>");
    html.append(bugInstance.getAbridgedMessage());
View Full Code Here

                }
                //                String name = null;
                int reg = item.getRegisterNumber();
                Collection<BugAnnotation> as = new ArrayList<BugAnnotation>();
                XField field = item.getXField();
                FieldAnnotation fieldAnnotation = null;
                if (field != null) {
                    fieldAnnotation = FieldAnnotation.fromXField(field);
                    fieldAnnotation.setDescription(FieldAnnotation.LOADED_FROM_ROLE);
                }

                if (reg != -1) {
                    LocalVariableAnnotation lva = LocalVariableAnnotation.getLocalVariableAnnotation(getMethod(), reg, getPC(),
                            getPC() - 1);
View Full Code Here

                            alreadyReported.add(nameCons.getBytes());
                            bugReporter.reportBug(new BugInstance(this,
                                    STRUTS_ACTION_NAME.equals(mtClassName) ? "MTIA_SUSPECT_STRUTS_INSTANCE_FIELD"
                                            : "MTIA_SUSPECT_SERVLET_INSTANCE_FIELD", LOW_PRIORITY)
                            .addField(
                                    new FieldAnnotation(getDottedClassName(), nameCons.getBytes(), typeCons.getBytes(),
                                            false)).addClass(this).addSourceLine(this));
                        }
                        break;
                    }
                }
View Full Code Here

         * @return
         */
        private String getBugLocation(BugInstance b) {
            String point;
            MethodAnnotation m = b.getPrimaryMethod();
            FieldAnnotation f = b.getPrimaryField();
            if (m != null) {
                point = m.toString();
            } else if (f != null) {
                point = f.toString();
            } else {
                point = null;
            }
            return point;
        }
View Full Code Here

        }

        if (ann != null && ann.isSignificant()) {
            return ann;
        }
        FieldAnnotation field = ValueNumberSourceInfo.findFieldAnnotationFromValueNumber(method, location, valueNumber, vnaFrame);
        if (field != null) {
            if (partialRole != null) {
                field.setDescription("FIELD_" + partialRole);
            }

            return field;
        }
        if (ann != null) {
View Full Code Here

TOP

Related Classes of edu.umd.cs.findbugs.FieldAnnotation

Copyright © 2018 www.massapicom. 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.