overrides the visitor to check for classes that implement Cloneable.

@param classContext
the context object that holds the JavaClass being parsed
512733
@Override
    public void visitClassContext(ClassContext classContext) {

        if (cloneClass == null) {
            return;
        }

        try {
            cls = classContext.getJavaClass();
            if (cls.implementationOf(cloneClass)) {
                clsName = cls.getClassName();
                stack = new OpcodeStack();
                super.visitClassContext(classContext);
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            cls = null;
            stack = null;
        }
    }
946952
@Override
	public void visitClassContext(ClassContext classContext) {
		JavaClass cls = classContext.getJavaClass();
		fieldStatus = FieldStatus.NONE;

		String packageName = cls.getPackageName();
		if (packageName.isEmpty()) {
			bugReporter.reportBug(
					new BugInstance(this, BugType.IMC_IMMATURE_CLASS_NO_PACKAGE.name(), LOW_PRIORITY).addClass(cls));
		}

		if (!packageName.equals(packageName.toLowerCase(Locale.ENGLISH))) {
			bugReporter.reportBug(
					new BugInstance(this, BugType.IMC_IMMATURE_CLASS_UPPER_PACKAGE.name(), LOW_PRIORITY).addClass(cls));
		}

		String simpleClassName = cls.getClassName();
		int dotPos = simpleClassName.lastIndexOf('.');
		if (dotPos >= 0) {
			simpleClassName = simpleClassName.substring(dotPos + 1);
		}
		if (!Character.isUpperCase(simpleClassName.charAt(0))
				&& (simpleClassName.indexOf(Values.INNER_CLASS_SEPARATOR) < 0)
				&& !PACKAGE_INFO.equals(simpleClassName)) {
			bugReporter.reportBug(
					new BugInstance(this, BugType.IMC_IMMATURE_CLASS_LOWER_CLASS.name(), LOW_PRIORITY).addClass(cls));
		}

		if ((!cls.isAbstract()) && (!cls.isEnum()) && (cls.getClassName().indexOf(Values.INNER_CLASS_SEPARATOR) < 0)
				&& !isTestClass(cls)) {

			try {
				boolean clsHasRuntimeAnnotation = classHasRuntimeVisibleAnnotation(cls);
				if (clsHasRuntimeAnnotation) {
					classIsJPAEntity = classIsJPAEntity(cls);
				} else {
					classIsJPAEntity = false;
				}
				HEStatus heStatus = HEStatus.UNKNOWN;

				checkIDEGeneratedParmNames(cls);

				for (Field f : cls.getFields()) {
					if (!f.isStatic() && !f.isSynthetic()) {

						boolean fieldHasRuntimeAnnotation = fieldHasRuntimeVisibleAnnotation(f);
						if (!fieldHasRuntimeAnnotation) {
							/* only report one of these, so as not to flood the report */
							if (!classIsJPAEntity && !hasMethodInHierarchy(cls, Values.TOSTRING,
									SignatureBuilder.SIG_VOID_TO_STRING)) {
								bugReporter.reportBug(new BugInstance(this,
										BugType.IMC_IMMATURE_CLASS_NO_TOSTRING.name(), LOW_PRIORITY).addClass(cls));
								heStatus = HEStatus.NOT_NEEDED;
								break;
							}
							if (heStatus != HEStatus.NOT_NEEDED) {
								String fieldSig = f.getSignature();
								if (fieldSig.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX)) {
									if (!fieldSig.startsWith("Ljava")) {
										JavaClass fieldClass = Repository
												.lookupClass(SignatureUtils.trimSignature(fieldSig));
										if (!hasMethodInHierarchy(fieldClass, "equals",
												SignatureBuilder.SIG_OBJECT_TO_BOOLEAN)) {
											heStatus = HEStatus.NOT_NEEDED;
										}
									} else if (!fieldSig.startsWith("Ljava/lang/")
											&& !fieldSig.startsWith("Ljava/util/")) {
										heStatus = HEStatus.NOT_NEEDED;
									}
								} else if (!fieldSig.startsWith(Values.SIG_ARRAY_PREFIX)) {
									heStatus = HEStatus.NEEDED;
								}
							}
						} else {
							heStatus = HEStatus.NOT_NEEDED;
						}
					}
				}

				if (!clsHasRuntimeAnnotation && (heStatus == HEStatus.NEEDED)) {
					if (!hasMethodInHierarchy(cls, "equals", SignatureBuilder.SIG_OBJECT_TO_BOOLEAN)) {
						bugReporter.reportBug(
								new BugInstance(this, BugType.IMC_IMMATURE_CLASS_NO_EQUALS.name(), LOW_PRIORITY)
										.addClass(cls));
					} else if (!hasMethodInHierarchy(cls, Values.HASHCODE, SignatureBuilder.SIG_VOID_TO_INT)) {
						bugReporter.reportBug(
								new BugInstance(this, BugType.IMC_IMMATURE_CLASS_NO_HASHCODE.name(), LOW_PRIORITY)
										.addClass(cls));
					}
				}

			} catch (ClassNotFoundException cnfe) {
				bugReporter.reportMissingClass(cnfe);
			}
		}

		super.visitClassContext(classContext);
	}
