Example #1
0
  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;
  }
Example #2
0
 public static boolean isStaticMethod(OwnerKind kind, FunctionDescriptor functionDescriptor) {
   return isStatic(kind) || JetTypeMapper.isAccessor(functionDescriptor);
 }