changeset 52956:db0e6d7525d4 jep-334

include Constable and ConstantDesc in diagnostics
author vromero
date Thu, 01 Nov 2018 14:53:08 -0400
parents 9b2652a213e2
children 38c60cb85e19
files src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java
diffstat 1 files changed, 0 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Sat Oct 20 17:02:49 2018 -0400
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/util/RichDiagnosticFormatter.java	Thu Nov 01 14:53:08 2018 -0400
@@ -29,11 +29,9 @@
 import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Set;
 
 import com.sun.tools.javac.code.Printer;
 import com.sun.tools.javac.code.Symbol;
@@ -42,9 +40,7 @@
 import com.sun.tools.javac.code.Type;
 import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.code.Types;
-import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.resources.CompilerProperties.Fragments;
-import com.sun.tools.javac.util.JCDiagnostic.DiagnosticFlag;
 
 import static com.sun.tools.javac.code.Flags.*;
 import static com.sun.tools.javac.code.TypeTag.*;
@@ -109,16 +105,8 @@
         configuration = new RichConfiguration(Options.instance(context), formatter);
         for (WhereClauseKind kind : WhereClauseKind.values())
             whereClauses.put(kind, new LinkedHashMap<Type, JCDiagnostic>());
-        symbolsToRemove.add(syms.constableType.tsym);
-        symbolsToRemove.add(syms.constantDescType.tsym);
-        Options options = Options.instance(context);
-        compactMethodDiags = options.isSet(Option.XDIAGS, "compact") ||
-                options.isUnset(Option.XDIAGS) && options.isUnset("rawDiagnostics");
     }
 
-    Set<TypeSymbol> symbolsToRemove = new HashSet<>();
-    final boolean compactMethodDiags;
-
     @Override
     public String format(JCDiagnostic diag, Locale l) {
         StringBuilder sb = new StringBuilder();
@@ -533,22 +521,7 @@
                 if (indexOf(t, WhereClauseKind.INTERSECTION) == -1) {
                     Type supertype = types.supertype(t);
                     List<Type> interfaces = types.interfaces(t);
-                    ListBuffer<Type> interfaceBuffer = new ListBuffer<>();
-                    boolean removed = false;
-                    if (compactMethodDiags) {
-                        for (Type interf : interfaces) {
-                            if (!symbolsToRemove.contains(interf.tsym)) {
-                                interfaceBuffer.add(interf);
-                            } else {
-                                removed = true;
-                            }
-                        }
-                        interfaces = interfaceBuffer.toList();
-                    }
                     JCDiagnostic d = diags.fragment(Fragments.WhereIntersection(t, interfaces.prepend(supertype)));
-                    if (removed) {
-                        d.setFlag(DiagnosticFlag.COMPRESSED);
-                    }
                     whereClauses.get(WhereClauseKind.INTERSECTION).put(t, d);
                     visit(supertype);
                     visit(interfaces);