Check for private, protected, public, signals etc... and assume we are in a
        class definition. Try to find a previous private/protected/private... or
        class and return its indentation or null if not found.
179770
def tryAccessModifiers(self, block):
        

        if CFG_ACCESS_MODIFIERS < 0:
            return None

        if not re.match(r'^\s*((public|protected|private)\s*(slots|Q_SLOTS)?|(signals|Q_SIGNALS)\s*):\s*$', block.text()):
            return None

        try:
            block, notUsedColumn = self.findBracketBackward(block, 0, '{')
        except ValueError:
            return None

        indentation = self._blockIndent(block)
        for i in range(CFG_ACCESS_MODIFIERS):
            indentation = self._increaseIndent(indentation)

        dbg("tryAccessModifiers: success in line %d" % block.blockNumber())
        return indentation
572422
private ClassDescriptor getNullnessAnnotationClassDescriptor(NullnessAnnotation n) {
        if (n == NullnessAnnotation.CHECK_FOR_NULL) {
            return JSR305NullnessAnnotations.CHECK_FOR_NULL;
        } else if (n == NullnessAnnotation.NONNULL) {
            return JSR305NullnessAnnotations.NONNULL;
        } else if (n == NullnessAnnotation.NULLABLE) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else if (n == NullnessAnnotation.UNKNOWN_NULLNESS) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else {
            throw new IllegalArgumentException("Unknown NullnessAnnotation: " + n);
        }
    }
220775
private boolean hidden(ProgramElementDoc c) {
	if (c.tags("hidden").length > 0 || c.tags("view").length > 0)
	    return true;
	Options opt = optionProvider.getOptionsFor(c instanceof ClassDoc ? (ClassDoc) c : c.containingClass());
	return opt.matchesHideExpression(c.toString()) //
		|| (opt.hidePrivateInner && c instanceof ClassDoc  && c.isPrivate() && ((ClassDoc) c).containingClass() != null);
    }
814259
def _in_class(self, node):
        """"""
        # Move left one indentation level and check if that callable is a class
        indent = self._get_indent(node)
        for indent_dict in reversed(self._indent_stack):  # pragma: no branch
            if (indent_dict["level"] < indent) or (indent_dict["type"] == "module"):
                return indent_dict["type"] == "class"
