/** * implements the visitor to record storing of fields, and where they occur * * @param seen * the currently parsed opcode */ @Override public void sawOpcode(int seen) { if (seen == Const.PUTFIELD) { QMethod methodInfo = new QMethod(getMethodName(), getMethodSig()); Map<Map.Entry<String, String>, SourceLineAnnotation> fields = methodWrites.get(methodInfo); if (fields == null) { fields = new HashMap<>(); methodWrites.put(methodInfo, fields); } String fieldName = getNameConstantOperand(); String fieldSig = getSigConstantOperand(); FieldAnnotation fa = new FieldAnnotation(getDottedClassName(), fieldName, fieldSig, false); fieldAnnotations.put(fieldName, fa); fields.put(new AbstractMap.SimpleImmutableEntry(fieldName, fieldSig), SourceLineAnnotation.fromVisitedInstruction(this)); } }
/** * implements the visitor to * * @param obj * the context object for the currently parsed code object */ @Override public void visitCode(Code obj) { Method m = getMethod(); if (!Values.CONSTRUCTOR.equals(m.getName())) { super.visitCode(obj); } }
for (JavaClass superCls : superClasses) { if (tagClasses.contains(superCls.getClassName())) { attributes = getAttributes(cls); fieldAnnotations = new HashMap<>(); super.visitClassContext(classContext); reportBugs();
for (JavaClass superCls : superClasses) { if (tagClasses.contains(superCls.getClassName())) { attributes = getAttributes(cls); fieldAnnotations = new HashMap<>(); super.visitClassContext(classContext); reportBugs();
/** * implements the visitor to record storing of fields, and where they occur * * @param seen * the currently parsed opcode */ @Override public void sawOpcode(int seen) { if (seen == PUTFIELD) { QMethod methodInfo = new QMethod(getMethodName(), getMethodSig()); Map<Map.Entry<String, String>, SourceLineAnnotation> fields = methodWrites.get(methodInfo); if (fields == null) { fields = new HashMap<>(); methodWrites.put(methodInfo, fields); } String fieldName = getNameConstantOperand(); String fieldSig = getSigConstantOperand(); FieldAnnotation fa = new FieldAnnotation(getDottedClassName(), fieldName, fieldSig, false); fieldAnnotations.put(fieldName, fa); fields.put(new AbstractMap.SimpleImmutableEntry(fieldName, fieldSig), SourceLineAnnotation.fromVisitedInstruction(this)); } }
/** * implements the visitor to * * @param obj * the context object for the currently parsed code object */ @Override public void visitCode(Code obj) { Method m = getMethod(); if (!Values.CONSTRUCTOR.equals(m.getName())) { super.visitCode(obj); } }