mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-30 12:50:11 +00:00
6845686: basic and raw formatters do not display captured var id properly when javac runs in -XDoldDiags mode
Basic and raw formatters do not override Printer methods properly Reviewed-by: jjg
This commit is contained in:
parent
b88afe3210
commit
518efd59c1
@ -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> {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user