Java 类com.intellij.psi.impl.source.HierarchicalMethodSignatureImpl 实例源码

项目:tools-idea    文件:PsiSuperMethodImplUtil.java   
private static void putInMap(PsiClass aClass, Map<MethodSignature, HierarchicalMethodSignature> result,
                         Map<MethodSignature, HierarchicalMethodSignatureImpl> map, HierarchicalMethodSignature hierarchicalMethodSignature,
                         MethodSignature signature) {
  if (!PsiUtil.isAccessible(hierarchicalMethodSignature.getMethod(), aClass, aClass)) return;
  HierarchicalMethodSignatureImpl existing = map.get(signature);
  if (existing == null) {
    HierarchicalMethodSignatureImpl copy = copy(hierarchicalMethodSignature);
    LOG.assertTrue(copy.getMethod().isValid());
    map.put(signature, copy);
  }
  else if (isReturnTypeIsMoreSpecificThan(hierarchicalMethodSignature, existing) && isSuperMethod(aClass, hierarchicalMethodSignature, existing)) {
    HierarchicalMethodSignatureImpl newSuper = copy(hierarchicalMethodSignature);
    mergeSupers(newSuper, existing);
    LOG.assertTrue(newSuper.getMethod().isValid());
    map.put(signature, newSuper);
  }
  else if (isSuperMethod(aClass, existing, hierarchicalMethodSignature)) {
    mergeSupers(existing, hierarchicalMethodSignature);
  }
  // just drop an invalid method declaration there - to highlight accordingly
  else if (!result.containsKey(signature)) {
    LOG.assertTrue(hierarchicalMethodSignature.getMethod().isValid());
    result.put(signature, hierarchicalMethodSignature);
  }
}
项目:intellij-ce-playground    文件:PsiSuperMethodImplUtil.java   
private static void putInMap(@NotNull PsiClass aClass,
                             @NotNull Map<MethodSignature, HierarchicalMethodSignature> result,
                             @NotNull Map<MethodSignature, HierarchicalMethodSignatureImpl> map,
                             @NotNull HierarchicalMethodSignature hierarchicalMethodSignature,
                             @NotNull MethodSignature signature) {
  if (!PsiUtil.isAccessible(aClass.getProject(), hierarchicalMethodSignature.getMethod(), aClass, aClass)) return;
  HierarchicalMethodSignatureImpl existing = map.get(signature);
  if (existing == null) {
    HierarchicalMethodSignatureImpl copy = copy(hierarchicalMethodSignature);
    LOG.assertTrue(copy.getMethod().isValid());
    map.put(signature, copy);
  }
  else if (isReturnTypeIsMoreSpecificThan(hierarchicalMethodSignature, existing) && isSuperMethod(aClass, hierarchicalMethodSignature, existing)) {
    HierarchicalMethodSignatureImpl newSuper = copy(hierarchicalMethodSignature);
    mergeSupers(newSuper, existing);
    LOG.assertTrue(newSuper.getMethod().isValid());
    map.put(signature, newSuper);
  }
  else if (isSuperMethod(aClass, existing, hierarchicalMethodSignature)) {
    mergeSupers(existing, hierarchicalMethodSignature);
  }
  // just drop an invalid method declaration there - to highlight accordingly
  else if (!result.containsKey(signature)) {
    LOG.assertTrue(hierarchicalMethodSignature.getMethod().isValid());
    result.put(signature, hierarchicalMethodSignature);
  }
}
项目:intellij-ce-playground    文件:PsiSuperMethodImplUtil.java   
@NotNull
private static HierarchicalMethodSignatureImpl copy(@NotNull HierarchicalMethodSignature hi) {
  HierarchicalMethodSignatureImpl hierarchicalMethodSignature = new HierarchicalMethodSignatureImpl(hi);
  for (HierarchicalMethodSignature his : hi.getSuperSignatures()) {
    hierarchicalMethodSignature.addSuperSignature(copy(his));
  }
  return hierarchicalMethodSignature;
}
项目:tools-idea    文件:PsiSuperMethodImplUtil.java   
private static HierarchicalMethodSignatureImpl copy(HierarchicalMethodSignature hi) {
  HierarchicalMethodSignatureImpl hierarchicalMethodSignature = new HierarchicalMethodSignatureImpl(hi);
  for (HierarchicalMethodSignature his : hi.getSuperSignatures()) {
    hierarchicalMethodSignature.addSuperSignature(copy(his));
  }
  return hierarchicalMethodSignature;
}
项目:consulo-java    文件:PsiSuperMethodImplUtil.java   
private static void putInMap(@NotNull PsiClass aClass,
        @NotNull Map<MethodSignature, HierarchicalMethodSignature> result,
        @NotNull Map<MethodSignature, HierarchicalMethodSignatureImpl> map,
        @NotNull HierarchicalMethodSignature hierarchicalMethodSignature,
        @NotNull MethodSignature signature)
{
    HierarchicalMethodSignatureImpl existing = map.get(signature);
    if(existing == null)
    {
        HierarchicalMethodSignatureImpl copy = copy(hierarchicalMethodSignature);
        LOG.assertTrue(copy.getMethod().isValid());
        map.put(signature, copy);
    }
    else if(isReturnTypeIsMoreSpecificThan(hierarchicalMethodSignature, existing) && isSuperMethod(aClass, hierarchicalMethodSignature, existing))
    {
        HierarchicalMethodSignatureImpl newSuper = copy(hierarchicalMethodSignature);
        mergeSupers(newSuper, existing);
        LOG.assertTrue(newSuper.getMethod().isValid());
        map.put(signature, newSuper);
    }
    else if(isSuperMethod(aClass, existing, hierarchicalMethodSignature))
    {
        mergeSupers(existing, hierarchicalMethodSignature);
    }
    // just drop an invalid method declaration there - to highlight accordingly
    else if(!result.containsKey(signature))
    {
        LOG.assertTrue(hierarchicalMethodSignature.getMethod().isValid());
        result.put(signature, hierarchicalMethodSignature);
    }
}
项目:consulo-java    文件:PsiSuperMethodImplUtil.java   
@NotNull
private static HierarchicalMethodSignatureImpl copy(@NotNull HierarchicalMethodSignature hi)
{
    HierarchicalMethodSignatureImpl hierarchicalMethodSignature = new HierarchicalMethodSignatureImpl(hi);
    for(HierarchicalMethodSignature his : hi.getSuperSignatures())
    {
        hierarchicalMethodSignature.addSuperSignature(copy(his));
    }
    return hierarchicalMethodSignature;
}