< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
Print this page
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.
*/
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(); }
};
}
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(); }
};
}
@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;
}
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) {
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) {
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(); }
};
}
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 >