<commit_before>/**
 * @author ven
 */
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package typedef

import api.base.{ScFieldId, ScPrimaryConstructor}
import api.statements.params.ScClassParameter
import com.intellij.psi.scope.{PsiScopeProcessor, ElementClassHint}
import com.intellij.psi._
import com.intellij.psi.search.GlobalSearchScope
import impl.light.LightMethod
import types._
import api.toplevel.typedef._
import api.statements._
import nonvalue.Parameter
import result.{Failure, TypingContext}
import types.PhysicalSignature
import com.intellij.openapi.util.Key
import fake.FakePsiMethod
import api.toplevel.ScTypedDefinition
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.text.StringUtil
import util._
import lang.resolve.processor.BaseProcessor
import synthetic.ScSyntheticClass
import lang.resolve.ResolveUtils

object TypeDefinitionMembers {
  def isAccessible(place: Option[PsiElement], member: PsiMember): Boolean = {
    if (place == None) return true
    ResolveUtils.isAccessible(member, place.get)
  }

  def isAbstract(s: PhysicalSignature) = s.method match {
    case _: ScFunctionDeclaration => true
    case m if m.hasModifierProperty(PsiModifier.ABSTRACT) => true
    case _ => false
  }

  object MethodNodes extends MixinNodes {
    type T = PhysicalSignature

    def equiv(s1: PhysicalSignature, s2: PhysicalSignature) = s1 equiv s2

    def computeHashCode(s: PhysicalSignature) = s.name.hashCode

    def isAbstract(s: PhysicalSignature) = TypeDefinitionMembers.this.isAbstract(s)

    def processJava(clazz: PsiClass, subst: ScSubstitutor, map: Map, place: Option[PsiElement]) =
      for (method <- clazz.getMethods if (isAccessible(place, method) &&
              !method.isConstructor && !method.hasModifierProperty("static"))) {
        val sig = new PhysicalSignature(method, subst)
        map += ((sig, new Node(sig, subst)))
      }

    def processSyntheticScala(clazz: ScSyntheticClass, subst: ScSubstitutor, map: Map) {
      clazz.getName match {
        case "Any" => {
          val project = clazz.getProject
          val facade = JavaPsiFacade.getInstance(project)
          val obj = facade.findClass("java.lang.Object", GlobalSearchScope.allScope(project))
          if (obj != null) {
            for (m <- obj.getMethods if !m.isConstructor) {
              val sig = new PhysicalSignature(m, subst)
              map += ((sig, new Node(sig, subst)))
            }
          }
        }
        case _ =>
      }
    }

    def processScala(template: ScTemplateDefinition, subst: ScSubstitutor, map: Map, place: Option[PsiElement]) =
      for (member <- template.members) {
        member match {
          /*case primary: ScPrimaryConstructor if !noPrivates => {
            val sig = new PhysicalSignature(primary, subst)
            map += ((sig, new Node(sig, subst)))
          }*/
          case method: ScFunction if isAccessible(place, method) &&
                  !method.isConstructor => {<commit_msg>SCL-2609 - registerNatives removed from inheritance.<commit_after>/**
 * @author ven
 */
package org.jetbrains.plugins.scala
package lang
package psi
package impl
package toplevel
package typedef

import api.base.{ScFieldId, ScPrimaryConstructor}
import api.statements.params.ScClassParameter
import com.intellij.psi.scope.{PsiScopeProcessor, ElementClassHint}
import com.intellij.psi._
import com.intellij.psi.search.GlobalSearchScope
import impl.light.LightMethod
import types._
import api.toplevel.typedef._
import api.statements._
import nonvalue.Parameter
import result.{Failure, TypingContext}
import types.PhysicalSignature
import com.intellij.openapi.util.Key
import fake.FakePsiMethod
import api.toplevel.ScTypedDefinition
import com.intellij.openapi.progress.ProgressManager
import com.intellij.openapi.util.text.StringUtil
import util._
import lang.resolve.processor.BaseProcessor
import synthetic.ScSyntheticClass
import lang.resolve.ResolveUtils

object TypeDefinitionMembers {
  def isAccessible(place: Option[PsiElement], member: PsiMember): Boolean = {
    if (place == None) return true
    ResolveUtils.isAccessible(member, place.get)
  }

  def isAbstract(s: PhysicalSignature) = s.method match {
    case _: ScFunctionDeclaration => true
    case m if m.hasModifierProperty(PsiModifier.ABSTRACT) => true
    case _ => false
  }

  object MethodNodes extends MixinNodes {
    type T = PhysicalSignature

    def equiv(s1: PhysicalSignature, s2: PhysicalSignature) = s1 equiv s2

    def computeHashCode(s: PhysicalSignature) = s.name.hashCode

    def isAbstract(s: PhysicalSignature) = TypeDefinitionMembers.this.isAbstract(s)

    def processJava(clazz: PsiClass, subst: ScSubstitutor, map: Map, place: Option[PsiElement]) =
      for (method <- clazz.getMethods if (isAccessible(place, method) &&
              !method.isConstructor && !method.hasModifierProperty("static"))) {
        val sig = new PhysicalSignature(method, subst)
        map += ((sig, new Node(sig, subst)))
      }

    def processSyntheticScala(clazz: ScSyntheticClass, subst: ScSubstitutor, map: Map) {
      clazz.getName match {
        case "Any" => {
          val project = clazz.getProject
          val facade = JavaPsiFacade.getInstance(project)
          val obj = facade.findClass("java.lang.Object", GlobalSearchScope.allScope(project))
          if (obj != null) {
            for (m <- obj.getMethods if !m.isConstructor && !m.hasModifierProperty("static")) {
              val sig = new PhysicalSignature(m, subst)
              map += ((sig, new Node(sig, subst)))
            }
          }
        }
        case _ =>
      }
    }

    def processScala(template: ScTemplateDefinition, subst: ScSubstitutor, map: Map, place: Option[PsiElement]) =
      for (member <- template.members) {
        member match {
          /*case primary: ScPrimaryConstructor if !noPrivates => {
            val sig = new PhysicalSignature(primary, subst)
            map += ((sig, new Node(sig, subst)))
          }*/
          case method: ScFunction if isAccessible(place, method) &&
                  !method.isConstructor => {
{'fraction_non_alphanumeric': 0.10027539283978616, 'fraction_numerical': 0.00194394945731411, 'mean_word_length': 3.3849431818181817, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6545776', 'n_tokens_mistral': 1784, 'n_tokens_neox': 1755, 'n_words': 437}