예제 #1
0
파일: AsmUtil.java 프로젝트: bashor/kotlin
  public static int getMethodAsmFlags(FunctionDescriptor functionDescriptor, OwnerKind kind) {
    int flags = getCommonCallableFlags(functionDescriptor);

    if (functionDescriptor.getModality() == Modality.FINAL
        && !(functionDescriptor instanceof ConstructorDescriptor)) {
      DeclarationDescriptor containingDeclaration = functionDescriptor.getContainingDeclaration();
      if (!(containingDeclaration instanceof ClassDescriptor)
          || ((ClassDescriptor) containingDeclaration).getKind() != ClassKind.TRAIT) {
        flags |= ACC_FINAL;
      }
    }

    if (isStaticMethod(kind, functionDescriptor)) {
      flags |= ACC_STATIC;
    }

    if (isAbstractMethod(functionDescriptor, kind)) {
      flags |= ACC_ABSTRACT;
    }

    if (JetTypeMapper.isAccessor(functionDescriptor)) {
      flags |= ACC_SYNTHETIC;
    }

    return flags;
  }
예제 #2
0
파일: AsmUtil.java 프로젝트: bashor/kotlin
 public static boolean isAbstractMethod(FunctionDescriptor functionDescriptor, OwnerKind kind) {
   return (functionDescriptor.getModality() == Modality.ABSTRACT
           || isInterface(functionDescriptor.getContainingDeclaration()))
       && !isStaticMethod(kind, functionDescriptor);
 }