414271
@Override
    public void visitClassContext(ClassContext classContext) {
        JavaClass jclass = classContext.getJavaClass();

        // We can ignore classes that were compiled for anything
        // less than JDK 1.5. This should avoid lots of unnecessary work
        // when analyzing code for older VM targets.
        if (BCELUtil.preTiger(jclass)) {
            return;
        }

        boolean sawUtilConcurrentLocks = false;
        for (Constant c : jclass.getConstantPool().getConstantPool()) {
            if (c instanceof ConstantMethodref) {
                ConstantMethodref m = (ConstantMethodref) c;
                ConstantClass cl = (ConstantClass) jclass.getConstantPool().getConstant(m.getClassIndex());
                ConstantUtf8 name = (ConstantUtf8) jclass.getConstantPool().getConstant(cl.getNameIndex());
                String nameAsString = name.getBytes();
                if (nameAsString.startsWith("java/util/concurrent/locks")) {
                    sawUtilConcurrentLocks = true;
                }

            }
        }
        if (sawUtilConcurrentLocks) {
            super.visitClassContext(classContext);
        }
    }
499333
@Override
    public void visitClassContext(ClassContext classContext) {
        // TODO: Look at method calls in a finally block to see if they throw
        // exceptions
        // : and those exceptions are not caught in the finally block
        // : Only do it if effort is on, ie: boolean fullAnalysis =
        // AnalysisContext.currentAnalysisContext().getBoolProperty(FindBugsAnalysisFeatures.INTERPROCEDURAL_ANALYSIS_OF_REFERENCED_CLASSES);

        try {
            int majorVersion = classContext.getJavaClass().getMajor();
            if (majorVersion >= Const.MAJOR_1_4) {
                fbInfo = new ArrayList<>();
                super.visitClassContext(classContext);
            }
        } finally {
            fbInfo = null;
        }
    }
823408
@Override
    public void visitClassContext(ClassContext classContext) {
        int majorVersion = classContext.getJavaClass().getMajor();
        if (majorVersion >= Const.MAJOR_1_5 && hasInterestingMethod(classContext.getJavaClass().getConstantPool(), methods)) {
            super.visitClassContext(classContext);
        }
    }
690236
private void addConstructorsForBeanWithPrivateConstructors(ClassFile proxyClassType) {
        ClassMethod ctor = proxyClassType.addMethod(AccessFlag.PUBLIC, INIT_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_BYTE);
        CodeAttribute b = ctor.getCodeAttribute();
        b.aload(0);
        b.aconstNull();
        b.aconstNull();
        b.invokespecial(proxyClassType.getName(), INIT_METHOD_NAME, "(" + LJAVA_LANG_BYTE + LJAVA_LANG_BYTE + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR);
        b.returnInstruction();

        ctor = proxyClassType.addMethod(AccessFlag.PUBLIC, INIT_METHOD_NAME, BytecodeUtils.VOID_CLASS_DESCRIPTOR, LJAVA_LANG_BYTE, LJAVA_LANG_BYTE);
        b = ctor.getCodeAttribute();
        b.aload(0);
        b.aconstNull();
        b.invokespecial(proxyClassType.getName(), INIT_METHOD_NAME, "(" + LJAVA_LANG_BYTE + ")" + BytecodeUtils.VOID_CLASS_DESCRIPTOR);
        b.returnInstruction();
    }
880737
@Override
    public void visitClassContext(final ClassContext context) {
        try {
            classContext = context;
            classContext.getJavaClass().accept(this);
        } finally {
            classContext = null;
        }
    }
45796
@Override
    public boolean isCustomizableBean(Class<?> clazz, Object context) {
        if (context == null) {
            return false;
        }
        @SuppressWarnings("unchecked")
        Map<Class<?>, ManagedObject<?>> newContext = (Map<Class<?>, ManagedObject<?>>) (context);
        if (newContext.isEmpty()) {
            return false;
        }
        if (newContext.containsKey(clazz)) {
            return true;
        }
        return false;
    }
