void () { UClass uClass = getUastElement(); if (uClass != null) { final PsiElement classSourcePsi = uClass.getSourcePsi(); final RefJavaUtil refUtil = RefJavaUtil.getInstance(); if (uClass instanceof UAnonymousClass) { UObjectLiteralExpression objectAccess = UastUtils.getParentOfType(uClass, UObjectLiteralExpression.class); if (objectAccess != null && objectAccess.getDeclaration().getSourcePsi() == classSourcePsi) { refUtil.addReferencesTo(uClass, this, objectAccess.getValueArguments().toArray(UElementKt.EMPTY_ARRAY)); } } for (UClassInitializer classInitializer : uClass.getInitializers()) { refUtil.addReferencesTo(uClass, this, classInitializer.getUastBody()); } refUtil.addReferencesTo(uClass, this, uClass.getUAnnotations().toArray(UElementKt.EMPTY_ARRAY)); for (PsiTypeParameter parameter : uClass.getJavaPsi().getTypeParameters()) { UElement uTypeParameter = UastContextKt.toUElement(parameter); if (uTypeParameter != null) { refUtil.addReferencesTo(uClass, this, uTypeParameter); } } final RefMethodImpl defaultConstructor = (RefMethodImpl)getDefaultConstructor(); if (defaultConstructor != null) { for (RefClass superClass : getBaseClasses()) { superClass.initializeIfNeeded(); WritableRefElement superDefaultConstructor = (WritableRefElement)superClass.getDefaultConstructor(); if (superDefaultConstructor != null) { superDefaultConstructor.addInReference(defaultConstructor); defaultConstructor.addOutReference(superDefaultConstructor); } } } UMethod[] uMethods = uClass.getMethods(); for (UMethod uMethod : uMethods) { if (uMethod.getSourcePsi() == classSourcePsi) { // Kotlin implicit constructor refUtil.addReferencesTo(uClass, this, uMethod.getUastBody()); } } refUtil.addReferencesTo(uClass, this, uClass.getUastSuperTypes().toArray(UElementKt.EMPTY_ARRAY)); } }