예제 #1
0
파일: AsmUtil.java 프로젝트: bashor/kotlin
 /*
    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;
 }
예제 #2
0
파일: AsmUtil.java 프로젝트: bashor/kotlin
 @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;
 }