int (PsiClass aClass) { int totalFields = 0; final PsiField[] fields = aClass.getFields(); for (final PsiField field : fields) { if (field instanceof PsiEnumConstant) { if (myCountEnumConstants) { totalFields++; } } else if (m_countConstantFields || !fieldIsConstant(field)) { totalFields++; } } return totalFields; }