1178233
function checkPseudoClass2(i) {
  const start = i;
  let l;

  // Skip `:`.
  i++;

  if (i >= tokensLength) return 0;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  if (i >= tokensLength ||
      tokens[i].type !== TokenType.LeftParenthesis) return 0;

  const right = tokens[i].right;

  // Skip `(`.
  i++;

  if (l = checkSC(i)) i += l;

  if (l = checkIdentOrInterpolation(i)) i += l;
  else return 0;

  if (l = checkSC(i)) i += l;

  if (i !== right) return 0;

  // Skip `)`.
  i++;

  return i - start;
}
513733
function check(node) {
    var initial = start(node).offset
    var final = end(node).offset

    if (generated(node)) {
      return null
    }

    return node.lang || /^\s*([~`])\1{2,}/.test(contents.slice(initial, final))
      ? 'fenced'
      : 'indented'
  }
394595
private function _checkCurrentLocks()
    {
        foreach ($this->_classHierarchy as $classInfo) {
            // FATAL: If any part of our class hierarchy is already locked ("is
            // being compiled right now", higher up the call stack), then it's a
            // bad map with circular "import"-statements.
            // NOTE: This specifically protects against the dangerous scenario
            // of importing classes derived from our hierarchy but whose
            // classname isn't in the current class hierarchy, so they weren't
            // blocked by the "import-target sanity checks". So when they get
            // to their own sub-compilation, their class hierarchy is checked
            // here and we'll discover their circular inheritance.
            if (isset($this->_propertyMapCache->compilerLocks[$classInfo['className']])) {
                // NOTE: strictClassName goes in "arg1" because it's being
                // compiled earlier than us, so we're definitely the "arg2".
                throw new CircularPropertyMapException(
                    $classInfo['strictClassName'],
                    $this->_strictSolveClassName
                );
            }
        }
    }
1287959
private void checkTokenized() {
        if (tokens == null) {
            if (chars == null) {
                // still call tokenize as subclass may do some work
                final List<String> split = tokenize(null, 0, 0);
                tokens = split.toArray(new String[split.size()]);
            } else {
                final List<String> split = tokenize(chars, 0, chars.length);
                tokens = split.toArray(new String[split.size()]);
            }
        }
    }
367825
private void checkOrMarkPrivateAccess(Expression source, FieldNode fn) {
        if (fn!=null && Modifier.isPrivate(fn.getModifiers()) &&
            (fn.getDeclaringClass() != typeCheckingContext.getEnclosingClassNode() || typeCheckingContext.getEnclosingClosure()!=null) &&
            fn.getDeclaringClass().getModule() == typeCheckingContext.getEnclosingClassNode().getModule()) {
            addPrivateFieldOrMethodAccess(source, fn.getDeclaringClass(), StaticTypesMarker.PV_FIELDS_ACCESS, fn);
        }
    }
716879
@Nullable
    private static Method findStaticInitializer(JavaClass cls) {
        Method[] methods = cls.getMethods();
        for (Method m : methods) {
            if (Values.STATIC_INITIALIZER.equals(m.getName())) {
                return m;
            }
        }

        return null;
    }
51699
@Deprecated
    public static @CheckForNull
    JavaClassAndMethod findConcreteMethod(JavaClass javaClass, String methodName, String methodSig) {

        if (DEBUG_METHOD_LOOKUP) {
            System.out.println("Check " + javaClass.getClassName());
        }
        Method[] methodList = javaClass.getMethods();
        for (Method method : methodList) {
            if (method.getName().equals(methodName) && method.getSignature().equals(methodSig)
                    && accessFlagsAreConcrete(method.getAccessFlags())) {
                JavaClassAndMethod m = new JavaClassAndMethod(javaClass, method);

                return m;

            }
        }
        if (DEBUG_METHOD_LOOKUP) {
            System.out.println("\t==> NOT FOUND");
        }
        return null;
    }
351083
public boolean checkAccess(AccessFlags flags){

        boolean isPublic = flags.is(AccessFlags.ACC_PUBLIC);
        boolean isProtected = flags.is(AccessFlags.ACC_PROTECTED);
        boolean isPrivate = flags.is(AccessFlags.ACC_PRIVATE);
        boolean isPackage = !(isPublic || isProtected || isPrivate);

        if ((showAccess == AccessFlags.ACC_PUBLIC) && (isProtected || isPrivate || isPackage))
            return false;
        else if ((showAccess == AccessFlags.ACC_PROTECTED) && (isPrivate || isPackage))
            return false;
        else if ((showAccess == 0) && (isPrivate))
            return false;
        else
            return true;
    }
215650
function checkTypes(classes) {
    var classCount = 0, nullType = 0, nullOf = 0, propCount = 0;
    for (var classKey in classes) {
        ++classCount;
        for (var definePropertyKey in classes[classKey].amorphicProperties) {
            var defineProperty = classes[classKey].amorphicProperties[definePropertyKey];
            if (!defineProperty.type) {
                ++nullType;
                console.log('Warning: ' + classKey + '.' + definePropertyKey + ' has no type');
            }
            if (defineProperty instanceof Array && !defineProperty.of) {
                console.log('Warning: ' + classKey + '.' + definePropertyKey + ' has no of');
                ++nullOf
            }
            ++propCount;
        }
    }
    console.log(classCount + ' classes loaded with ' + propCount + ' properties (' + nullType + ' null types, ' + nullOf + ' null ofs)');
}
474397
public final void classDeclaration() throws RecognitionException {
		int classDeclaration_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 6) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:294:5: ( normalClassDeclaration | enumDeclaration )
			int alt11=2;
			int LA11_0 = input.LA(1);
			if ( (LA11_0==72) ) {
				alt11=1;
			}
			else if ( (LA11_0==ENUM) ) {
				alt11=2;
			}

			else {
				if (state.backtracking>0) {state.failed=true; return;}
				NoViableAltException nvae =
					new NoViableAltException("", 11, 0, input);
				throw nvae;
			}

			switch (alt11) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:294:7: normalClassDeclaration
					{
					pushFollow(FOLLOW_normalClassDeclaration_in_classDeclaration244);
					normalClassDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:295:9: enumDeclaration
					{
					pushFollow(FOLLOW_enumDeclaration_in_classDeclaration254);
					enumDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;

			}
		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 6, classDeclaration_StartIndex); }

		}
	}
814307
@Nullable
    private static Method findMethod(JavaClass cls, String methodName, String methodSig) {
        Method[] methods = cls.getMethods();
        for (Method method : methods) {
            if (method.getName().equals(methodName) && method.getSignature().equals(methodSig)) {
                return method;
            }
        }
        return null;
    }
158827
private static boolean isGosuClassAccessingProtectedOrInternalMethodOfClassInDifferentClassloader( ICompilableTypeInternal callingClass, IType declaringClass, IRelativeTypeInfo.Accessibility accessibility )
  {
    return (accessibility != IRelativeTypeInfo.Accessibility.PUBLIC ||
            AccessibilityUtil.forType( declaringClass ) == IRelativeTypeInfo.Accessibility.INTERNAL ||
            AccessibilityUtil.forType( declaringClass ) == IRelativeTypeInfo.Accessibility.PRIVATE)
           && getTopLevelNamespace( callingClass ).equals( getTopLevelNamespace( declaringClass ) )
           && (isInSeparateClassLoader( callingClass, declaringClass ) ||
               classesLoadInSeparateLoader( callingClass, declaringClass ));

  }
1004139
private Method isSelfCall(InvokeInstruction inv) {
        ConstantPoolGen cpg = classContext.getConstantPoolGen();
        JavaClass jclass = classContext.getJavaClass();

        String calledClassName = inv.getClassName(cpg);

        // FIXME: is it possible we would see a superclass name here?
        // Not a big deal for now, as we are mostly just interested in calls
        // to private methods, for which we will definitely see the right
        // called class name.
        if (!calledClassName.equals(jclass.getClassName())) {
            return null;
        }

        String calledMethodName = inv.getMethodName(cpg);
        String calledMethodSignature = inv.getSignature(cpg);
        boolean isStaticCall = (inv instanceof INVOKESTATIC);

        // Scan methods for one that matches.
        Method[] methods = jclass.getMethods();
        for (Method method : methods) {
            String methodName = method.getName();
            String signature = method.getSignature();
            boolean isStatic = method.isStatic();

            if (methodName.equals(calledMethodName) && signature.equals(calledMethodSignature) && isStatic == isStaticCall) {
                // This method looks like a match.
                return wantCallsFor(method) ? method : null;
            }
        }

        // Hmm...no matching method found.
        // This is almost certainly because the named method
        // was inherited from a superclass.
        LOG.debug("No method found for {}.{} : {}", calledClassName, calledMethodName, calledMethodSignature);
        return null;
    }