143141
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            JavaClass cls = classContext.getJavaClass();

            if (cls.isAbstract() || cls.isInterface()) {
                return;
            }

            if (Values.DOTTED_JAVA_LANG_OBJECT.equals(cls.getSuperclassName())) {
                return;
            }

            JavaClass[] infs = cls.getInterfaces();
            if (infs.length > 0) {
                Set<QMethod> clsMethods = buildMethodSet(cls);
                for (JavaClass inf : infs) {
                    Set<QMethod> infMethods = buildMethodSet(inf);
                    if (!infMethods.isEmpty()) {
                        infMethods.removeAll(clsMethods);

                        if (!infMethods.isEmpty()) {
                            JavaClass superCls = cls.getSuperClass();
                            filterSuperInterfaceMethods(inf, infMethods, superCls);
                            if (!infMethods.isEmpty() && !superCls.implementationOf(inf)) {
                                int priority = AnalysisContext.currentAnalysisContext().isApplicationClass(superCls) ? NORMAL_PRIORITY : LOW_PRIORITY;
                                BugInstance bi = new BugInstance(this, BugType.SCII_SPOILED_CHILD_INTERFACE_IMPLEMENTOR.name(), priority).addClass(cls)
                                        .addString("Implementing interface: " + inf.getClassName()).addString("Methods:");
                                for (QMethod methodInfo : infMethods) {
                                    bi.addString('\t' + methodInfo.toString());
                                }

                                bugReporter.reportBug(bi);
                                return;
                            }
                        }
                    }
                }
            }

        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        }
    }
820259
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            refClasses = new HashSet<>();
            refClasses.add(classContext.getJavaClass().getClassName());
            state = State.COLLECT;
            super.visitClassContext(classContext);
            state = State.SEEN_NOTHING;
            super.visitClassContext(classContext);
        } finally {
            refClasses = null;
        }
    }
1226306
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            currentClass = classContext.getJavaClass();
            stack = new OpcodeStack();
            returnTypes = new HashMap<>();
            super.visitClassContext(classContext);
        } finally {
            currentClass = null;
            stack = null;
            returnTypes = null;
        }
    }
228851
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            stack = new OpcodeStack();
            possibleForLoops = new HashSet<>();
            super.visitClassContext(classContext);
        } finally {
            stack = null;
            possibleForLoops = null;
        }
    }
35832
@Override
    public void visitClass(ClassDescriptor classDescriptor) throws CheckedAnalysisException {
        IAnalysisCache analysisCache = Global.getAnalysisCache();

        JavaClass jclass = analysisCache.getClassAnalysis(JavaClass.class, classDescriptor);
        classContext = analysisCache.getClassAnalysis(ClassContext.class, classDescriptor);

        for (Method m : classContext.getMethodsInCallOrder()) {
            if (m.getCode() == null) {
                continue;
            }
            method = m;

            MethodDescriptor methodDescriptor = BCELUtil.getMethodDescriptor(jclass, method);

            // Try to get MethodGen. If we can't get one,
            // then this method should be skipped.
            MethodGen methodGen = analysisCache.getMethodAnalysis(MethodGen.class, methodDescriptor);
            if (methodGen == null) {
                continue;
            }

            CFG cfg = analysisCache.getMethodAnalysis(CFG.class, methodDescriptor);
            visitMethodCFG(methodDescriptor, cfg);
        }
    }
10700
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            JavaClass cls = classContext.getJavaClass();
            for (CompareSpec entry : compareClasses) {
                if (cls.implementationOf(entry.getCompareClass())) {
                    methodInfo = entry.getMethodInfo();
                    stack = new OpcodeStack();
                    super.visitClassContext(classContext);
                    break;
                }
            }
        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            methodInfo = null;
            stack = null;
        }
    }
1126731
@Override
	public void visitClassContext(ClassContext classContext) {
		try {
			javaClass = classContext.getJavaClass();
			if (javaClass.getMajor() >= Const.MAJOR_1_5) {
				javaClass.accept(this);
			}
		} finally {
			javaClass = null;
		}
	}
909107
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            JavaClass cls = classContext.getJavaClass();
            JavaClass[] superClasses = cls.getSuperClasses();
            for (JavaClass superCls : superClasses) {
                if (tagClasses.contains(superCls.getClassName())) {
                    attributes = getAttributes(cls);

                    if (!attributes.isEmpty()) {
                        methodWrites = new HashMap<>();
                        fieldAnnotations = new HashMap<>();
                        super.visitClassContext(classContext);
                        reportBugs();
                    }
                    break;
                }
            }

        } catch (ClassNotFoundException cnfe) {
            bugReporter.reportMissingClass(cnfe);
        } finally {
            attributes = null;
            methodWrites = null;
            fieldAnnotations = null;
        }
    }
353278
@Override
    public void visitClassContext(ClassContext classContext) {
        try {
            JavaClass cls = classContext.getJavaClass();
            if (cls.getMajor() >= Const.MAJOR_1_5) {
                stack = new OpcodeStack();
                checkedFields = new HashSet<>();
                enumRegs = new HashMap<>();
                enumFields = new HashMap<>();
                super.visitClassContext(classContext);
            }
        } finally {
            stack = null;
            checkedFields = null;
            enumRegs = null;
            enumFields = null;
        }
    }