< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java

Print this page

210     public final Name bootstrap;
211 
212     public final Name record;
213     public final Name non;
214 
215     // serialization members, used by records too
216     public final Name serialPersistentFields;
217     public final Name writeObject;
218     public final Name writeReplace;
219     public final Name readObjectNoData;
220 
221     // sealed types
222     public final Name permits;
223     public final Name sealed;
224 
225     // pattern switches
226     public final Name typeSwitch;
227     public final Name enumSwitch;
228     public final Name enumConstant;
229 





230     public final Name.Table table;
231 
232     @SuppressWarnings("this-escape")
233     public Names(Context context) {
234         Options options = Options.instance(context);
235         table = createTable(options);
236 
237         // operators and punctuation
238         asterisk = fromString("*");
239         comma = fromString(",");
240         empty = fromString("");
241         hyphen = fromString("-");
242         one = fromString("1");
243         slash = fromString("/");
244 
245         // keywords
246         _class = fromString("class");
247         _super = fromString("super");
248         _this = fromString("this");
249         var = fromString("var");

393         makeConcatWithConstants = fromString("makeConcatWithConstants");
394 
395         bootstrap = fromString("bootstrap");
396         record = fromString("record");
397         non = fromString("non");
398 
399         serialPersistentFields = fromString("serialPersistentFields");
400         writeObject = fromString("writeObject");
401         writeReplace = fromString("writeReplace");
402         readObjectNoData = fromString("readObjectNoData");
403 
404         // sealed types
405         permits = fromString("permits");
406         sealed = fromString("sealed");
407 
408 
409         // pattern switches
410         typeSwitch = fromString("typeSwitch");
411         enumSwitch = fromString("enumSwitch");
412         enumConstant = fromString("enumConstant");





413     }
414 
415     protected Name.Table createTable(Options options) {
416         boolean useUnsharedTable = options.isSet("useUnsharedTable");
417         if (useUnsharedTable)
418             return newUnsharedNameTable();
419         boolean useSharedTable = options.isSet("useSharedTable");
420         if (useSharedTable)
421             return newSharedNameTable();
422         boolean internStringTable = options.isSet("internStringTable");
423         return newStringNameTable(internStringTable);
424     }
425 
426     public StringNameTable newStringNameTable(boolean intern) {
427         return StringNameTable.create(this, intern);
428     }
429 
430     public SharedNameTable newSharedNameTable() {
431         return SharedNameTable.create(this);
432     }

210     public final Name bootstrap;
211 
212     public final Name record;
213     public final Name non;
214 
215     // serialization members, used by records too
216     public final Name serialPersistentFields;
217     public final Name writeObject;
218     public final Name writeReplace;
219     public final Name readObjectNoData;
220 
221     // sealed types
222     public final Name permits;
223     public final Name sealed;
224 
225     // pattern switches
226     public final Name typeSwitch;
227     public final Name enumSwitch;
228     public final Name enumConstant;
229 
230     // code reflection
231     public final Name jdk_incubator_code;
232     public final Name quoted;
233     public final Name quotable;
234 
235     public final Name.Table table;
236 
237     @SuppressWarnings("this-escape")
238     public Names(Context context) {
239         Options options = Options.instance(context);
240         table = createTable(options);
241 
242         // operators and punctuation
243         asterisk = fromString("*");
244         comma = fromString(",");
245         empty = fromString("");
246         hyphen = fromString("-");
247         one = fromString("1");
248         slash = fromString("/");
249 
250         // keywords
251         _class = fromString("class");
252         _super = fromString("super");
253         _this = fromString("this");
254         var = fromString("var");

398         makeConcatWithConstants = fromString("makeConcatWithConstants");
399 
400         bootstrap = fromString("bootstrap");
401         record = fromString("record");
402         non = fromString("non");
403 
404         serialPersistentFields = fromString("serialPersistentFields");
405         writeObject = fromString("writeObject");
406         writeReplace = fromString("writeReplace");
407         readObjectNoData = fromString("readObjectNoData");
408 
409         // sealed types
410         permits = fromString("permits");
411         sealed = fromString("sealed");
412 
413 
414         // pattern switches
415         typeSwitch = fromString("typeSwitch");
416         enumSwitch = fromString("enumSwitch");
417         enumConstant = fromString("enumConstant");
418 
419         // code reflection
420         jdk_incubator_code = fromString("jdk.incubator.code");
421         quoted = fromString("Quoted");
422         quotable = fromString("Quotable");
423     }
424 
425     protected Name.Table createTable(Options options) {
426         boolean useUnsharedTable = options.isSet("useUnsharedTable");
427         if (useUnsharedTable)
428             return newUnsharedNameTable();
429         boolean useSharedTable = options.isSet("useSharedTable");
430         if (useSharedTable)
431             return newSharedNameTable();
432         boolean internStringTable = options.isSet("internStringTable");
433         return newStringNameTable(internStringTable);
434     }
435 
436     public StringNameTable newStringNameTable(boolean intern) {
437         return StringNameTable.create(this, intern);
438     }
439 
440     public SharedNameTable newSharedNameTable() {
441         return SharedNameTable.create(this);
442     }
< prev index next >