< prev index next >

src/java.base/share/classes/java/lang/reflect/Constructor.java

Print this page
*** 24,10 ***
--- 24,11 ---
   */
  
  package java.lang.reflect;
  
  import jdk.internal.access.SharedSecrets;
+ import jdk.internal.value.PrimitiveClass;
  import jdk.internal.misc.VM;
  import jdk.internal.reflect.CallerSensitive;
  import jdk.internal.reflect.ConstructorAccessor;
  import jdk.internal.reflect.Reflection;
  import jdk.internal.vm.annotation.ForceInline;

*** 123,10 ***
--- 124,11 ---
                  int modifiers,
                  int slot,
                  String signature,
                  byte[] annotations,
                  byte[] parameterAnnotations) {
+         assert PrimitiveClass.isPrimaryType(declaringClass);
          this.clazz = declaringClass;
          this.parameterTypes = parameterTypes;
          this.exceptionTypes = checkedExceptions;
          this.modifiers = modifiers;
          this.slot = slot;

*** 361,17 ***
                                exceptionTypes);
      }
  
      @Override
      void specificToStringHeader(StringBuilder sb) {
!         sb.append(getDeclaringClass().getTypeName());
      }
  
      @Override
      String toShortString() {
          StringBuilder sb = new StringBuilder("constructor ");
!         sb.append(getDeclaringClass().getTypeName());
          sb.append('(');
          StringJoiner sj = new StringJoiner(",");
          for (Class<?> parameterType : getSharedParameterTypes()) {
              sj.add(parameterType.getTypeName());
          }
--- 363,17 ---
                                exceptionTypes);
      }
  
      @Override
      void specificToStringHeader(StringBuilder sb) {
!         sb.append(getDeclaringClassTypeName());
      }
  
      @Override
      String toShortString() {
          StringBuilder sb = new StringBuilder("constructor ");
!         sb.append(getDeclaringClassTypeName());
          sb.append('(');
          StringJoiner sj = new StringJoiner(",");
          for (Class<?> parameterType : getSharedParameterTypes()) {
              sj.add(parameterType.getTypeName());
          }
< prev index next >