Additional information to catch EA-75872
This commit is contained in:
+3
-2
@@ -55,7 +55,7 @@ public class DefaultErrorMessages {
|
||||
DiagnosticFactoryToRendererMap getMap();
|
||||
}
|
||||
|
||||
private static final DiagnosticFactoryToRendererMap MAP = new DiagnosticFactoryToRendererMap();
|
||||
private static final DiagnosticFactoryToRendererMap MAP = new DiagnosticFactoryToRendererMap("Default");
|
||||
private static final MappedExtensionProvider<Extension, List<DiagnosticFactoryToRendererMap>> RENDERER_MAPS = MappedExtensionProvider.create(
|
||||
Extension.EP_NAME,
|
||||
new Function1<List<? extends Extension>, List<DiagnosticFactoryToRendererMap>>() {
|
||||
@@ -79,7 +79,8 @@ public class DefaultErrorMessages {
|
||||
return renderer.render(diagnostic);
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Don't know how to render diagnostic of type " + diagnostic.getFactory().getName());
|
||||
throw new IllegalArgumentException("Don't know how to render diagnostic of type " + diagnostic.getFactory().getName() +
|
||||
" with the following renderer maps: " + RENDERER_MAPS.get());
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
|
||||
+14
@@ -30,6 +30,20 @@ public final class DiagnosticFactoryToRendererMap {
|
||||
private final Map<DiagnosticFactory<?>, DiagnosticRenderer<?>> map = new HashMap<DiagnosticFactory<?>, DiagnosticRenderer<?>>();
|
||||
private boolean immutable = false;
|
||||
|
||||
// TO catch EA-75872
|
||||
private final String name;
|
||||
public DiagnosticFactoryToRendererMap(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public DiagnosticFactoryToRendererMap() {
|
||||
this("<unnamed>");
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DiagnosticFactory#" + name;
|
||||
}
|
||||
//
|
||||
|
||||
private void checkMutability() {
|
||||
if (immutable) {
|
||||
throw new IllegalStateException("factory to renderer map is already immutable");
|
||||
|
||||
Reference in New Issue
Block a user