Exemplo n.º 1
0
 /*
    Use this method to get visibility flag for class to define it in byte code (v.defineClass method).
    For other cases use getVisibilityAccessFlag(MemberDescriptor descriptor)
    Classes in byte code should be public or package private
 */
 public static int getVisibilityAccessFlagForClass(ClassDescriptor descriptor) {
   if (DescriptorUtils.isTopLevelDeclaration(descriptor)
       || descriptor.getVisibility() == Visibilities.PUBLIC
       || descriptor.getVisibility() == Visibilities.INTERNAL) {
     return ACC_PUBLIC;
   }
   return NO_FLAG_PACKAGE_PRIVATE;
 }
Exemplo n.º 2
0
 @NotNull
 public static Type getTraitImplThisParameterType(
     @NotNull ClassDescriptor traitDescriptor, @NotNull JetTypeMapper typeMapper) {
   JetType jetType = getSuperClass(traitDescriptor);
   Type type = typeMapper.mapType(jetType);
   if (type.getInternalName().equals("java/lang/Object")) {
     return typeMapper.mapType(traitDescriptor.getDefaultType());
   }
   return type;
 }