< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java
Print this page
private final Resolve resolve;
private final TreeMaker make;
private final Symtab syms;
private final TypeEnvs typeEnvs;
private final Types types;
+ private final Preview preview;
private final Attribute theUnfinishedDefaultValue;
private final String sourceName;
@SuppressWarnings("this-escape")
names = Names.instance(context);
resolve = Resolve.instance(context);
syms = Symtab.instance(context);
typeEnvs = TypeEnvs.instance(context);
types = Types.instance(context);
+ preview = Preview.instance(context);
theUnfinishedDefaultValue = new Attribute.Error(syms.errType);
Source source = Source.instance(context);
sourceName = source.name;
&& toAnnotate.kind == TYP
&& types.isSameType(c.type, syms.valueBasedType)) {
toAnnotate.flags_field |= Flags.VALUE_BASED;
}
+ if (!c.type.isErroneous()
+ && toAnnotate.kind == TYP
+ && types.isSameType(c.type, syms.migratedValueClassType)) {
+ toAnnotate.flags_field |= Flags.MIGRATED_VALUE_CLASS;
+ }
+
+ if (!c.type.isErroneous()
+ && toAnnotate.kind == VAR
+ && toAnnotate.owner.kind == TYP
+ && types.isSameType(c.type, syms.strictType)) {
+ preview.checkSourceLevel(pos.get(c), Feature.VALUE_CLASSES);
+ toAnnotate.flags_field |= Flags.STRICT;
+ // temporary hack to indicate that a class has at least one strict field
+ toAnnotate.owner.flags_field |= Flags.HAS_STRICT;
+ }
+
if (!c.type.isErroneous()
&& types.isSameType(c.type, syms.restrictedType)) {
toAnnotate.flags_field |= Flags.RESTRICTED;
}
< prev index next >