95 setRichPrinter(new RichPrinter()); |
95 setRichPrinter(new RichPrinter()); |
96 this.syms = Symtab.instance(context); |
96 this.syms = Symtab.instance(context); |
97 this.diags = JCDiagnostic.Factory.instance(context); |
97 this.diags = JCDiagnostic.Factory.instance(context); |
98 this.types = Types.instance(context); |
98 this.types = Types.instance(context); |
99 this.messages = JavacMessages.instance(context); |
99 this.messages = JavacMessages.instance(context); |
100 whereClauses = new EnumMap<WhereClauseKind, Map<Type, JCDiagnostic>>(WhereClauseKind.class); |
100 whereClauses = new EnumMap<>(WhereClauseKind.class); |
101 configuration = new RichConfiguration(Options.instance(context), formatter); |
101 configuration = new RichConfiguration(Options.instance(context), formatter); |
102 for (WhereClauseKind kind : WhereClauseKind.values()) |
102 for (WhereClauseKind kind : WhereClauseKind.values()) |
103 whereClauses.put(kind, new LinkedHashMap<Type, JCDiagnostic>()); |
103 whereClauses.put(kind, new LinkedHashMap<>()); |
104 } |
104 } |
105 |
105 |
106 @Override |
106 @Override |
107 public String format(JCDiagnostic diag, Locale l) { |
107 public String format(JCDiagnostic diag, Locale l) { |
108 StringBuilder sb = new StringBuilder(); |
108 StringBuilder sb = new StringBuilder(); |
277 * to fullnames as compact names might lead to a confusing diagnostic. |
277 * to fullnames as compact names might lead to a confusing diagnostic. |
278 */ |
278 */ |
279 protected class ClassNameSimplifier { |
279 protected class ClassNameSimplifier { |
280 |
280 |
281 /* table for keeping track of all short name usages */ |
281 /* table for keeping track of all short name usages */ |
282 Map<Name, List<Symbol>> nameClashes = new HashMap<Name, List<Symbol>>(); |
282 Map<Name, List<Symbol>> nameClashes = new HashMap<>(); |
283 |
283 |
284 /** |
284 /** |
285 * Add a name usage to the simplifier's internal cache |
285 * Add a name usage to the simplifier's internal cache |
286 */ |
286 */ |
287 protected void addUsage(Symbol sym) { |
287 protected void addUsage(Symbol sym) { |