< prev index next >

src/java.base/share/classes/java/lang/constant/ClassDesc.java

Print this page
*** 56,11 ***
   */
  public sealed interface ClassDesc
          extends ConstantDesc,
                  TypeDescriptor.OfField<ClassDesc>
          permits PrimitiveClassDescImpl,
!                 ReferenceClassDescImpl {
  
      /**
       * Returns a {@linkplain ClassDesc} for a class or interface type,
       * given the name of the class or interface, such as {@code "java.lang.String"}.
       * (To create a descriptor for an array type, either use {@link #ofDescriptor(String)}
--- 56,11 ---
   */
  public sealed interface ClassDesc
          extends ConstantDesc,
                  TypeDescriptor.OfField<ClassDesc>
          permits PrimitiveClassDescImpl,
!                 ClassDescImpl {
  
      /**
       * Returns a {@linkplain ClassDesc} for a class or interface type,
       * given the name of the class or interface, such as {@code "java.lang.String"}.
       * (To create a descriptor for an array type, either use {@link #ofDescriptor(String)}

*** 169,11 ***
                      "Cannot create an array type descriptor with more than " +
                      ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS + " dimensions");
          }
          return (descriptor.length() == 1)
                 ? new PrimitiveClassDescImpl(descriptor)
!                : new ReferenceClassDescImpl(descriptor);
      }
  
      /**
       * Returns a {@linkplain ClassDesc} for an array type whose component type
       * is described by this {@linkplain ClassDesc}.
--- 169,11 ---
                      "Cannot create an array type descriptor with more than " +
                      ConstantUtils.MAX_ARRAY_TYPE_DESC_DIMENSIONS + " dimensions");
          }
          return (descriptor.length() == 1)
                 ? new PrimitiveClassDescImpl(descriptor)
!                : new ClassDescImpl(descriptor);
      }
  
      /**
       * Returns a {@linkplain ClassDesc} for an array type whose component type
       * is described by this {@linkplain ClassDesc}.
< prev index next >