< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java

Print this page
*** 229,10 ***
--- 229,25 ---
          Assert.checkNonNull(metadata);
          this.tsym = tsym;
          this.metadata = metadata;
      }
  
+     public boolean isValueClass() {
+         return false;
+     }
+ 
+     public boolean isIdentityClass() {
+         return false;
+     }
+ 
+     // Does this type need to be preloaded in the context of the referring class ??
+     public boolean requiresPreload(Symbol referringClass) {
+         if (this.tsym == referringClass)
+             return false; // pointless
+         return this.isValueClass();
+     }
+ 
      /**
       * A subclass of {@link Types.TypeMapping} which applies a mapping recursively to the subterms
       * of a given type expression. This mapping returns the original type is no changes occurred
       * when recursively mapping the original type's subterms.
       */

*** 1031,11 ***
          public int poolTag() {
              return ClassFile.CONSTANT_Class;
          }
  
          @Override
!         protected ClassType cloneWithMetadata(List<TypeMetadata> md) {
              return new ClassType(outer_field, typarams_field, tsym, md) {
                  @Override
                  public Type baseType() { return ClassType.this.baseType(); }
              };
          }
--- 1046,11 ---
          public int poolTag() {
              return ClassFile.CONSTANT_Class;
          }
  
          @Override
!         public ClassType cloneWithMetadata(List<TypeMetadata> md) {
              return new ClassType(outer_field, typarams_field, tsym, md) {
                  @Override
                  public Type baseType() { return ClassType.this.baseType(); }
              };
          }

*** 1168,10 ***
--- 1183,20 ---
          @Override
          public boolean isReference() {
              return true;
          }
  
+         @Override
+         public boolean isValueClass() {
+             return tsym != null && tsym.isValueClass();
+         }
+ 
+         @Override
+         public boolean isIdentityClass() {
+             return tsym != null && tsym.isIdentityClass();
+         }
+ 
          @Override
          public boolean isNullOrReference() {
              return true;
          }
  

*** 2327,12 ***
              c.kind = ERR;
              c.members_field = new Scope.ErrorScope(c);
          }
  
          public ErrorType(Type originalType, TypeSymbol tsym) {
!             super(noType, List.nil(), null);
-             this.tsym = tsym;
              this.originalType = (originalType == null ? noType : originalType);
          }
  
          private ErrorType(Type originalType, TypeSymbol tsym,
                            List<TypeMetadata> metadata) {
--- 2352,11 ---
              c.kind = ERR;
              c.members_field = new Scope.ErrorScope(c);
          }
  
          public ErrorType(Type originalType, TypeSymbol tsym) {
!             super(noType, List.nil(), tsym, List.nil());
              this.originalType = (originalType == null ? noType : originalType);
          }
  
          private ErrorType(Type originalType, TypeSymbol tsym,
                            List<TypeMetadata> metadata) {

*** 2340,11 ***
              this.tsym = tsym;
              this.originalType = (originalType == null ? noType : originalType);
          }
  
          @Override
!         protected ErrorType cloneWithMetadata(List<TypeMetadata> md) {
              return new ErrorType(originalType, tsym, md) {
                  @Override
                  public Type baseType() { return ErrorType.this.baseType(); }
              };
          }
--- 2364,11 ---
              this.tsym = tsym;
              this.originalType = (originalType == null ? noType : originalType);
          }
  
          @Override
!         public ErrorType cloneWithMetadata(List<TypeMetadata> md) {
              return new ErrorType(originalType, tsym, md) {
                  @Override
                  public Type baseType() { return ErrorType.this.baseType(); }
              };
          }
< prev index next >