提交 140ef0f5 编写于 作者: M mcimadamore

6845686: basic and raw formatters do not display captured var id properly when...

6845686: basic and raw formatters do not display captured var id properly when javac runs in -XDoldDiags mode
Summary: Basic and raw formatters do not override Printer methods properly
Reviewed-by: jjg
上级 12335234
......@@ -172,9 +172,6 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
return formatIterable(d, (Iterable<?>)arg, l);
}
else if (arg instanceof Type) {
if (!allCaptured.contains(arg)) {
allCaptured = allCaptured.append((Type)arg);
}
return printer.visit((Type)arg, l);
}
else if (arg instanceof Symbol) {
......@@ -482,5 +479,12 @@ public abstract class AbstractDiagnosticFormatter implements DiagnosticFormatter
protected String capturedVarId(CapturedType t, Locale locale) {
return "" + (allCaptured.indexOf(t) + 1);
}
@Override
public String visitCapturedType(CapturedType t, Locale locale) {
if (!allCaptured.contains(t)) {
allCaptured = allCaptured.append(t);
}
return super.visitCapturedType(t, locale);
}
};
}
......@@ -27,6 +27,7 @@
* @summary Basic/Raw formatters should use type/symbol printer instead of toString()
* @author mcimadamore
* @compile/fail/ref=T6799605.out -XDrawDiagnostics T6799605.java
* @compile/fail/ref=T6799605.out -XDoldDiags -XDrawDiagnostics T6799605.java
*/
class T6799605<X> {
......
T6799605.java:39:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>, kindname.class, T6799605<X>
T6799605.java:40:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>, kindname.class, T6799605<X>
T6799605.java:41:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>, kindname.class, T6799605<X>
T6799605.java:40:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>, kindname.class, T6799605<X>
T6799605.java:41:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>, kindname.class, T6799605<X>
T6799605.java:42:9: compiler.err.cant.resolve.location.args: kindname.method, m, , T6799605<compiler.misc.type.captureof: 1, ?>,T6799605<compiler.misc.type.captureof: 2, ?>,T6799605<compiler.misc.type.captureof: 3, ?>, kindname.class, T6799605<X>
3 errors
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册